Direct Memory Access Bus Control

Micro Channel Architecture Handbook, pages 169-171 [physical]

IBM PC DMA Transfers  

Less obvious than data, address, or interrupt lines but still necessary on the expansion bus of IBM standard computers are dedicated lines to handle direct memory access or DMA transfers. The direct memory access process allows a dedicated controller to move bytes of memory without the intervention of the microprocessor. Generally, the DMA controller receives instructions of how many bytes to move from where to where, and it then automatically carries out its task.

DMA lines are necessary so that devices installed in expansion slots can signal to the DMA controller to let it know to make the transfers. The controller also must be able to signal back to the rest of the system when it has completed its tasks.

In the IBM PC, several bus lines are used for these functions. The address enable line is used to tell the DMA controller that the microprocessor has disconnected  itself from the bus to let the DMA controller take command. Once this signal is asserted, the DMA controller has charge of the address and data lines, in addition to the memory and input/output read and write control lines.

At the end of a DMA memory move, a pulse is sent down the terminal count line. It's called that because the pulse represents the termination (end) of a count of the number of bytes moved in the DMA transfer. (The number of bytes to be moved must be declared before the transfer begins so that they can be appropriately counted.)

Devices indicate to the DMA controller that they wish to make DMA transfers by sending signals down one of the three DMA request lines. Each line is assigned a priority level corresponding to its numerical designation, with one having the highest priority, three the lowest.

To indicate that a request has been received by the DMA controller as well as provide the rest of the system with an acknowledgment of the DMA request, four DMA acknowledge lines are provided. Three are used to confirm the DMA requests across the bus itself, designated by numbers corresponding to the request to be acknowledged (for example, DAK1 acknowledges the request signal for DMA channel 1). The fourth, designated 0, acknowledges memory refreshing (which also deprives other devices of access to the PC bus).

As useful as three DMA channels were for the first PC (a fourth is used for internal PC functions and cannot be controlled by expansion cards), they proved insufficient for the designers of the AT. For one, all three of the DMA channels of the PC were designed for making 8-bit transfers. The AT was to be, of course, a 16-bit machine. Consequently, four new 16-bit DMA channels were engineered into the AT and three new lines were needed to control them from the expansion bus (again, one of the 16-bit lines was reserved for system board use to cascade the second DMA controller). The operation and priorities assigned to the new DMA channels conform to the pattern set by the original PC. DMA channel 0 has the highest priority, DMA channel 7 the lowest. The control registers for Micro Channel DMA are upward compatible in function and organization.

MCA DMA Transfers  

The signals used for DMA control on the PC and AT buses however, are not continued in the Micro Channel design. In its allotment of signals and connections, you'll find terminal count, but DMA request, and DMA acknowledge lines are encoded into an arbitration bus in the Micro Channel. These signals perform essentially the same functions as those of the previous specifications, but the control circuitry is distributed between the DMA slave and DMA controller. The changes are transparent to software but the interface to DMA slave adapters is very different.

As to the number of DMA channels, the Micro Channel continued the DMA assignments used in the AT. This was done to preserve compatibility with existing  applications and system configurations. In Micro Channel Personal Systems/2, the control registers for the DMA controller are at the same addresses as are used in the PC and AT. The same relative priority between the DMA channels is also maintained.

DMA channels 0 and 4 are active in PS/2 Micro Channel systems and can be reprogrammed by an operating system to respond to arbitration levels 8 through 15. This dynamic reassignability allows up to 15 DMA slave devices to be  supported by the system's eight-channel DMA controller. Eight channels allow up to eight concurrent DMA data transfers to be active at the same time. (Although the transfers are simultaneously active, data do not move simultaneously, because only one DMA controller can take over the bus at a time.)

While the AT also defined eight DMA channels, only three are compatible with the PC and usable with DOS. Consequently, the full potential of the DMA facilities of the AT has never been exploited. The most popular operating systems for the AT— PC-DOS and MS-DOS — cannot make use of 16-bit DMA transfers, hence the "added" 16-bit DMA channels of the AT are used by almost no software. In contrast, while the Micro Channel defines the same number of DMA channels as the AT, all eight are compatible with DOS (as was shown in Chapter 6).

Eight DMA channels is sufficient to maintain compatibility with AT systems. Moreover, it is consistent with the bus designer's goals of economy and elegance, keeping the number of signals at a minimum. But maintaining the AT DMA  assignments and arrangement does not allow for the future expandability of the Micro Channel. After all, one of the original considerations in creating the Micro Channel was to eliminate limits, not pile them on. Consequently, the Micro Channel only starts with the existing DMA facilities. It then adds to them by allowing the available DMA channels to be shared among connected devices. One DMA channel can thus serve many slave adapters, and devices connected to the bus.

Early Micro Channel DMA system implementations provide a 24-bit address and cannot access more than 16 megabytes of memory. Because of this addressing limit, DMA transfers are limited to the lower 16 megabytes that can be installed in a Micro Channel Personal System/2 computer. This is driven by a similar 24-bit operating system and processor restrictions. In 32-bit systems, enough lines are reserved by the Micro Channel specification to open its full four gigabytes of memory to DMA transfers.

Moreover, the Micro Channel allows more DMA channels to be added to a system. For example, if an existing Micro Channel system required 15 active DMA
channels, a bus master could be designed to augment and extend the system's
DMA functions. In fact, 32-bit data transfer and addressing could also be added to
more basic systems by such a "system booster" card.