Interrupts

by Johannes Helmig [Published on 30 May 1998 / Last Updated on 30 May 1998]

In a PC, the CPU is the active component, controlling all other parts.
The CPU is communicating with all other devices, like: keyboard, mouse, Modem, printer,....
It is the responsibility of the CPU to process in time any request coming via one of the devices from the user, for example: the user moved the mouse, now the position of the mouse-cursor needs to be updated on the screen.

There are 2 methods to organize this, which I have visualized in 2 (fairly large) animation's:

1) Polling:

The CPU stops in regular interval to process the user-program to check now with EVERY connected device, if an action of the CPU is required.
This is a very ineffective method, since this checking takes up substantial processing time.

2) Interrupts

Much more efficient is the method to assign to each device a "ringer".
This allows the CPU to continuously process the User-Program. If a device needs now to be handles, it uses the "ringer" to send an alarm system to the CPU. The CPU interrupts now its current activity and handles the request of the interrupting device.

This is the theory, lets look at the actual implementation on a PC.
And here we are today still suffering from the first design of the IBM PC:

On the IBM PC (based on the 8088 CPU),
IBM used the "8259 Interrupt Controller",
allowing 8 interrupt-signals (numbered 0 to 7)
to be generated.

Since some of these 8 Interrupts were already used by the internal devices of the PC, IBM improved (a little) the design by adding on the IBM AT a SECOND
Interrupt-controller:

The design of the IBM AT includes
2 Interrupt-controller, where the 2nd
controller is "cascaded" into the
Interrupt-line 2 of the first controller.
The Interrupt-lines on the second controller
are numbered from 8 to 15.

Due to this "cascading", the Interrupt-line 2
is NOT available. However: for compatibility
with the original PC, the Interrupt-line 2 is
connected to the Line 9 on the 2nd controller.
(So, if a device on your PC is configured for
Interrupt 2, it really uses Interrupt 9).


These Interrupt lines are called: "Interrupt Request Lines" or IRQ's.

On Windows95, you can view the the list of IRQ assignment in the System-Applet of the Control-Panel, tab: Device-Manager by double-clicking on "Computer":



Now the bad news:
A lot of these IRQ-lines are already in use:

IRQ:Used by:Comment:
0System-TimerNot Available
1KeyboardNot Available
2cascade to 2nd ControllerNot Available
3Serial port: COM2if COM2 is installed: Not available
if COM2 is NOT installed: available
4Serial port: COM1since COM1 is installed and used on
Most systems: Not available
5freewas reserved by IBM for Parallel-Port LPT2,
but since few few people have LPT2: available
Warning: The sound-card may already use it
6Floppy disk controllerNot Available
7LPT1Printer-port 1, which is used on almost every system
on Windows95: Not available
on Windows NT4: available
8Real Time ClockNot Available
9freeavailable
10freeavailable
Warning: The sound-card may already use it
11free
12PS-2 Mouse-Portif you have a PS-2 mouse-port and use it:Not Available
If you do NOT have it or have deactivated it:available
13FPU Math-CoprocessorNot Available
14primary harddisk
IDE controller
Not Available
(unless you have ONLY SCSI-disks and CD-ROMS)
15secondary harddisk
IDE controller
usually, a ATAPI-CD-ROM is connected on this
Secondary IDE-harddisk controller:Not Available
(do NOT connected your Harddisk and CD-ROM on the
same IDE-disk controller, it will dramatically slow
down your harddisk performance !)


Network-Boards (NIC's) are very often configured for IRQ: 5 or 10
(watch it: your sound-card may use it already !)

In general, each device needs its own IRQ-line NOT SHARED with any other device !


Exception 1) very often, COM3 is using IRQ4 (same as COM1) and COM4 is
using IRQ3 (same as COM2). That is accepted by Windows95 and works, as
long as these ports sharing the IRQ-line are NOT used simultaneous !

Exception 2) If the driver supplied with the card supports it, modern PCI-devices
are able to share an IRQ
, if supported by the Operating system (like: Windows98)

See Also

Advertisement

Featured Links