Windows Interrupt Handling

I want to know which threads handle device interrupts. What happens when there is an interrupt when a user-mode thread is started? Do other user threads also occur when the system processes an interrupt?

Please offer me some reference material describing how interrupts are handled by windows.

+7
windows interrupt
source share
3 answers

Native interrupts (usually) are handled by any thread that had a processor that received the interrupt, but at ring 0 and at another level of protection. This limits some of the actions that the interrupt handler can take because most of the time the current thread will not be associated with a thread that is waiting for an event that indicates an interrupt.

The kernel itself is closed source and is only documented through its internal API. This API is provided to device driver authors and is described in driver development kits.

Some resources to get started:

  • Any version of Microsoft Windows Internals Solomon and Russinovich. This appears to be the fourth edition, but even the old edition will help.

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

  • Sysinternals contains tools and articles for researching and explaining kernel behavior. It used to be an independent site, until Microsoft got tired of Mark Russinovich, it seems to learn more about how the kernel works than they do .; -)

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

+3
source share

Like any other operating system, Windows handles interrupts in kernel mode with a higher priority level for interrupts (I think they call them IRPL, but I don’t know what β€œR” means). Any user stream or lower level Kernel stream running on the same computer will be interrupted during interrupt request processing and will be resumed after ineterrupt processing is completed.

+1
source share

To learn more about device interrupts in Windows, you need to study the development of device drivers. This is a niche topic, I don’t think you can find many useful resources on the Internet, and you may have to look for a book or training course.

In any case, Windows handles interrupts with interrupt request levels (IRQL) and deferred call procedures . The interrupt is handled in kernel mode, which operates at a higher priority than user mode. The correct interrupt handler should respond very quickly. It performs only the absolutely necessary operations and registers a call to the pending procedure to run in the future. This will happen when the system is at the interrupt request level.

0
source share

All Articles