DMA related questions?

pellel

Distinguished
Jan 17, 2005
39
0
18,530
I have bumped into the DMA abbreviation several times now and being quite knew to the world of hardware I don't know what the advantage of using DMA is. I know that DMA is a short way of writing direct memory access, though.

What is the function of DMA?
What is the advantage with DMA?
Are there any alternatives to DMA?
How does it work in practice?

Hope you guys can provide some help here..
 
What is the function of DMA?
For high bandwidth devices like hard disks, data transfers consist primarily of relatively large blocks of information. So computer designers invented a mechanism for transferring data directly to or from the memory without involving the processor. This mechanism is called direct memory access (DMA).

The DMA controller becomes the bus master and directs the reads and writes between itself and memory.

What is the advantage with DMA?
Increases processor performance.

Are there any alternatives to DMA?
Yes. Interrupt driven I/O. The processor is notified when an I/O device requires attention, and thus the processor is interrupted to allocate some of its time to the I/O device. However, this method of transferring data could still be intolerable, since it consumes the processor when the disk is transferring.


How does it work in practice?
There are three steps in DMA transfer:
1.The processor supplies the identity of the I/O device, the operation to perform, and the memory address to the DMA along with the number of bytes to transfer.
2.The DMA starts the operation on the device. The DMA unit can complete an entire transfer. Many DMA controllers contain some memory to allow them to tolerate some delays in transfer or delays incurred while waiting to become the bus master.
3.The DMA controller interrupts the processor when the transfer is complete.