Information Technology Reference
In-Depth Information
Data received from serial ports interrupts the processor with
IRQ3
and
IRQ4
and the paral-
lel ports use
IRQ5
and
IRQ7
. If one of the parallel, or serial, ports does not exist then the
IRQ line normally assigned to it can be used by another device. It is typical for interrupt-
driven I/O cards, such as a sound card, to have a programmable IRQ line which is mapped to
an IRQ line that is not being used.
Note that several devices can use the same interrupt line. A typical example is
COM1:
and
COM3:
sharing
IRQ4
and
COM2:
and
COM4:
sharing
IRQ3
. If they do share then the
ISR must be able to poll the shared devices to determine which of them caused the interrupt.
If two different types of device (such as a sound card and a serial port) use the same IRQ line
then there may be a contention problem as the ISR may not be able to communicate with
different types of interfaces.
Figure 2.11 shows a sample window displaying interrupt usage. In this case it can be seen
that the system timer uses
IRQ0
, the keyboard uses
IRQ1
, the PIC uses
IRQ2
, and so on.
Notice that a sound blaster is using
IRQ5
. This interrupt is normally reserved for the secon-
dary printer port. If there is no printer connected then
IRQ5
can be used by another device.
Some devices can have their I/O address and interrupt line changed. An example is given in
Figure 2.12. In this case, the IRQ line is set to IRQ7 and the base address is 378h.
Typical uses of interrupts are:
IRQ0
: System timer
The system timer uses
IRQ0
to interrupt the proc-
essor 18.2 times per second and is used to keep the
time-of-day clock updated.
IRQ1
: Keyboard data ready
The keyboard
uses
IRQ1
to signal to the processor
that data is ready to be received from the key-
board. This data is normally a scan code.
IRQ2
: Redirection of IRQ9
The BIOS redirects the interrupt for
IRQ9
back
here.
Figure 2.11
Standard usage of IRQ lines