Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Interrupt processing in Windows

I want to know which threads processes device interrupts. What happens when there is a interrupt when a user mode thread is running? Also do other user threads get a chance to run when the system is processing an interrupt?

Kindly suggest me some reference material describing how interrupts are handled by windows.

like image 815
Canopus Avatar asked Apr 03 '09 05:04

Canopus


People also ask

What process is system interrupts?

What Is "System Interrupts"? System interrupts appears as a Windows process in your Task Manager, but it's not really a process. Rather, it's a kind of representative that reports the CPU usage of all interrupts that happen on a lower system level.

How are interrupts implemented in Windows?

A device generates the interrupt by sending an electrical signal on a dedicated pin known as an interrupt line. Versions of Microsoft Windows prior to Windows Vista only support line-based interrupts. Beginning with PCI 2.2, PCI devices can generate message-signaled interrupts.

What is system interrupts in Windows?

System interrupts is an official part of the Windows operating system. It manages the communication between your computer hardware and system. You can find it shown as a process in Task Manager. That's used to display the CPU usage of all hardware interrupts.

How are device interrupts processed by the CPU?

Device interrupts themselves are (usually) processed by whatever thread had the CPU that took the interrupt, but in a ring 0 and at a different protection level.

How can I see the CPU usage for system interrupts?

You can find it displayed as a process in Task Manager, showing the CPU usage for all hardware interrupts. System interrupts likes an alarm system for CPU. If a scenario needs CPU attention, system interrupts will remind the processor of the high priority condition.

Why does the CPU have to prioritize system interrupts?

That’s why the CPU has to prioritize them. Hardware interrupts generally have higher priority than others. In general cases, System Interrupts process shows less than 1% CPU usage in the Task Manager. Depending on the situation, it can even range between 5% to 10% sometimes.


2 Answers

Device interrupts themselves are (usually) processed by whatever thread had the CPU that took the interrupt, but in a ring 0 and at a different protection level. This limits some of the actions an interrupt handler can take, because most of the time the current thread will not be related to the thread that is waiting for the event to happen that the interrupt is indicating.

The kernel itself is closed source, and only documented through its internal API. That API is exposed to device driver authors, and described in the driver development kits.

Some resources to get you started:

  • Any edition of Microsoft Windows Internals by Solomon and Russinovich. The current seems to be the 4th edition, but even an old edition will help.

  • The Windows DDK, now renamed the WDK. Its documentation is available online too. Be sure to read the Kernel Mode Design Guide...

  • Sysinternals has tools and articles to probe at and explain the kernel's behavior. This used to be an independent site until Microsoft got tired of Mark Russinovich seeming to know more about how the kernel worked than they did. ;-)

Note that source code to many of the common device drivers are included in the DDK in the samples. Although the production versions are almost certainly different, reading the sample drivers can answer some questions even if you don't want to implement a driver yourself.

like image 54
RBerteig Avatar answered Sep 18 '22 03:09

RBerteig


Like any other operating system, Windows processes interrupts in Kernel mode, with an elevated Interrupt Priority Level (I think they call them IRPL's, but I don't know what the "R" stands for). Any user thread or lower-level Kernel thread running on the same machine will be interrupted while the interrupt request is processed, and will be resumed when the ineterrupt processing is complete.

like image 33
John Saunders Avatar answered Sep 19 '22 03:09

John Saunders