How the PICs are connected (was Re: Ethernet boards for ISC 386/ix)

Kurt Gollhardt kdg at nirvo.uucp
Fri Aug 18 01:00:27 AEST 1989


In article <1024 at virtech.UUCP> dennis at virtech.UUCP (Dennis P. Bednar) writes:
>I'm still a little unclear on how the two PIC's (Programmable
>Interrupt Controller chips) are actually connected to the bus,
>to one another, and to the CPU.
>
>I have a vague idea that that there are 8 input IRQ lines per PIC,
>but that when you cascade two PIC's you don't get all 16 IRQ levels
>because of the daisy-chaining.   I suppose there is only one
>INT_REQ (interrupt request) line that goes to the CPU, and
>depending on the IRQ pin and how the PIC's were daisy-chained
>you would get one one PIC responding with the interrupt vector
>number information.  But I still can't picture how the bus is
>connected to the PIC's and to the CPU.  Can someone draw a
>figure or elaborate in a little more detail please?

Here you go:


		   +--------+
	CPU INT ---|INT   I0|--- IRQ0 (Timer)
		   |      I1|--- IRQ1 (Keyboard)
		   |      I2|-------------------------+
		   |      I3|--- IRQ3 (XT/AT Bus)     |
		   | PIC0 I4|--- IRQ4 (XT/AT Bus)     |
		   |      I5|--- IRQ5 (XT/AT Bus)     |
		   |      I6|--- IRQ6 (XT/AT Bus)     |
		   |      I7|--- IRQ7 (XT/AT Bus)     |
		   +--------+                         |
		                                      |
		+-------------------------------------+
		|
		|  +--------+
		+--|INT   I0|--- IRQ8  (RT Clock)
		   |      I1|--- IRQ9  (AT Bus = XT Bus IRQ2)
		   |      I2|--- IRQ10 (AT Bus)
		   |      I3|--- IRQ11 (AT Bus)
		   | PIC1 I4|--- IRQ12 (AT Bus)
		   |      I5|--- IRQ13 (Coprocessor)
		   |      I6|--- IRQ14 (AT Bus)
		   |      I7|--- IRQ15 (AT Bus)
		   +--------+

The key trick here is that the pin on the AT Bus which is labelled IRQ9
is *the same pin* which was labelled IRQ2 on the XT Bus.  The AT Bus
labelling correctly reflects the fact that, since this signal is connected
to I1 of the slave PIC (PIC1), it is seen by the CPU as IRQ 9.  So any
(presumably 8-bit) board which claims to be configured for IRQ 2 is actually
generating IRQ 9 when plugged into an AT Bus.

In a DOS environment (actually handled by the BIOS), the software is faked
out by an IRQ 9 handler which generates an IRQ 2 in software (essentially).
So devices which "think" they are generating IRQ 2 actually do, albeit
indirectly.

Under UNIX, no such fakery is done, so the driver has to be configured for
IRQ 9 instead of IRQ 2.

-- 
Kurt Gollhardt                      \   Nirvonics, Inc. -- Plainfield, NJ
Kurt.Gollhardt at nirvo.uucp           /\     Software Design and Consulting
...!rutgers!nirvo!Kurt.Gollhardt   /  \
     "It's all about people; not you and me or him and her, but *us*."



More information about the Comp.unix.i386 mailing list