Windows中的中断处理 [英] Interrupt processing in Windows

查看:274
本文介绍了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?

请给我一些参考资料,描述Windows如何处理中断.

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

推荐答案

(通常)设备中断本身由具有接受中断的CPU的任何线程处理,但在环0且保护级别不同.这限制了中断处理程序可以执行的某些操作,因为在大多数情况下,当前线程不会与正在等待该中断指示的事件发生的线程相关.

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.

内核本身是封闭源代码,仅通过其内部API进行记录.该API向设备驱动程序作者公开,并在驱动程序开发套件中进行了描述.

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:

  • 任何版本的 Microsoft Windows内幕 ,作者是Solomon和Russinovich.当前似乎是第4版,但即使是旧版也有帮助.

  • 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.

Windows DDK现在重命名为 WDK .它的文档也是在线可用.请务必阅读内核模式设计指南 ...

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

Sysinternals 有工具和文章可供您探索并解释内核的行为.在微软厌倦了Mark Russinovich似乎比他们更了解内核如何工作之前,它曾经是一个独立的站点. ;-)

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. ;-)

请注意,示例中的DDK中包含许多常见设备驱动程序的源代码.尽管生产版本几乎肯定有所不同,但是即使您不想自己实现驱动程序,阅读示例驱动程序也可以回答一些问题.

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.

这篇关于Windows中的中断处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆