[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: DOS PCI and Interrupts



Eric,

Thank you for your reply.

Fortunately, I have written DOS Interrupt Service Routines before. However,
ISA interrupts are edge triggered. It is easy to see and clear interrupts.
With level triggered interrupts I am worried about knowing if another
interrupt has occurred while I was in my handler. Specifically, I am worried
that if the two boards sharing an interrupt are both under heavy load, that
a race condition could exist. The way I see this happening is when My
handler re-enables interrupts after it sends the INTACK to our interrupting
PCI device and then re-setting the PIC. If another card had asserted an
interrupt won't the PIC generate an interrupt before my handler and issue an
IRET?


Mike


-----Original Message-----
From: Eric de Jong [mailto:info@simultime.nl]
Sent: Thursday, May 30, 2002 11:42 PM
To: Mike Berkowitz
Subject: Re: DOS PCI and Interrupts


>I am developing a DOS based PCI device driver for a communications card. I
>am a little confused as to how to handle the interrupt. Since PCI
interrupts
>may be shared, how do I get my ISR to work properly?

As I recall, there is an 8 bit register in the configuration space of your
card
(Interupt Line, offset 3C). When the bios boots, it writes the irq number in
this
register, just to be used by a dos driver. Just read it and register that
interupt
number under dos. (0=irq0, 15 = irq15, 255=no int used)

>Do I need to chain the interrupt?

yes. when you register your interrupt, you get the 'old' interrupt vector
back. When
you handle your interrupt, you 1) check if it is your card which triggered
the
interrupt. 2) if yes, handle and clear the physical interrupt from your
card. 3)
always call the 'old' interrupt vector, it does not mather if it is another
driver or
the original dummy vector. (see standard C examples)

>Since PCI interrupts are level triggered, how will I know if there is
>another device driver for a different device that is also sharing the
>interrupt?

You don't. just check if it was YOUR card every time there is an interrupt.

Hope this give you some clues. Note that I never wrote a driver under dos,
so I do
not know the details.

Eric.