With the IBM AT a second DMA controller was added to the motherboard architecture. This was done at the same time that the second IRQ controller was cascaded to the first PIC for IRQs, and for the same reason: to add system resources to a rather limited motherboard. The second DMA controller effectively doubled the DMA channels available and also offered new ones at double the speed of the original ones. However, the DMA controllers are not cascaded in the way the PIC's are. Instead the DMA controllers communicate with each other over DMA channel 4 of the second DMA controller. But all DMA channels have equal priority and it is up to the driver to lock the bus first, in order to get it first. It should be noted that DMA channels (also known as DRQs) 0 to 3 are "Classic DMA" channels that use the 8-bit transfers of the first DMA controller and a few are reserved for standard system peripherals. DMA channels 4 to 7 are attached to the 16-bit DMA chip and are therefore 16-bit data transfer DMA channels attached by 16 wires to the "new" (at the time) extended 16-bit data bus. Since DMA #4 is claimed as the communication channel between the two controllers themselves, channels 5, 6 and 7 are generally considered available for use by devices using 16-bit transfers of data over the "AT" bus, that is the extended 16-bit ISA bus. Here are the two 40-pin DIP Intel 8237 DMA controllers (one attached to the data bus by 8-bits, the other by 16-bits) on an IBM AT class motherboard:
The DMA controller has been outclassed by the modern PC, its buses and peripherals. Beginning with the 80386DX microprocessor, the CPU could actually execute the data transfer loop instructions and accomplish the large block data transfer from device I/O address to RAM (or vice versa) faster than the DMA controllers could do it. Device manufacturers noticed this and began developing their own device driver code to take advantage of the CPU's enormous processing speed and therefore bypass the DMA functions. This would ultimately make its way into the BIOS code itself allowing unsophisticated code to access the greater block transfer power without having to load device drivers to do it. This process of having the CPU do the work of the DMA controller because it can do it faster is called: PIO - Programmed I/O. And the standardized implementations in the BIOS code are called PIO modes and are used mainly by the ATA controller for accessing hard drives and ATAPI devices. The DMA controllers run on the ISA bus at 8.33Mhz and channels 5 to 7 offering 16-bit transfers can never achieve ideal transfer rates of 2Bytes X 8.33Mhz = 16.66MB/sec because the ISA bus requires a minimum of 2 clock cycles per data transfer for a maximum of 8.33MB/sec. The older ATA controllers (and hard drives of the same vintage) used the 8-bit DMA channels for data transfers to and from memory. This technology was officially made obsolete and no longer supported in the ATA-3 generation controllers. The 16-bit DMA modes are still supported for backwards compatibility however.
16-bit DMA Mode |
Transfer Rate |
Controller |
Mode 0
|
4.17MB/sec
|
ATA-1
|
Mode 1
|
13.33MB/sec
|
ATA-2 (PCI bus only)
|
Mode 2
|
16.67MB/sec
|
ATA-2 (PCI bus only)
|
Newer peripherals, ATA controllers especially, work with the motherboard chipset to temporarily take over the bus forcing all other peripherals off of it by locking it. Then they perform large block transfers to or from RAM with the assistance of the motherboard chipset. This provision in the chipset design, for any device to communicate, and negotiate control of the bus and do its own transfers in coordination with the motherboard chipset is called “bus mastering”. And the ATA controllers have spearheaded the technology which the hard drive industry calls UDMA.
The standard DMA assignments are:
DMA Channel |
Standard Device |
0
|
Available (Sound card - MIDI)
|
1
|
Available
|
2
|
Floppy Disk Controller
|
3
|
Enhanced Capabilities Port
|
4
|
Tie-back between DMA controllers
|
5
|
Available (Sound card - WAV)
|
6 |
Available
|
7 |
Available
|
Aside from the industry standard assignments, the student should be aware that in general, slow devices use 8-bit DMA channels because the transfer rate is limited to 1 byte/transfer and the maximum transfer rate is 8.33Mhz clock but on the asynchronous ISA bus which requires two clock cycles per transfer: 1Byte X 8.33Mhz ÷ 2 = 4.16MB/sec (only in an ideal situation which never actually exists). Faster devices like hard drives and ATAPI devices attached to the ATA controller need faster speeds and therefore use the 16-bit DMA's. Finally, the sound card, while not an industry standard is present on most modern PC's and uses DMA's. It needs faster speeds for moving raw digitized sound wave files to the DAC (Digital to Analog Converter) circuitry. But it does not need this speed when transfering notes to the onboard sound synthesizer. As such the sound card usually uses two DMA channels: one 8-bit DMA channel for MIDI (Musical Instrument Digital Interface) transfering notes to the synthesizer, and one 16-bit channel for the WAVDAC which captures or plays raw digitized sounds.