Hardware Resources

 <  Day Day Up  >  

There are four types of hardware resources used by both onboard and add-on card devices:

  • IRQ

  • I/O port address

  • DMA channel

  • Memory address

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

graphics/tip_icon.gif

Many computers sold at retail stores do not display the POST and configuration information screens shown in Figures 2.24 and 2.25 as configured from the factory. To display this information, start the computer's BIOS setup program and look for a BIOS option called Quiet Boot. Disable this option and save your changes. Some systems have an option called Boot-Time Diagnostic Screen instead; enable this option and save your changes. When your computer restarts, it should display hardware information.

Note that if your BIOS doesn't have an option such as Quiet Boot or Boot-Time Diagnostic Screen, you might not be able to view your hardware configuration at bootup .


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

IRQ

Standard Function

Bus Slot

Resource Type

Recommended Use

System timer

No

System

1

Keyboard controller

No

System

2

Second IRQ controller cascade to IRQ 9

No

System

8

Real-time clock

No

System

9

Available (might appear as IRQ 2)

Yes

PCI

Network Interface Card or VGA [*]

10

Available

Yes

PCI

USB [*]

11

Available

Yes

PCI

SCSI host adapter [*]

12

Motherboard mouse port/available

Yes

ISA/PCI

Motherboard mouse port

13

Math coprocessor

No

System

14

Primary IDE

Yes

PCI

Primary IDE (hard disks)

15

Secondary IDE/available

Yes

PCI

Secondary IDE (CD-ROM/tape)

3

Serial Port 2 (COM 2:)

Yes

ISA

COM 2:/internal modem

4

Serial Port 1 (COM 1:)

Yes

ISA

COM 1:

5

Sound/Parallel Port 2 (LPT2:)

Yes

ISA

Sound card [*]

6

Floppy disk controller

Yes

System

Floppy controller

7

Parallel Port 1 (LPT1:)

Yes

ISA

LPT1:

[*] 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:

  • If your computer is a so-called "legacy-free" system without serial, parallel, or PS/2 mouse and keyboard ports, or if you have manually disabled them, IRQs 3, 4, 7, and 12 will also be treated as PCI IRQs on most recent systems. This means they can be used for PCI cards not listed on the chart, such as IEEE-1394a host adapters, SCSI host adapters, video capture cards, add-on multi-I/O (serial/parallel) adapters, and so forth.

  • Beginning with late versions of Windows 95 and continuing on to today's Windows XP versions, PCI devices can share IRQs on most systems. Although ISA devices such as built-in serial, parallel, and PS/2 mouse ports each need an exclusive IRQ, two or more PCI devices (as well as AGP video cards) can share IRQs as shown later in Figure 2.27.

    Figure 2.27. The Windows XP Device Manager configured to display IRQ, DMA, and memory address usage.

    graphics/02fig27.jpg

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.

graphics/02fig28.jpg

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.

graphics/02fig26.gif

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

DMA Channel #

Use

Notes

Some sound cards

Requires 16-bit ISA or PCI card [*]

1

Sound card

Sound Blaster standard; also used by " clones "

2

Floppy drive

 

3

LPT port in ECP mode

Some systems offer DMA 1 as an alternative setting

4

System reserved

 

5

Sound card

Requires 16-bit ISA or PCI card [*] ; some sound cards use only DMA 1 or use DMA 0 instead of 5

6

 

Requires 16-bit ISA card

7

 

Requires 16-bit ISA card

[*] 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  >  


Absolute Beginners Guide to A+ Certification. Covers the Hardware and Operating Systems Exam
Absolute Beginners Guide to A+ Certification. Covers the Hardware and Operating Systems Exam
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 310

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net