PC Hardware

Direct Memory Access (DMA)

The CPU runs the BIOS, operating system, and applications, as well as handling interrupts and accessing I/O addresses. This requires the CPU to move a lot of data. This data movement is necessary, requiring considerable CPU power and time, but it is also very simple. Moving data is a waste of the CPU's resources.

To reduce this waste, another chip is installed to work with the system CPU. It is called a direct memory access (DMA) chip. The only function of the DMA chip (the 8237 chip) is to move data. It handles all the data passing from peripherals to RAM and vice versa.

DMA transfers are not automatic. Hardware and device drivers must be designed to take advantage of this chip. Originally, DMA was used only to transfer data between floppy disk drives and RAM; early computers had only four wires and one DMA chip. Any device requiring DMA had to send a request, just like an IRQ.

DMA channels use the same rules as IRQs. Just as with the 8259 chip, DMA availability soon became a problem because an insufficient number of channels was available. A second DMA chip was added for 286-based computers. Just like the second IRQ chip, these two are cascaded, allowing a total of eight DMA channel assignments (usually referred to simply as DMA channels). The floppy disk drives on all computers use DMA channel 2.

Setting DMA Channels

Fortunately, not many devices use DMA. Sound cards, a few SCSI controllers, and some CD-ROM drives and network cards do require DMA. Just as with IRQs and I/O addresses, DMA can be set by means of either hardware or software. However, manufacturers started using DMA for devices other than the floppy disk drive only recently. As a result, almost all devices set DMA through software (although some still use jumpers). If two devices share the same DMA channel and "talk" at the same time, the computer will lock up. The following table provides DMA channel assignments.

DMA Channel Function
0 Available
1 Available
2 Floppy disk controller
3 ECP parallel/available
4 First DMA controller
5 Second sound card
6 SCSI/available
7 Available

Managing DMA

DMA and IRQ work in the same way; therefore, DMA conflicts look and act exactly like IRQ conflicts. Always check for IRQ conflicts first. (It is possible for a computer professional to spend hours trying to solve IRQ problems when the source of the problem is actually the DMA.) If you are sure all IRQs are correct, yet the computer continues to experience a problem, check the DMA. There is very little diagnostic software for resolving DMA problems, so it is important to maintain careful documentation.

by BrainBellupdated