Absolute Beginners Guide to A+ Certification. Covers the Hardware and Operating Systems Exam
< Day Day Up > |
There are four types of hardware resources used by both onboard and add-on card devices:
Each device needs its own set of hardware resources, or needs to be a device that can share IRQs (the only one of the four resources that can be shared). Resource conflicts between devices can prevent your system from starting, lock up your system, or even cause data loss. IRQs
IRQs , or interrupt requests , are a series of 8 or 16 lines that run between the CPU and both built-in and expansion card devices. Most devices use at least one IRQ. As the name implies, IRQs enable devices to interrupt the CPU to signal for attention when they need to send or receive data. Without IRQs, the CPU would run in isolation, never pausing to take care of any devices. The IRQ can be compared to a telephone's ringer. When the telephone rings, you pick it up. If the ringer is broken, you would never know if you were getting a telephone call. The different IRQs can be compared to a multiline phone in which each line is set aside for a different department. At least one IRQ is used by most major add-on cards (network, SCSI, sound, video, modem, and IEEE-1394) and major built-in system components such as ATA/IDE host adapters, serial, parallel, and USB ports.
tip
Because IRQs are used to handle different hardware devices, there's a simple rule of thumb: Generally, no two ISA devices should have the same IRQ assignment. While COM 1 and COM 3 serial ports are both assigned to IRQ 4, and COM 2 and COM 4 are both assigned to IRQ 3, this is not a true exception; if COM 1 and COM 3 are used at the same time, they stop working, and ditto for COM 2 and COM 4. PCI devices typically support IRQ sharing with Windows 95 OSR 2.x (Windows 95B), Windows 98, Windows Me, Windows 2000, and Windows XP, as well as Windows Server 2003 if the motherboard's design and configuration permit it. The number of total IRQs available to you depends on the types of cards and expansion slots you use. Eight-bit ISA expansion slots, such as those used in the original IBM PC and PC/XT, could use IRQs up to 7 only. The ISA 16-bit and wider expansion slots can use up to IRQ 15. The typical and default IRQ usage appears in Table 2.2. Table 2.2. Typical IRQ Usage
[*] On systems that use ACPI power management or support IRQ sharing , PCI versions of some or all of these devices might share IRQs . IRQs are used by the system in the following way: You issue a command DIR C:>LPT1 on the keyboard (IRQ 1). The IRQ is routed to the CPU, which "looks" at the keyboard and interprets the command. It uses IRQ 14 (IDE hard disk interface) to pass the command to the hard disk. Because the user has asked to print the command ( >LPT1 ), the CPU uses IRQ 7 to "wake up" the parallel port and print the directory listing. Meantime, the system timer (IRQ 0) has kept everything working. As you look at the printout, you see the date- and timestamps next to the file listings, letting you know that the real-time clock (IRQ 8) is also on the job. Thus, even a simple operation uses several interrupt requests on several different lines. Although Table 2.2 shows you traditional IRQ usage, you should realize that your computer might list much different IRQ usage and still work correctly. Here's why:
I/O Port Addresses
The system resource used even more often than IRQs, but one that causes fewer problems, is the I/O port address . The I/O port address is used to pass information between a given device and a system. Even simple devices that don't require an IRQ to function need one or more I/O port addresses. If you compare the IRQ to a telephone ringer, the I/O port address can be compared to the telephone transmitter and receiver, which do the actual work of sending and receiving your voice after you pick up the ringing telephone. Your computer has 65,535 I/O port addresses (numbered hexadecimally), but uses only a relative few of them. Addresses might be followed by an "h", indicating hexadecimal. Each device uses an exclusive range of I/O port addresses for the actual transmission of data to and from the device. For situations in which two devices (such as COM 1 and COM 2) share a single IRQ, the I/O port addresses are still unique to each device. Often, information about an add-on card will list only the starting address, but you should know both the first and last I/O port address used by the device to keep from overlapping addresses, which will cause the devices to fail. There are thousands of I/O port addresses available in today's computers, so resource conflicts are rare unless a user tries to assign two serial ports to the same address (refer ahead to Figure 2.28). Figure 2.28. The Windows XP Device Manager configured to display a portion of the I/O port address usage.
As you can see from Figure 2.26, different types of devices use different amounts of I/O address space. Some devices use a continuous "block" of addresses, such as the LPT1 (parallel) port, which uses eight addresses (0378-037Fhex). Others use only one or two addresses, or sometimes just a (literal) bit of a single address. For example, most systems don't have a secondary floppy controller, so the addresses reserved for it (0370 “0375, bit 7 of 0377) will be available for another device. Figure 2.26. A section of the I/O port address map appears here. Devices listed use the port addresses listed if they are present.
I/O port addresses are used by the system in the following way: You issue a command DIR C:>LPT1 on the keyboard. The keystrokes pass through the keyboard interface's I/O addresses 0060h, 0064h. When the hard disk receives the command to read the directory listing, the command is given through I/O port 03F6, and the status is monitored through bits 0:6 of I/O port 03F7. When the directory listing is redirected to the printer, the output is routed through LPT1's I/O port addresses 0378 “037F. As you look at I/O port address usage in your computer, you might see two different components, which are working but are displaying the same I/O port address per the Windows Device Manager. In these cases, the devices listed use the same I/O port address as a way to communicate with each other. For example, the AMD-751 chipset processor to AGP controller and the TNT2 AGP video card in my computer use the same I/O port addresses to facilitate communication with each other as shown in Figure 2.27. DMA (Direct Memory Access) Channels
As you saw earlier in this chapter, the CPU is responsible for many tasks , including that of being a sort of "traffic cop," overseeing the transfer of information between itself, memory, and various devices. Although a police officer on the corner of a busy intersection helps keep bumper-to- bumper rush- hour drivers on their best behavior, this manual stop-go-stop process isn't the fastest way to get around town ”or around the motherboard. The expressway, beltway, or freeway that bypasses surface streets , traffic lights, and hand-signaling police officers is a faster way to travel when conditions are favorable. Similarly, bypassing the CPU for memory to add-on board transfers (either direction) is also a faster way to travel. This process of bypassing the CPU is called Direct Memory Access ( DMA ) . DMA transfers can be done in two ways; some DMA transfers (such as those done by tape backup drives or by PCI cards using bus-mastering) do not require a particular DMA channel; however, some devices, such as popular ISA sound cards and the ECP mode of the parallel port, require that we select an unused DMA channel. Table 2.3 lists the standard DMA channel uses. In Table 2.3, standard uses appear in bold type, and typical uses (which can change) are shown in italic type. Table 2.3. Standard and Typical DMA Channel Uses
[*] PCI sound cards use DMA only if used in a Sound Blaster emulation mode . Because DMA is used for high-speed data transfer, and because there are relatively few DMA channels, some users are tempted to "share" them between ISA devices. Never do this. If two devices using DMA are used at the same time, a catastrophic loss of data could result. Because the CPU is not involved in DMA transfers, there's no "traffic cop" in case of disaster! One of my favorite "disaster" stories was related by longtime Byte magazine columnist Jerry Pournelle in July 1994. He installed a sound card on a system that already had an unusual hard disk interface that used DMA; both devices were set to DMA 5. When he tried to record sound samples with the sound card, the flow of hard disk data and the flow of sampled sound "collided" on DMA 5, wiping out the entire contents of his hard disk! DMA conflicts are rare, especially now that ISA cards are not used by most systems, but they're never funny . Memory Addresses
The physical memory (RAM) installed into the computer is divided into memory addresses ; each address equals a byte of RAM. For normal operations, the system automatically determines which memory address to use for retrieving existing information or for temporary location of new memory addresses. These addresses are also given in hexadecimal notation. Like DMA channels, memory addresses are also abundant in computers. Add-on cards that have their own BIOS chips (some SCSI, some ATA/IDE, and some network cards, as well as all VGA and 3D video cards) or add-on cards that have RAM (video cards and a few network cards), however, must use unique memory addresses that are found in the range between 640 kilobytes (KB) and 1 megabyte (MB). Because there's abundant memory address space and relatively low demand for memory addresses, conflicts are rare unless you manually configured a card to use an address already in use by another device. Memory managers such as EMM386.EXE that can be used to support MS-DOS software running under Windows 9x can also use memory addresses that are not in use by cards. Viewing Hardware Resources in Use
You can view the current resource usage in your computer with the Windows Device Manager. To see the resource usage for a particular device, open the Device Manager, open the device's properties sheet, and click Resources. You can also use the Windows System Information program to view resource usage. For details, see Chapter 18, "Using and Optimizing Windows." If you need to install non-PnP devices, or if you are concerned about installing devices that have limited configuration options, you can also view all the resources currently in use. With Windows XP and Windows 2000, start the Device Manager, select View, Resources by Type, and click the plus sign (+) next to each category. Figure 2.27 shows the DMA channel, IRQ, and a portion of the memory resource usage in one of my computers, which runs Windows XP. Figure 2.28 shows a portion of the I/O port address usage in the same computer. With Windows 9x/Me, double-click the computer icon at the top of the Device Manager listing to see resource usage. Note that in these two figures, forced (manually configured) settings are indicated with a white circle containing a blue i . Forced settings are seldom a good idea (plug-and-play configuration usually works much better, especially with Windows XP). Additionally, if two ISA devices have been forced to use the same hardware resource (such as the COM ports in Figures 2.27 and 2.28, which are both set to use the same IRQ and I/O port address), you have a hardware conflict that will prevent the devices from working. |
< Day Day Up > |