madaxian
驱动牛犊
驱动牛犊
  • 注册日期2009-01-31
  • 最后登录2010-04-04
  • 粉丝0
  • 关注0
  • 积分10分
  • 威望81点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:1915回复:1

简单问题:windows下的 “时钟中断(硬件)”对应的处理例程是INT0 还是 INT几?

楼主#
更多 发布于:2009-12-07 22:22
正在看wrk关于线程切换的函数,这些函数最根本都是有时钟中断例程调用的.
到百度搜了半天也没找到windows下的时钟中断是INT几, 貌似 那个 lux 系统是 INT0,windows没查到,所以知道的麻烦告诉下!
philoman
驱动牛犊
驱动牛犊
  • 注册日期2005-05-29
  • 最后登录2011-07-13
  • 粉丝0
  • 关注0
  • 积分73分
  • 威望235点
  • 贡献值0点
  • 好评度5点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2009-12-08 22:07
其实我也不知道,最近看Winternals,帮你找到几句话,不知是否有用:
Mapping Interrupts to IRQLs IRQL levels aren't the same as the interrupt requests (IRQs) defined by interrupt controllers—the architectures on which Windows runs don't implement the concept of IRQLs in hardware. So how does Windows determine what IRQL to assign to an interrupt? The answer lies in the HAL. In Windows, a type of device driver called a bus driver determines the presence of devices on its bus (PCI, USB, and so on) and what interrupts can be assigned to a device. The bus driver reports this information to the Plug and Play manager, which decides, after taking into account the acceptable interrupt assignments for all other devices, which interrupt will be assigned to each device. Then it calls the HAL function HalpGetSystemInterruptVector, which maps interrupts to IRQLs.

The algorithm for assignment differs for the various HALs that Windows includes. On uniprocessor x86 systems, the HAL performs a straightforward translation: the IRQL of a given interrupt vector is calculated by subtracting the interrupt vector from 27. Thus, if a device uses interrupt vector 5, its ISR executes at IRQL 22. On an x86 multiprocessor system, the mapping isn't as simple. APICs support over 200 interrupt vectors, so there aren't enough IRQLs for a one-to-one correspondence. The multiprocessor HAL therefore assigns IRQLs to interrupt vectors in a round-robin manner, cycling through the device IRQL (DIRQL) range. As a result, on an x86 multiprocessor system there's no easy way for you to predict or to know what IRQL Windows assigns to APIC IRQs. Finally, on x64 and IA64 systems, the HAL computes the IRQL for a given IRQ by dividing the interrupt vector assigned to the IRQ by 16.
游客

返回顶部