Upgrading and Repairing PCs (17th Edition)

System resources are the communications channels, addresses, and other signals hardware devices use to communicate on the bus. At their lowest level, these resources typically include the following:

  • Memory addresses

  • IRQ (interrupt request) channels

  • DMA (direct memory access) channels

  • I/O port addresses

I have listed these roughly in the order you would experience problems with them. Memory conflicts are perhaps the most troublesome of these and certainly the most difficult to fully explain and overcome. These are discussed in Chapter 6. This chapter focuses on the others listed here in the order you will likely have problems with them.

IRQs cause more problems than DMAs because they are in much higher demand; virtually all cards use IRQ channels. Fewer problems exist with DMA channels because fewer cards use them, DMA channels are used only by the obsolete ISA standard, and there are usually more than enough channels to go around. I/O ports are used by all hardware devices on the bus, but there are technically 64KB of them, which means there are plenty to go around. For any individual resource that is used, you must ensure that only a single card or hardware function uses the given resource; in most cases they cannot or should not be shared.

These resources are required and used by many components of your system. Adapter cards need these resources to communicate with your system and accomplish their purposes. Not all adapter cards have the same resource requirements. A serial communications port, for example, needs an IRQ channel and I/O port address, whereas a sound card needs these resources and at least one DMA channel. Most network cards use an IRQ channel and an I/O port address, and some also use a 16KB block of memory addresses.

As your system increases in complexity, the chance for resource conflicts increases. Modern systems with several additional devices can really push the envelope and become a configuration nightmare for the uninitiated. Sometimes under these situations the automatic configuration capability of Plug and Play can get confused or fail to optimally configure resources so that everything will work. Most adapter cards enable you to modify resource assignments by using the Plug and Play software that comes with the card or the Device Manager in Windows 9x and later, thus you can sometimes improve on a default configuration by making some changes. Even if the automatic configuration gets confused (which happens more often than it should), fortunately, in almost all cases a logical way to configure the system existsonce you know the rules.

Interrupts

Interrupt request channels, or hardware interrupts, are used by various hardware devices to signal the motherboard that a request must be fulfilled. This procedure is the same as a student raising his hand to indicate that he needs attention.

These interrupt channels are represented by wires on the motherboard and in the slot connectors. When a particular interrupt is invoked, a special routine takes over the system, which first saves all the CPU register contents in a stack and then directs the system to the interrupt vector table. This vector table contains a list of memory addresses that correspond to the interrupt channels. Depending on which interrupt was invoked, the program corresponding to that channel is run.

The pointers in the vector table point to the address of whatever software driver is used to service the card that generated the interrupt. For a network card, for example, the vector might point to the address of the network drivers that have been loaded to operate the card; for a hard disk controller, the vector might point to the BIOS code that operates the controller.

After the particular software routine finishes performing whatever function the card needed, the interrupt-control software returns the stack contents to the CPU registers, and the system then resumes whatever it was doing before the interrupt occurred.

Through the use of interrupts, your system can respond to external events in a timely fashion. Each time a serial port presents a byte to your system, an interrupt is generated to ensure that the system reads that byte before another comes in. Keep in mind that in some cases a port devicein particular, a modem with a 16550 or higher UART chipmight incorporate a byte buffer that allows multiple characters to be stored before an interrupt is generated.

Hardware interrupts are generally prioritized by their numbers; with some exceptions, the highest-priority interrupts have the lowest numbers. Higher-priority interrupts take precedence over lower-priority interrupts by interrupting them. As a result, several interrupts can occur in your system concurrently, with each interrupt nesting within another.

If you overload the systemin this case, by running out of stack resources (too many interrupts were generated too quickly)an internal stack overflow error occurs and your system halts. The message usually appears as Internal stack overflow - system halted at a DOS prompt. If you experience this type of system error and run DOS, you can compensate for it by using the STACKS parameter in your CONFIG.SYS file to increase the available stack resources. Most people will not see this error in Windows 9x/Me or Windows NT/2000/XP.

The ISA bus uses edge-triggered interrupt sensing, in which an interrupt is sensed by a changing signal sent on a particular wire located in the slot connector. A different wire corresponds to each possible hardware interrupt. Because the motherboard can't recognize which slot contains the card that used an interrupt line and therefore generated the interrupt, confusion results if more than one card is set to use a particular interrupt. Each interrupt, therefore, is usually designated for a single hardware device. Most of the time, interrupts can't be shared.

Originally, IBM developed ways to share interrupts on the ISA bus, but few devices followed the necessary rules to make this a reality. The PCI bus inherently allows interrupt sharing; in fact, virtually all PCI cards are set to PCI interrupt A and share that interrupt on the PCI bus. The real problem is that there are technically two sets of hardware interrupts in the system: PCI interrupts and ISA interrupts. For PCI cards to work in a PC, the PCI interrupts are first mapped to ISA interrupts, which are then configured as non-shareable. Therefore, in many cases you must assign a nonconflicting interrupt for each card, even PCI cards. The conflict between assigning ISA IRQs for PCI interrupts caused many configuration problems for early users of PCI motherboards and continued to cause problems even after the development of Windows 95 and its Plug and Play technology.

The solution to the interrupt sharing problem for PCI cards was something called PCI IRQ Steering, which is supported in the more recent operating systems (starting with Windows 95 OSR 2.x) and BIOS. PCI IRQ Steering allows a plug-and-play operating system such as Windows to dynamically map or "steer" PCI cards (which almost all use PCI INTA#) to standard PC interrupts and allows several PCI cards to be mapped to the same interrupt. More information on PCI IRQ Steering is found in the section "PCI Interrupts," later in this chapter.

Hardware interrupts are sometimes referred to as maskable interrupts, which means the interrupts can be masked or turned off for a short time while the CPU is used for other critical operations. It is up to the system BIOS and programs to manage interrupts properly and efficiently for the best system performance.

Because interrupts usually can't be shared in an ISA bus system, you often run into conflicts and can even run out of interrupts when you are adding boards to a system. If two boards or onboard devices use the same IRQ to signal the system, the resulting conflict prevents either board from operating properly. The following sections discuss the IRQs that any standard devices use, as well as what might be free in your system.

8-Bit ISA Bus Interrupts

The PC and XT (the systems based on the 8-bit 8086 CPU) provide for eight different external hardware interrupts. Table 4.78 shows the typical uses for these interrupts, which are numbered 07.

Table 4.78. 8-Bit ISA Bus Default Interrupt Assignments

IRQ

Function

Bus Slot

0

System Timer

No

1

Keyboard Controller

No

2

Available

Yes (8-bit)

3

Serial Port 2 (COM2:)

Yes (8-bit)

4

Serial Port 1 (COM1:)

Yes (8-bit)

5

Hard Disk Controller

Yes (8-bit)

6

Floppy Disk Controller

Yes (8-bit)

7

Parallel Port 1 (LPT1:)

Yes (8-bit)

If you have a system that has one of the original 8-bit ISA buses, you will find that the IRQ resources provided by the system present a severe limitation. Installing several devices that need the services of system IRQs in a PC/XT-type system can be a study in frustration because the only way to resolve the interrupt-shortage problem is to remove the adapter board that you need the least.

16-Bit ISA, EISA, and MCA Bus Interrupts

The introduction of the AT, based on the 286 processor, was accompanied by an increase in the number of external hardware interrupts the bus would support. The number of interrupts was doubled to 16 by using two Intel 8259 interrupt controllers, piping the interrupts generated by the second one through the unused IRQ2 in the first controller. This arrangement effectively makes only 15 IRQ assignments available, and IRQ2 effectively became inaccessible.

By routing all the interrupts from the second IRQ controller through IRQ2 on the first, all these new interrupts are assigned a nested priority level between IRQ1 and IRQ3. Thus, IRQ15 ends up having a higher priority than IRQ3. Figure 4.81 shows how the two 8259 chips were wired to create the cascade through IRQ2 on the first chip.

Figure 4.81. Interrupt controller cascade wiring.

To prevent problems with boards set to use IRQ2, the AT system designers routed one of the new interrupts (IRQ9) to fill the slot position left open after removing IRQ2. This means that any card you install in a modern system that claims to use IRQ2 is really using IRQ9 instead.

Table 4.79 shows the typical uses for interrupts in the 16-bit ISA and 32-bit PCI/AGP buses and lists them in priority order from highest to lowest. The obsolete EISA and MCA buses used a similar IRQ map.

Table 4.79. 16/32-Bit ISA/PCI/AGP Default Interrupt Assignments

IRQ

Standard Function

Bus Slot

Card Type

Recommended Use

0

System Timer

No

1

Keyboard Controller

No

2

2nd IRQ Controller Cascade

No

8

Real-Time Clock

No

9

Avail. (as IRQ2 or IRQ9)

Yes

8/16-bit

Network Card

10

Available

Yes

16-bit USB

11

Available

Yes

16-bit

SCSI Host Adapter

12

Mouse Port/Available

Yes

16-bit

Mouse Port

13

Math Coprocessor

No

14

Primary IDE

Yes

16-bit

Primary IDE (hard disks)

15

Secondary IDE

Yes

16-bit

2nd IDE (CD-ROM/Tape)

3

Serial 2 (COM2:)

Yes

8/16-bit

COM2:/Internal Modem

4

Serial 1 (COM1:)

Yes

8/16-bit

COM1:

5

Sound/Parallel 2 (LPT2:)

Yes

8/16-bit

Sound Card

6

Floppy Controller

Yes

8/16-bit

Floppy Controller

7

Parallel 1 (LPT1:)

Yes

8/16-bit

LPT1:

Notice that interrupts 0, 1, 2, 8, and 13 are not on the bus connectors and are not accessible to adapter cards. Interrupts 8, 10, 11, 12, 13, 14, and 15 are from the second interrupt controller and are accessible only by boards that use the 16-bit extension connector because this is where these wires are located. IRQ9 is rewired to the 8-bit slot connector in place of IRQ2, so IRQ9 replaces IRQ2 and, therefore, is available to 8-bit cards, which treat it as though it were IRQ2.

Note

Although the 16-bit ISA bus has twice as many interrupts as systems that have the 8-bit ISA bus, you still might run out of available interrupts because only 16-bit adapters can use most of the newly available interrupts. Any 32-bit PCI adapter can be mapped to any ISA IRQs.

The extra IRQ lines in a 16-bit ISA system are of little help unless the adapter boards you plan to use enable you to configure them for one of the unused IRQs. Some devices are hard-wired so they can use only a particular IRQ, and some of the early 16-bit ISA adapters weren't designed to use 16-bit IRQs (915). If you have a device that already uses that IRQ, you must resolve the conflict before installing the second adapter. If neither adapter enables you to reconfigure its IRQ use, chances are that you can't use the two devices in the same system.

PCI Interrupts

The PCI bus supports hardware interrupts (IRQs) that can be used by PCI devices to signal to the bus that they need attention. The four PCI interrupts are called INTA#, INTB#, INTC#, and INTD#. These INTx# interrupts are level-sensitive, which means that the electrical signaling enables them to be shared among PCI cards. In fact, all single device or single function PCI chips or cards that use only one interrupt must use INTA#. This is one of the rules in the PCI specification. If additional devices are within a chip or onboard a card, the additional devices can use INTB# through INTD#. Because there are very few multifunction PCI chips or boards, practically all the devices on a given PCI bus share INTA#.

For the PCI bus to function in a PC, the PCI interrupts must be mapped to ISA interrupts. Because ISA interrupts can't be shared, in most cases each PCI card using INTA# on the PCI bus must be mapped to a different non-shareable ISA interrupt. For example, you could have a system with four PCI slots and four PCI cards installed, each using PCI interrupt INTA#. These cards would each be mapped to a different available ISA interrupt request, such as IRQ9, IRQ10, IRQ11, or IRQ5 in most cases.

Finding unique IRQs for each device on both the ISA and PCI buses has always been a problem; there simply aren't enough free ones to go around. Setting two ISA devices to the same IRQ has never been possible (the so-called IRQ sharing of IRQ4 by COM1/3 and IRQ3 by COM2/4 didn't allow both COM ports to work at the same time), but on most newer systems sharing IRQs between multiple PCI devices might be possible. Newer system BIOSs as well as plug-and-play operating systems, such as Windows 95B (OSR 2) or later, Windows 98, and Windows 2000/XP, all support a function known as PCI IRQ Steering. For this to work, both your system BIOS and operating system must support IRQ Steering. Older system BIOSs and Windows 95 or 95A do not have support for PCI IRQ Steering.

Generally, the BIOS assigns unique IRQs to PCI devices. If your system supports PCI IRQ Steering and it is enabled, Windows assigns IRQs to PCI devices. Even when IRQ Steering is enabled, the BIOS still initially assigns IRQs to PCI devices. Although Windows has the capability to change these settings, it typically does not do so automatically, except where necessary to eliminate conflicts. If there are insufficient free IRQs to go around, IRQ Steering allows Windows to assign multiple PCI devices to a single IRQ, thus enabling all the devices in the system to function properly. Without IRQ Steering, Windows begins to disable devices after it runs out of free IRQs to assign.

To determine whether your Windows 9x/Me system is using IRQ Steering, you can follow these steps:

1.

Open the Device Manager.

2.

Double-click the System Devices branch.

3.

Double-click the PCI Bus, and then click the IRQ Steering tab. There will be a check that displays IRQ Steering as either Enabled or Disabled. If enabled, it also specifies where the IRQ table has been read from.

Note that with Windows 2000 and XP, you can't disable IRQ steering and no IRQ Steering tab appears in the Device Manager.

IRQ Steering is controlled by one of four routing tables Windows attempts to read. Windows searches for the tables in order and uses the first one it finds. You can't control the order in which Windows searches for these tables, but by selecting or deselecting the Get IRQ Table Using check boxes, you can control which table Windows finds first by disabling the search for specific tables. Windows searches for the following tables:

  • ACPI BIOS table

  • MS Specification table

  • Protected Mode PCIBIOS 2.1 table

  • Real Mode PCIBIOS 2.1 table

Windows first tries to use the ACPI BIOS table to program IRQ Steering, followed by the MS Specification table, the Protected Mode PCIBIOS 2.1 table, and the Real Mode PCIBIOS 2.1 table. Windows 95 OSR2 and later versions offer only a choice for selecting the PCIBIOS 2.1 tables via a single check box, which is disabled by default. Under Windows 98, all IRQ table choices are selected by default, except the third one, which is the Protected Mode PCIBIOS 2.1 table.

If you are having a problem with a PCI device related to IRQ settings under Windows 95, try selecting the PCIBIOS 2.1 table and restarting. Under Windows 98, try clearing the ACPI BIOS table selection and restarting. If the problem persists, try selecting the Protected Mode PCIBIOS 2.1 table and restarting.

You should select Get IRQ Table from Protected Mode PCIBIOS 2.1 Call only if a PCI device is not working properly. To access these settings in the Windows 98 Device Manager, do the following:

1.

Open the Device Manager.

2.

Scroll down to the System Devices category, and double-click to open it.

3.

Select PCI Bus and click Properties.

4.

Click the IRQ Steering tab to see or change the current settings.

If IRQ Steering is shown as disabled in Device Manager, be sure the Use IRQ Steering check box is selected. After selecting this and restarting, if IRQ Steering is still showing as disabled, the IRQ routing table that must be provided by the BIOS to the operating system might be missing or contain errors. Check your BIOS Setup to ensure PCI IRQ Steering is enabled. If there is still no success, you might have to select the Get IRQ Table from Protected Mode PCIBIOS 2.1 Call check box, or your BIOS might not support PCI bus IRQ Steering. Contact the manufacturer of your motherboard or BIOS to see whether your board or BIOS supports IRQ Steering.

On systems that have support for IRQ Steering, an IRQ Holder for PCI Steering might be displayed when you view the System Devices branch of Device Manager. This indicates that an IRQ has been mapped to PCI and is unavailable for ISA devices, even if no PCI devices are currently using the IRQ.

To view IRQs programmed for PCI-mode, follow these steps:

1.

Select Start, Settings, Control Panel, and then double-click System.

2.

Click the Device Manager tab.

3.

Double-click the System Devices branch.

4.

Double-click the IRQ Holder for PCI Steering you want to view, and then click the Resources tab.

I have found this interrupt steering or mapping to be the source of a great deal of confusion. Even though PCI interrupts (INTx#) can be (and are by default) shared, each card or device that might be sharing a PCI interrupt must be mapped or steered to a unique ISA IRQ, which in turn can't normally be shared. You can have several PCI devices mapped to the same ISA IRQ only if

  • No ISA devices are using the IRQ.

  • The BIOS and operating system support PCI IRQ Steering.

  • PCI IRQ Steering is enabled.

Without PCI IRQ Steering support, the sharing capabilities of the PCI interrupts are of little benefit because all PCI-to-ISA IRQ assignments must then be unique. Without PCI IRQ Steering, you can easily run out of available ISA interrupts. If IRQ Steering is supported and enabled, multiple PCI devices will be capable of sharing a single IRQ, allowing for more system expansion without running out of available IRQs. Better support for IRQ Steering is one of the best reasons for upgrading to Windows 98 or newer versions, especially if you are using the original OSR1 release of 95.

Another source of confusion is that the interrupt listing shown in the Windows 9x Device Manager might show the PCI to ISA interrupt mapping as multiple entries for a given ISA interrupt. One entry would be for the device actually mapped to the interruptfor example, a built-in USB controllerwhereas the other entry for the same IRQ would say IRQ Holder for PCI Steering. This latter entry, despite claiming to use the same IRQ, does not indicate a resource conflict; instead it represents the chipset circuitry putting a reservation on that interrupt for mapping purposes. This is part of the plug-and-play capabilities of PCI and the modern motherboard chipsets. Windows 2000 and XP can also map multiple devices to the same IRQ, but they don't use the term IRQ Holder to avoid confusion.

Note that you can have internal devices on the PCI bus even though all the PCI slots are free. For example, most systems today have two IDE controllers and at least one USB controller as devices on the PCI bus. Normally, the PCI IDE controllers are mapped to ISA interrupts 14 (primary IDE) and 15 (secondary IDE), whereas the USB controller can be mapped to the available ISA interrupts 9, 10, 11, and 5. Many recent systems have two or more USB controllers (typically one per every two USB ports), so each USB controller needs to be mapped to an ISA interrupt.

See "Universal Serial Bus," p. 980.

The PCI bus enables two types of devices to exist, called bus masters (initiators) and slaves (targets). A bus master is a device that can take control of the bus and initiate a transfer. The target device is the intended destination of the transfer. Most PCI devices can act as both masters and targets, and to be compliant with the PC'97 and newer system design guides, all PCI slots must support bus master cards.

The PCI bus is an arbitrated bus: A central arbiter (part of the PCI bus controller in the motherboard chipset) governs all bus transfers, giving fair and controlled access to all the devices on the bus. Before a master can use the bus, it must first request control from the central arbiter, and then it is granted control for only a specified maximum number of cycles. This arbitration allows equal and fair access to all the bus master devices, prevents a single device from hogging the bus, and also prevents deadlocks because of simultaneous multiple device access. In this manner, the PCI bus acts much like a local area network (LAN), albeit one that is contained entirely within the system and runs at a much higher speed than conventional external networks between PCs.

Advanced Programmable Interrupt Controller

As a replacement for the traditional pair of 8259 interrupt controllers, Intel developed the Advanced Programmable Interrupt Controller (APIC) in the mid-1990s. Although all processors since the original Pentium contain an APIC, an APIC must also be present in the motherboard's chipset and the BIOS and operating system must also support APIC. APIC support is present on most recent motherboards and has been supported in all Windows releases since Windows 200. You can enable or disable APIC support in the system BIOS.

APIC provides support for multiple processors, but it is also used on single-processor computers. The major benefit of APIC for a single processor is support for virtual PCI IRQs above 15. Most APIC implementations support virtual IRQs up to 24. Although Windows 2000 tends to place PCI IRQs into the traditional ISA range of 015, even when APIC is enabled, Windows XP makes full use of APIC services when installed on a system with APIC enabled. With Windows XP, APIC limits IRQ sharing to enable devices to perform better with fewer conflicts. For example, on one typical Windows XP system with APIC enabled, PCI IRQs are assigned thus:

  • PCI IRQ 16: onboard audio/AGP graphics (shared)

  • PCI IRQ 17: add-on card USB 1.1 controller (nonshared)

  • PCI IRQ 18: add-on card USB 1.1 controller (nonshared)

  • PCI IRQ 19: 10/100 Ethernet adapter/add-on card USB 2.0 controller (shared)

  • PCI IRQ 21: onboard USB 1.1 controllers (3)/onboard USB 2.0 controller (shared)

The traditional ISA IRQs 015 on the sample system are used only for ISA devices, thus preventing ISA-PCI IRQ conflicts.

APIC must be enabled in the system BIOS when Windows 2000 or XP is installed to make APIC services available.

Note

APIC must be enabled in the system BIOS before Windows XP Professional x64 Edition or Windows Server 2003 for x64 can be installed.

IRQ Conflicts

One of the more common IRQ conflicts is the potential one between the integrated COM2: port found in most modern motherboards and an internal (card-based) ISA modem. The problem stems from the fact that true PC cardbased modems (not the so-called WinModems, which are software based) incorporate a serial port as part of the card's circuitry. This serial port is set as COM2: by default. Your PC sees this as having two COM2: ports, each using the same IRQ and I/O port address resources.

The solution to this problem is easy: Enter the system BIOS Setup and disable the built-in COM2: port in the system. While you are there, you might think about disabling the COM1: port too because you are unlikely to use it. Disabling unused COMx: ports is one of the best ways to free up a couple of IRQs for other devices to use.

Another common IRQ conflict also involves serial (COM) ports. You might have noticed in the preceding two sections that two IRQs are set aside for two COM ports. IRQ3 is used for COM2:, and IRQ4 is used for COM1:. The problem occurs when you have more than two serial ports in a system. When people add COM3: and COM4: ports, they often don't set them to nonconflicting interrupts, which results in a conflict and the ports not working.

Contributing to the problem are poorly designed COM port boards that do not allow IRQ settings other than 3 or 4. What happens is that they end up setting COM3: to IRQ4 (sharing it with COM1:), and COM4: to IRQ3 (sharing it with COM2:). This is not acceptable because it prevents you from using the two COM ports on any one of the interrupt channels simultaneously. This was somewhat acceptable under plain DOS because single-tasking (running only one program at a time) was the order of the day, but it is totally unacceptable under Windows. If you must share IRQs, you can usually get away with sharing devices on the same IRQ as long as they use different COM ports. For instance, a scanner and an internal modem could share an IRQ, but if the two devices are used simultaneously, a conflict results. Fortunately, most devices that formerly used serial ports (such as mice and other pointing devices, label printers, external modems, and PDA cradles) have been redesigned to use USB ports. Thus, many users no longer have any devices that must be plugged into a serial port.

If you need to use serial ports, the best solution is to purchase a multiport serial I/O card that allows nonconflicting interrupt settings or an intelligent card with its own processor that can handle the multiple ports onboard and use only one interrupt in the system. Some older multiport serial cards used the ISA slot, but PCI-slot cards have replaced these in recent systems and have the additional advantages of faster speed and a sharable interrupt.

See "Serial Ports," p. 993.

If a device listed in the table is not present, such as the motherboard mouse port (IRQ12) or parallel port 2 (IRQ5), you can consider those interrupts as available. For example, a second parallel port is a rarity, and most systems have a sound card installed and set for IRQ5 (if it is used to emulate a SoundBlaster Pro or 16). Also, on most systems IRQ15 is assigned to a secondary IDE controller. If you do not have an IDE hard or optical drive connected to the secondary controller, you could disable the secondary IDE controller to free up that IRQ for another device.

Note that an easy way to check your interrupt settings is to use the Device Manager in Windows 95/98, Windows NT, or Windows 2000/XP. By double-clicking the Computer Properties icon in the Device Manager, you can get concise lists of all used system resources. Microsoft has also included a program called HWDIAG on Windows 95B; Windows 98 and above feature the System Information program. HWDIAG and System Information do an excellent job of reporting system resource usage, as well as details about device drivers and Windows Registry entries for each hardware component. If you are running Windows XP, a program called MSinfo32 will also give you a report of detailed system information.

To provide the maximum number of shareable interrupts in a recent system without ISA slots, I recommend performing the following steps in the system BIOS:

1.

Disable any unused legacy ports in the system BIOS. For example, if you use USB ports instead of serial and parallel ports, disable the serial and parallel ports. This can free up as many as three IRQs.

2.

Select the IRQs freed up in step 1 as available for PCI/PnP use. Depending on the BIOS, the screen to use might be known as the PnP/PCI Resource Exclusion screen or the PnP/PCI Configuration screen.

3.

Enable the Reset Configuration Data option so the IRQ routing tables in the CMOS are cleared.

4.

Save your changes and exit the BIOS setup program.

DMA Channels

Direct Memory Access (DMA) channels are used by communications devices that must send and receive information at high speeds. A serial or parallel port does not use a DMA channel, but an ISA-based sound card or SCSI adapter often does. DMA channels sometimes can be shared if the devices are not the type that would need them simultaneously. For example, you can have a network adapter and a tape backup adapter sharing DMA channel 1, but you can't back up while the network is running. To back up during network operation, you must ensure that each adapter uses a unique DMA channel.

Note

There are several types of DMA in a modern PC. The DMA channels referred to in this section involve the ISA bus. Other buses, such as the ATA/IDE bus used by hard drives, have different DMA uses. The DMA channels explained here don't involve your ATA/IDE drives, even if they are set to use DMA or Ultra DMA transfers.

8-Bit ISA Bus DMA Channels

In the 8-bit ISA bus, four DMA channels support high-speed data transfers between I/O devices and memory. Three of the channels are available to the expansion slots. Table 4.80 shows the typical uses of these DMA channels.

Table 4.80. 8-Bit ISA Default DMA-Channel Assignments

DMA

Standard Function

Bus Slot

0

Dynamic RAM Refresh

No

1

Available

Yes (8-bit)

2

Floppy disk controller

Yes (8-bit)

3

Hard disk controller

Yes (8-bit)

Because most systems typically have both a floppy and hard disk drive, only one DMA channel is available in 8-bit ISA systems.

16-Bit ISA DMA Channels

Since the introduction of the 286 CPU, the ISA bus has supported eight DMA channels, with seven channels available to the expansion slots. Similar to the expanded IRQ lines described earlier in this chapter, the added DMA channels were created by cascading a second DMA controller to the first one. DMA channel 4 is used to cascade channels 03 to the microprocessor. Channels 03 are available for 8-bit transfers, and channels 57 are for 16-bit transfers only. Table 4.81 shows the typical uses for the DMA channels.

Table 4.81. 16-Bit ISA Default DMA-Channel Assignments

DMA

Standard Function

Bus Slot

Card Type

Transfer

Recommended Use

0

Available

Yes

16-bit

8-bit

Sound

1

Available

Yes

8/16-bit

8-bit

Sound

2

Floppy Disk Controller

Yes

8/16-bit

8-bit

Floppy Controller

3

Available

Yes

8/16-bit

8-bit

LPT1: in ECP Mode

4

1st DMA Controller Cascade

No

16-bit

5

Available

Yes

16-bit

16-bit

Sound

6

Available

Yes

16-bit

16-bit

Available

7

Available

Yes

16-bit

16-bit

Available

Note that PCI adapters don't use these ISA DMA channels; these are only for ISA cards. However, some PCI cards emulate the use of these DMA channels (such as sound cards) to work with older software.

The only standard DMA channel used in all systems is DMA 2, which is universally used by the floppy controller. DMA 4 is not usable and does not appear in the bus slots. DMA channels 1 and 5 are most commonly used by ISA sound cards, such as the Sound Blaster 16, or by newer PCI sound cards that emulate an older one for backward compatibility. These cards use both an 8-bit and a 16-bit DMA channel for high-speed transfers. DMA 3 is used when a parallel port is configured to work in ECP mode or EPP/ECP mode. Some nonstandard systems, such as older Packard Bell computers, use DMA 1 instead of DMA 3 for the parallel port by default. However, a jumper block on the motherboard on many of these systems can be set to use DMA 3 for the parallel port and avoid conflicts with sound cards that use DMA 1.

Note

Although DMA channel 0 appears in a 16-bit slot connector extension and therefore can be used only by a 16-bit card, it performs only 8-bit transfers! Because of this, you generally don't see DMA 0 as a choice on 16-bit cards. Most 16-bit cards (such as SCSI host adapters) that use DMA channels have their choices limited to DMA 57.

I/O Port Addresses

Your computer's I/O ports enable communications between devices and software in your system. They are equivalent to two-way radio channels. If you want to talk to your serial port, you need to know on which I/O port (radio channel) it is listening. Similarly, if you want to receive data from the serial port, you need to listen on the same channel on which it is transmitting.

Unlike IRQs and DMA channels, our systems have an abundance of I/O ports. There are exactly 65,535 portsnumbered from 0000h to FFFFhwhich is a feature of the Intel x86 processor design. Even though most devices use up to 8 ports for themselves, with that many to spare, you won't run out anytime soon. The biggest problem you have to worry about is setting two devices to use the same port.

Most modern plug-and-play systems resolve any port conflicts and select alternative ports for one of the conflicting devices.

One confusing issue is that I/O ports are designated by hexadecimal addresses similar to memory addresses. They are not memory; they are ports. The difference is that when you send data to memory address 1000h, it gets stored in your SIMM or DIMM memory. If you send data to I/O port address 1000h, it gets sent out on the bus on that "channel," and anybody listening in could then "hear" it. If nobody is listening to that port address, the data reaches the end of the bus and is absorbed by the bus terminating resistors.

Driver programs are primarily what interact with devices at the various port addresses. The driver must know which ports the device is using to work with it, and vice versa. That is not usually a problem because the driver and device come from the same company.

Motherboard and chipset devices usually are set to use I/O port addresses 0hFFh, and all other devices use 100hFFFFh. Table 4.82 shows the commonly used motherboard and chipset-based I/O port usage.

Table 4.82. Motherboard and Chipset-Based Device Port Addresses

Address (hex)

Size

Description

0000000F

16 bytes

Chipset - 8237 DMA 1

00200021

2 bytes

Chipset - 8259 interrupt controller 1

002E002F

2 bytes

Super I/O controller configuration registers

00400043

4 bytes

Chipset - Counter/Timer 1

0048004B

4 bytes

Chipset - Counter/Timer 2

0060

1 byte

Keyboard/Mouse controller byte - reset IRQ

0061

1 byte

Chipset - NMI, speaker control

0064

1 byte

Keyboard/Mouse controller, CMD/STAT byte

0070, bit 7

1 bit

Chipset - Enable NMI

0070, bits 6:0

7 bits

MC146818 - Real-time clock, address

0071

1 byte

MC146818 - Real-time clock, data

0078

1 byte

Reserved - Board configuration

0079

1 byte

Reserved - Board configuration

0080008F

16 bytes

Chipset - DMA page registers

00A000A1

2 bytes

Chipset - 8259 interrupt controller 2

00B2

1 byte

APM control port

00B3

1 byte

APM status port

00C000DE

31 bytes

Chipset - 8237 DMA 2

00F0

1 byte

Math Coprocessor Reset Numeric Error

To find out exactly which port addresses are being used on your motherboard, consult the board documentation or look up these settings in the Windows Device Manager.

Bus-based devices typically use the addresses from 100h on up. Table 4.83 lists the commonly used bus-based device addresses and some common adapter cards and their settings.

Table 4.83. Bus-Based Device Port Addresses

Address (hex)

Size

Description

01300133

4 bytes

Adaptec SCSI adapter (alternate)

01340137

4 bytes

Adaptec SCSI adapter (alternate)

0168016F

8 bytes

Fourth IDE interface

01700177

8 bytes

Secondary IDE interface

01E801EF

8 bytes

Third IDE interface

01F001F7

8 bytes

Primary IDE/AT (16-bit) hard disk controller

02000207

8 bytes

Gameport or joystick adapter

02100217

8 bytes

IBM XT expansion chassis

02200233

20 bytes

Creative Labs Sound Blaster 16 audio (default)

02300233

4 bytes

Adaptec SCSI adapter (alternate)

02340237

4 bytes

Adaptec SCSI adapter (alternate)

0238023B

4 bytes

MS bus mouse (alternate)

023C023F

4 bytes

MS bus mouse (default)

0240024F

16 bytes

SMC Ethernet adapter (default)

02400253

20 bytes

Creative Labs Sound Blaster 16 audio (alternate)

0258025F

8 bytes

Intel above board

0260026F

16 bytes

SMC Ethernet adapter (alternate)

02600273

20 bytes

Creative Labs Sound Blaster 16 audio (alternate)

02700273

4 bytes

Plug and Play I/O read ports

0278027F

8 bytes

Parallel port 2 (LPT2)

0280028F

16 bytes

SMC Ethernet adapter (alternate)

02800293

20 bytes

Creative Labs Sound Blaster 16 audio (alternate)

02A002AF

16 bytes

SMC Ethernet adapter (alternate)

02C002CF

16 bytes

SMC Ethernet adapter (alternate)

02E002EF

16 bytes

SMC Ethernet adapter (alternate)

02E802EF

8 bytes

Serial port 4 (COM4)

02EC02EF

4 bytes

Video, 8514, or ATI standard ports

02F802FF

8 bytes

Serial port 2 (COM2)

03000301

2 bytes

MPU-401 MIDI port (secondary)

0300030F

16 bytes

SMC Ethernet adapter (alternate)

03200323

4 bytes

XT (8-bit) hard disk controller

0320032F

16 bytes

SMC Ethernet adapter (alternate)

03300331

2 bytes

MPU-401 MIDI port (default)

03300333

4 bytes

Adaptec SCSI adapter (default)

03340337

4 bytes

Adaptec SCSI adapter (alternate)

0340034F

16 bytes

SMC Ethernet adapter (alternate)

0360036F

16 bytes

SMC Ethernet adapter (alternate)

0366

1 byte

Fourth IDE command port

0367, bits 6:0

7 bits

Fourth IDE status port

03700375

6 bytes

Secondary floppy controller

0376

1 byte

Secondary IDE command port

0377, bit 7

1 bit

Secondary floppy controller disk change

0377, bits 6:0

7 bits

Secondary IDE status port

0378037F

8 bytes

Parallel Port 1 (LPT1)

0380038F

16 bytes

SMC Ethernet adapter (alternate)

0388038B

4 bytes

Audio - FM synthesizer

03B003BB

12 bytes

Video, Mono/EGA/VGA standard ports

03BC03BF

4 bytes

Parallel port 1 (LPT1) in some systems

03BC03BF

4 bytes

Parallel port 3 (LPT3)

03C003CF

16 bytes

Video, EGA/VGA standard ports

03D003DF

16 bytes

Video, CGA/EGA/VGA standard ports

03E6

1 byte

Third IDE command port

03E7, bits 6:0

7 bits

Third IDE status port

03E803EF

8 bytes

Serial port 3 (COM3)

03F003F5

6 bytes

Primary floppy controller

03F6

1 byte

Primary IDE command port

03F7, bit 7

1 bit

Primary floppy controller disk change

03F7, bits 6:0

7 bits

Primary IDE status port

03F803FF

8 bytes

Serial port 1 (COM1)

04D004D1

2 bytes

Edge/level triggered PCI interrupt controller

05300537

8 bytes

Windows sound system (default)

0604060B

8 bytes

Windows sound system (alternate)

0678067F

8 bytes

LPT2 in ECP mode

0778077F

8 bytes

LPT1 in ECP mode

0A200A23

4 bytes

IBM Token-Ring adapter (default)

0A240A27

4 bytes

IBM Token-Ring adapter (alternate)

0CF80CFB

4 bytes

PCI configuration address registers

0CF9

1 byte

Turbo and reset control register

0CFC0CFF

4 bytes

PCI configuration data registers

FF00FF07

8 bytes

IDE bus master registers

FF80FF9F

32 bytes

Universal serial bus

FFA0FFA7

8 bytes

Primary bus master IDE registers

FFA8FFAF

8 bytes

Secondary bus master IDE registers

To find out exactly what your devices are using, again I recommend consulting the documentation for the device or looking up the device in the Windows Device Manager. Note that the documentation for some devices might list only the starting address instead of the full range of I/O port addresses used.

Virtually all devices on the system buses use I/O port addresses. Most of these are fairly standardized, meaning conflicts or problems won't often occur with these settings. In the next section, you learn more about working with I/O addresses.

Категории