CompTIA A_ Certification All-In-One Exam Guide, Seventh Edition - Michael Meyers [121]
Figure 8-16 How do devices tell the CPU they need attention?
Every CPU in the PC world has an INT (interrupt) wire, shown in Figure 8-17. If a device puts voltage on this wire, the CPU stops what it’s doing and deals with the interrupting device. Suppose you have a PC with only one peripheral, a keyboard that directly connects to the INT wire. If the user presses the J key, the keyboard charges the INT wire. The CPU temporarily stops running the browser (or whatever program is active) and runs the necessary BIOS routine to query the keyboard.
Figure 8-17 The INT wire
This would be fine if the computer had only one device. As you know, however, PCs have many devices, and almost all of them need to interrupt the CPU at some point. So the PC needs some kind of traffic cop to act as an intermediary between all of the devices and the CPU’s INT wire. This traffic-cop chip, called the I/O advanced programmable interrupt controller (IOAPIC), uses special interrupt wires that run to all devices on the expansion bus (Figure 8-18).
Figure 8-18 Eight interrupt wires (IRQs) run from the expansion bus to the IOAPIC.
* * *
NOTE IOAPIC functions are usually built into the Southbridge. Many developers drop the I/O part and simply call them APICs.
If a device wants to get the CPU’s attention, it lights the interrupt wires with a special pattern of ones and zeroes just for that device. The IOAPIC then interrupts the CPU. The CPU queries the IOAPIC to see which device interrupted, and then it begins to communicate with the device over the address bus (Figure 8-19).
These unique patterns of ones and zeroes manifest themselves as something called interrupt requests (IRQs). Before IOAPICs, IRQs were actual wires leading to the previous generation of traffic cops, called PICs. It’s easy to see if your system has a PIC or an IOAPIC. Go into the Device Manager and select Interrupt request (IRQ) with the resources set to show by type.
Figure 8-20 shows nearly a dozen IRQs, numbered 0 through 22, making this an IOAPIC system. IRQ 9 is special—this IRQ is assigned to the controller itself and is the IOAPIC’s connection to the CPU. If you look closely, you’ll also notice that some IRQs aren’t listed. These are unused or “open” IRQs. If you add another device to the system, the new device will take up one of these unused IRQs. Now look at the older PIC system in Figure 8-21—note that it only shows IRQs ranging from 0 through 15.
Figure 8-19 IOAPIC at work
Modern systems running Windows Vista or Windows 7 can use virtual IRQs to support devices. A quick glance at the Device Manager IRQ list in Vista shows a giant list of IRQs, ranging from 0 to upwards of 190 (Figure 8-22). Some systems even display negative IRQs, such as –2 or –4. Once you get into a Windows Vista or Windows 7 machine, you can pretty much forget about IRQs. The OS handles it all automatically.
Let’s look at the last serious vestige of the “bad old days” on your PC: COM and LPT ports.
COM and LPT Ports
When the PC first came out, the I/O addresses and IRQ for every device had to be manually configured. How you did this varied from device to device: you moved jumpers, turned dials, or ran weird configuration programs. It was never easy. IBM tried to make configuration easier by creating preset I/O address and IRQ combinations for the serial and parallel ports, because they were the most commonly used ports on the original PC. These preset combinations were called COM ports for serial connections and LPT ports for parallel ports. Table 8-1 lists the early preset combinations of I/O addresses and IRQs.
Figure 8-20 IRQs in an IOAPIC system
Figure 8-21 IRQs in a PIC system
Figure 8-22 IRQs in Windows Vista
* * *
TIP The term “COM” for serial ports came from “communication,” and the term “LPT” for parallel ports came from “line