阅读:1385回复:7
熟悉win2k驱动程序中断处理的朋友请帮忙,给分给钱均可,非常感谢。
我开发了一个PCI板卡的驱动程序,可是完成后却发现,当win2000系统中如果给我的板卡与其它的板卡分配了相同的中断,则打不开中断。
而且现在很多新计算机在win2000系统下,都将pci板卡的中断分配到了irq15以上,这样也是肯定打不开中断的。但是同样的计算机,同样的源程序,却可以在win98系统下正常工作。 哪位朋友能够在百忙中为兄弟解答一下?万分感谢。哪怕花点钱也行啊。 |
|
沙发#
发布于:2003-05-11 08:01
用户被禁言,该主题自动屏蔽! |
|
板凳#
发布于:2003-05-11 17:25
中断共享没处理好吧,不然现在出的声卡网卡怎么办 :D :D
|
|
|
地板#
发布于:2003-05-12 09:03
没遇到过,实在不行重新把系统做一下。
|
|
地下室#
发布于:2003-05-12 09:04
还有就是你有没有试一下换个PCI插槽?
|
|
5楼#
发布于:2003-05-13 00:00
就算没有处理好中断共享吧,可是应该怎么处理呢?因为同样的源程序,在win98系统下是好使的,而在win2k系统下就不能共享中断。换了多台计算机,效果是一样的。谁有高招?别人都没有遇到过吗?奇怪!我可是用windriver自带的例程kptest 为骨架开发的,而且它自带的这个程序也同样有这个问题。我还有ddk写过一个程序,也是同样的,真弄不明白。
|
|
6楼#
发布于:2003-05-13 16:39
可以肯定是中断的共享没有处理好。你可以参看ddk中关于中断处理的章节。
看ddk是很费时。可是是最保险的解决办法。嘿嘿,很有可能你没有按规定做,导致你的ISR没有被真正挂接上。 以下是节选: Registering an ISR To register an ISR, a driver\'s DispatchPnP routine must call IoConnectInterrupt when it receives an IRP_MN_START_DEVICE request. In response, the I/O Manager creates an interrupt object for each processor that the device can interrupt. Connecting to a Single Interrupt Vector If the ISR handles a single device that uses a single interrupt vector, the driver should specify the following parameters when calling IoConnectInterrupt: The address of a driver-allocated location that receives the interrupt object pointer returned by IoConnectInterrupt. The ISR\'s entry point. A pointer to driver-supplied information the ISR will use when it is called (see Providing ISR Context Information). A NULL spin lock pointer, which indicates that the driver will use an internal interrupt spin lock provided by the system (see Synchronizing Access to Device Data). The device\'s interrupt vector, obtained from a CmResourceTypeInterrupt resource in the CM_RESOURCE_LIST structure for translated resources, received in the IRP_MN_START_DEVICE IRP. The device\'s DIRQL, obtained from a CmResourceTypeInterrupt resource in the CM_RESOURCE_LIST structure for translated resources, received in the IRP_MN_START_DEVICE IRP. (Use this value for both the Irql and SynchronizeIrql parameters.) The device\'s interrupt triggering mode (level-sensitive or latched), obtained from the Flags member of a CmResourceTypeInterrupt resource, in the CM_RESOURCE_LIST structure for translated resources received in the IRP_MN_START_DEVICE IRP. A Boolean value indicating whether the device can share the vector, calculated by examining the ShareDisposition member of a CmResourceTypeInterrupt resource, in the CM_RESOURCE_LIST structure for translated resources received in the IRP_MN_START_DEVICE IRP. A processor affinity mask value, indicating the set of processors the device can interrupt on the machine, obtained from a CmResourceTypeInterrupt resource in the CM_RESOURCE_LIST structure for translated resources, received in the IRP_MN_START_DEVICE IRP. A value indicating whether the system should save floating-point registers when the device interrupts (this must be FALSE for platform-independent drivers). In response to the IoConnectInterrupt call, the I/O Manager does the following Allocates sufficient resident memory for as many interrupt objects as the processor affinity mask indicates, which could be as many interrupt objects as processors in SMP machines or could be a lesser number. The I/O Manager also provides an internal interrupt spin lock and initializes it if the driver passes a NULL pointer to IoConnectInterrupt. Initializes each interrupt object and connects it to a particular processor in the machine. To connect the interrupt object, this call sets the specified interrupt vector in the kernel\'s Interrupt Dispatch Table (IDT) for each specified processor. (For more information about IDTs, see Inside Windows NT from Microsoft Press.) When all interrupt objects have been initialized and connected to the processors, IoConnectInterrupt returns a pointer to the set of interrupt objects. Driver routines must pass the returned pointer when calling KeSynchronizeExecution. When a device interrupts one of a machine\'s processors, the driver\'s ISR executes on that processor at DIRQL and receives the context pointer that the driver specified when calling IoConnectInterrupt. Connecting to Multiple Interrupt Vectors If a driver must handle interrupts from more than one device, each with a different interrupt vector, or if a single device can interrupt through more than one interrupt vector, the driver can have a single multi-vector ISR, or it can have multiple ISRs. Such a driver must call IoConnectInterrupt for each interrupt vector. It must also allocate a spin lock for each interrupt vector. The following steps must be used: The driver must call KeInitializeSpinLock with a pointer to driver-provided, resident storage for an interrupt spin lock (in a device extension, controller extension, or nonpaged pool allocated by the driver). For each interrupt vector a driver\'s devices use, the driver calls IoConnectInterrupt as described previously for connecting to a single interrupt vector, except for the following parameters: The SpinLock value must be the spin lock pointer initialized by KeInitializeSpinlock. The SynchronizeIrql value must be the highest DIRQL assigned to any device for which its ISRs handle interrupts. For more information, see Synchronizing Access to Device Data. |
|
7楼#
发布于:2003-05-14 21:18
就算没有处理好中断共享吧,可是应该怎么处理呢?因为同样的源程序,在win98系统下是好使的,而在win2k系统下就不能共享中断。换了多台计算机,效果是一样的。谁有高招?别人都没有遇到过吗?奇怪!我可是用windriver自带的例程kptest 为骨架开发的,而且它自带的这个程序也同样有这个问题。我还有ddk写过一个程序,也是同样的,真弄不明白。 有几个可能: 1、其实驱动中是不需要处理中断共享的,所以有可能是你的硬件问题 2、是你驱动中isr的问题。你可以用softice跟踪看看,看你的isr是否挂到你的中断上了、若是你的pci卡则isr是否清掉了中断寄存器,等等,总之是让isr完全走一遍。如果softice弹不出来,那就是硬件问题了,硬件没处理好中断共享。 3、win98下正确,并不代表你的驱动或pci卡没问题。因为有的函数98支持而2k不支持,反之亦然 |
|
|