DMA Controlled I/O

Filter Course


DMA Controlled I/O

Published by: Nuru

Published date: 17 Jun 2021

DMA Controlled I/O Photo

DMA Controlled I/O

The method that is used to transfer information between internal storage and external I/O devices is known as the I/O interface. The CPU is interfaced using special communication links by the peripherals connected to any computer system. These communication links are used to resolve the differences between the CPU and peripheral. There exist special hardware components between the CPU and peripherals to supervise and synchronize all the input and output transfers that are called interface units.

Direct Memory Access (DMA)

Different from Programmed I/O and Interrupt-Driven I/O, Direct Memory Access is a technique for transferring data within the main memory and external device without passing it through the CPU. DMA is a way to improve processor activity and I/O transfer rate by taking over the job of transferring data from the processor and letting the processor do other tasks. This technique overcomes the drawbacks of the other two I/O techniques which are the time-consuming process when issuing the command for data transfer and tie-up the processor in data transfer while the data processing is neglected. It is more efficient to use the DMA method when a large volume of data has to be transferred. For DMA to be implemented, the processor has to share its’ system bus with the DMA module. Therefore, the DMA module must use the bus only when the processor does not need it, or it must force the processor to suspend operation temporarily. The latter technique is more common to be used and it is referred to as cycle stealing.

Basic Operation of DMA

When the processor wishes to read or send a block of data, it issues a command to the DMA module by sending some information to the DMA module. The information includes:

  • read or write command, sending through reading and write control lines.
  • the number of words to be read or written, communicated on the data lines, and stored in the data count register.
  • starting location in memory to read from or write to, communicated on data lines, and stored in the address register.
  • address of the I/O device involved, communicated on the data lines.

Configurations of DMA

DMA mechanism can be configured in a variety of ways, which are:

  • Single-bus detached DMA
  • Single-bus integrated DMA-I/O
  • I/O bus
  1. Single-bus detached DMA
    All modules share the same system bus. The DMA module is acting as a surrogate processor, which uses programmed I/O to exchange data between memory and an I/O module through the DMA module. This configuration is inexpensive but is inefficient. This is because each transfer of a word consumes two bus cycles.
  2. Single-bus integrated DMA
    In this configuration, there is a path between the DMA module and one or more I/O modules that do not include the system bus. The DMA logic can be a part of an I/O module or a separate module that controls one or more I/O modules. Therefore, the number of required bus cycles can be cut substantially. The system bus that the DMA module shares with the processor and memory is used by the DMA module only to exchange data with memory. The exchange of data between the DMA and I/O modules takes place off the system bus.
  3. I/O bus
    In this configuration, the concept is further improved from the previous configuration, which is single-bus, integrated DMA. I/O modules are connected to the DMA module using an I/O bus. This can reduce the number of I/O interfaces in the DMA module to one and provides for an easily expandable configuration. The system bus that the DMA module shares with the processor and memory is used by the DMA module only to exchange data with memory. The exchange of data between the DMA and I/O modules takes place off the system bus.