System hangs when Interrupt occurs

I wrote a simple serial port driver and installed it.
From Control Panel -> Administrative Tools -> … , I could see that
my driver was running and the status was ok. Also using dbgview, i could
see all the log messages which indicated that driver was successfully
loaded. Now when i generate a serial port interrupt (IRQ4), the system
hangs.
My ISR routine always returns “TRUE” after reading all the UART registers
(to enable further interrupts). The ISR also has a “DBG Print” statement.
I am not using any DPC as it is not required for my test driver.

Can anyone please help.Is there anything extra I need to do in the ISR?

Thanks
Kiran

At 09:23 AM 9/22/2003 -0400, you wrote:

I wrote a simple serial port driver and installed it.
From Control Panel -> Administrative Tools -> … , I could see that
my driver was running and the status was ok. Also using dbgview, i could
see all the log messages which indicated that driver was successfully
loaded. Now when i generate a serial port interrupt (IRQ4), the system
hangs.
My ISR routine always returns “TRUE” after reading all the UART registers
(to enable further interrupts). The ISR also has a “DBG Print” statement.
I am not using any DPC as it is not required for my test driver.

Can anyone please help.Is there anything extra I need to do in the ISR?

Is the ISR continually getting executed over and over? This will make the
system appear to hang, since ISR processing is very high priority.

If so, then your ISR is likely not writing/reading the proper registers on
the UART that turn off the interrupt. Depending on the UART chip, you may
need to write a register to acknowledge the interrupt.

So what is happening is that the system gets interrupt over and over for
the same interrupt.

Russ Poffenberger
NPTest, Inc.
xxxxx@NPTest.com

Ever since NT 4.0, for edge triggered interrupts (such as is the case for
the legacy COM ports), the interrupt handling code in Windows will walk the
list of attached ISRs until all of the ISRs return FALSE, indicating that no
further interrupt processing is required.

Thus, if the COM port is no longer asserting an interrupt, then your ISR
needs to return FALSE. It should only return TRUE when the device is
actually asserting an interrupt. Otherwise you will end up in an infinite
loop at interrupt context.

I had to fix a driver that worked on NT 3.51 but hung on NT 4.0 due to this
exact problem.

  • Jay

Jay Talbott
Principal Consulting Engineer
SysPro Consulting, LLC
3519 E. South Fork Drive
Suite 201
Phoenix, AZ 85044
(480) 704-8045
xxxxx@sysproconsulting.com
http://www.sysproconsulting.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Kiran
Sent: Monday, September 22, 2003 6:24 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] System hangs when Interrupt occurs

I wrote a simple serial port driver and installed it.
From Control Panel -> Administrative Tools -> … , I
could see that
my driver was running and the status was ok. Also using
dbgview, i could
see all the log messages which indicated that driver was successfully
loaded. Now when i generate a serial port interrupt (IRQ4), the system
hangs.
My ISR routine always returns “TRUE” after reading all the
UART registers
(to enable further interrupts). The ISR also has a “DBG
Print” statement.
I am not using any DPC as it is not required for my test driver.

Can anyone please help.Is there anything extra I need to do
in the ISR?

Thanks
Kiran


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@sysproconsulting.com
To unsubscribe send a blank email to xxxxx@lists.osr.com