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

Re: Re[2]: PCI Interrupts



Henry Lau <henrylau@cts.com> writes.
> 
> At 12:10 AM 10/2/96 -0700, John R Pierce wrote:
> >
> >VPICD refers to the Virtual PIC device of windows/windows95.  It has a whole
> >API, but normally windows applications layer software should just be able to
> >use the SetInterruptVector calls to hook the desired interrupt, and unmask
the
> >appropriate IRQ.  If you have access to the Windows  3.x or Windows95 DDK
> >(device driver kit), I'd suggest you look at the IRQ code in some of the
sample
> >drivers.
> >
> >If your application/driver/whatever isn't running under windows, then you
can
> >ignore this.  I'm afraid I don't remember the original context of your
device
> >driver or interrupt handler.  If your device IS running under windows95, you
> >probably are going to want/need to write a 'virtual device driver' for it
(aka
> >a VxD) as handling IRQ's in ring 3 (application mode) is rather fraught with
> >peril and overhead.
> >
> The origin of this mail is that I am writing some code to test out the
> interrupt generation of a WAN PCI adapter card.  I am writing the program
> using Phar Lap Extender and Microsoft Visual C compiler but it is a
> command line program running from the DOS Prompt under Windows/95.
> 
> Does the VPIC services still apply in this case?

Ah, yes, but its 'hidden' from you :)

You would go ahead and do I/O to the 8259a PIC's ports, the VPICD traps these
I/Os and 'virtualizes' the PIC.  You use the DOS call to get and set the
interrupt vector. You use the PIC I/O ports to unmask and mask the IRQ level,
and issue EOI's (End Of Interrupts), remembering that you need to 'EOI' both
the master AND slave PIC's if you are on IRQ 8-15.

There is a potential conflict here, tho... Since all PCI devices are 'plug and
play', the win95 device manager is going to create a 'devnode' for your board
even if it doesn't have a clue what it is.  Its possible that win95 will decide
to 'reserve' this interrupt even though there is no device driver registered
for it.... If you go into the win95 device manager (control panel -> system ->
device manager), and see your board there, look and see if it lists the IRQ
under device -> properties -> resources... if it does, and you are still having
trouble gettting the interrupt after you do the above, try clearing the
checkbox that says 'use this device in this profile' or setting the 'disable in
this hardware profile' on the board's properties -> general page.

btw, IRQ overhead is VERY high to a virtual 86 mode program, even HIGHER to a
dos extender program.  the irq takes the CPU from whatever its doing to ring 0,
then it has to get reflected to v86, then on thru the dos extender, then the
IRET has to work its way back out thru those layers.  Ouch.

-jrp
[¸¦