阅读:1015回复:4
在驱动中直接int
设有一个中断以分配给了一个设备,能不能在一个Driver中
int n, 使该设备的DRIVER的isr响应。 |
|
沙发#
发布于:2002-02-21 00:56
YES, definitely you can use software int x instruction to simulate hardware interrupt. That\'s exactly what Windows do to process pended interrupts.
For example (Uniprocessor case): When there is an interrupt with low IRQL fired during higher IRQL code executing, Windows will pend this interrupt until IRQL is lowered. Whenever the IRQL is lowered, Windows will check if there any pended hardware interrupt, if yes, the HAL will execute a INT x instruction. I don\'t know how you tested that, but remember to map the IRQ to vector and then execute the INT x instruction. for example, IRQ of primary channel of ide controller is 0x0e(15), it\'s vector is mapped to 0x30+0xe=0x3e, then you should use int 0x3e instead of int 0x0e. The mapping formula: if( irq<8 ) vector = irq; else vector = irq + 0x30; [编辑 - 2/21/02 作者: kanghai] |
|
|
板凳#
发布于:2002-02-20 13:54
int n是什么意思?激发中断?
给点资料。 |
|
|
地板#
发布于:2002-02-20 12:54
试过了,不成,但为什么?
|
|
地下室#
发布于:2002-02-20 10:54
自己测试一下就知道了.
|
|
|