houjzs
驱动牛犊
驱动牛犊
  • 注册日期2002-01-29
  • 最后登录2002-07-10
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:1015回复:4

在驱动中直接int

楼主#
更多 发布于:2002-02-19 15:51
设有一个中断以分配给了一个设备,能不能在一个Driver中
 int n,
使该设备的DRIVER的isr响应。
WindThruEars
驱动老牛
驱动老牛
  • 注册日期2002-11-17
  • 最后登录2004-07-10
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
沙发#
发布于: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]
我是假耳朵
KungFu
驱动大牛
驱动大牛
  • 注册日期2001-09-27
  • 最后登录2008-04-08
  • 粉丝0
  • 关注0
  • 积分221分
  • 威望24点
  • 贡献值0点
  • 好评度19点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2002-02-20 13:54
int n是什么意思?激发中断?
给点资料。
我不写驱动好多年
houjzs
驱动牛犊
驱动牛犊
  • 注册日期2002-01-29
  • 最后登录2002-07-10
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
地板#
发布于:2002-02-20 12:54
试过了,不成,但为什么?
lu0
lu0
论坛版主
论坛版主
  • 注册日期2001-06-10
  • 最后登录2016-04-05
  • 粉丝2
  • 关注0
  • 积分-6311分
  • 威望21111点
  • 贡献值0点
  • 好评度7点
  • 原创分0分
  • 专家分0分
地下室#
发布于:2002-02-20 10:54
自己测试一下就知道了.
Regards, Lu Lin Webmaster of Inside Programming http://www.lu0s1.com
游客

返回顶部