Direct Memory Access (Dma)
Direct Memory Access (Dma)
The processor sends the starting address, the number of words in the
block and the direction of the transfer.
The DMA controller then proceeds to perform the requested
operation.
Upon completion of the transfer, the DMA controller raises an
interrupt signal to the CPU.
The current program for which the DMA transfer is taking place is
suspended, and the processor is allotted another program to
execute. Post I/O transfer, the CPU returns to that program.
BLOCK DIAGRAM OF A DMA
TRANSFER
Fig 1. DMA Controller in a Computer System.
Steps Involved in a DMA Transfer
1. A program writes the address and word count information into registers of the
corresponding channel of the DMA controller.
2. Provides disk controller with information to identify the data for future retrieval.
3. The DMA controller proceeds independently to perform the specified information.
4. When the transfer is completed, the status bits of the DMA are updated by setting the
done bit to 1.
5. If the IE bit is set, the controller sends an interrupt request to the processor and sets the IRQ
bit.
6. The status register can also be used to record other information, such as whether transfer
took place correctly or errors occurred.
Steps Involved in a DMA Transfer
Requests by DMA devices for using the bus are always given higher priority than processor
requests.
Among different DMA devices, top-priority is given to high-speed peripherals (disk, network
interfaces, graphics display).
Since the processor originates most memory cycles, the DMA controller can be said to
“steal” memory cycles from the processor. This interweaving technique is called cycle
stealing.
The DMA controller may be given access to transfer a block of data without interruption, in
burst mode.
Most DMA controllers incorporate a data storage buffer, and the data transmitted over the
network.
A conflict may arise if the processor and the DMA or two DMA controllers try to use the bus at
the same time.
To resolve such conflicts, an arbitration procedure is used.
1. CYCLE STEALING.
2. FLY-BY MODE.
CONCLUSION