Direct Memory Access (DMA) [ASSEMBLY LANGUAGE]

<<==: Direct Memory Access (DMA) :==>>

[[Direct memory access (DMA) is a feature of modern computers that allows certain hardware subsystems within the computer to access system memory independently of the central processing unit (CPU).

Without DMA, when the CPU is using programmed input/output, it is typically fully occupied for the entire duration of the read or write operation, and is thus unavailable to perform other work. With DMA, the CPU initiates the transfer, does other operations while the transfer is in progress, and receives an interrupt from the DMA controller when the operation is done. This feature is useful any time the CPU cannot keep up with the rate of data transfer, or where the CPU needs to perform useful work while waiting for a relatively slow I/O data transfer. Many hardware systems use DMA, including disk drive controllers, graphics cards, network cards and sound cards. DMA is also used for intra-chip data transfer in multi-core processors. Computers that have DMA channels can transfer data to and from devices with much less CPU overhead than computers without a DMA channel. Similarly, a processing element inside a multi-core processor can transfer data to and from its local memory without occupying its processor time, allowing computation and data transfer to proceed in parallel.

DMA can also be used for "memory to memory" copying or moving of data within memory. DMA can offload expensive memory operations, such as large copies or scatter-gather operations, from the CPU to a dedicated DMA engine. Intel includes such engines on high-end servers, called I/O Acceleration Technology (I/OAT).]]
………………………………………………………………………………………...

DMA Short for direct memory access, a technique for transferring data from main memory to a device without passing it through the CPU. Computers that have DMA channels  can transfer data to and from devices much more quickly than computers without a DMA channel can. This is useful for making quick backups and for real-time applications. Some expansion boards, such as CD-ROM cards, are capable of accessing the computer's DMA channel. When you install the board, you must specify which DMA channel is to be used, which sometimes involves setting a jumper or DIP switch.



The connection between the DMA controller and other components in a computer system for DMA transfer is shown in figure.



DMA Transfer In A Computer System

  • The DMA request line is used to request a DMA transfer.
  • The bus request (BR) signal is used by the DMA controller to request the CPU to relinquish control of the buses.
  • The CPU activates the bus grant (BG) output to inform the external DMA that its buses are in a high-impedance state (so that they can be used in the DMA transfer.)
  • The address bus is used to address the DMA controller and memory at given location.
  • The Device select (DS) and register select (RS) lines are activated by addressing the DMA controller.
  • The RD and WR lines are used to specify either a read (RD) or write (WR) operation on the given memory location.
  • The DMA acknowledge line is set when the system is ready to initiate data transfer.
  • The data bus is used to transfer data between the I/O device and memory.
  • When the last word of data in the DMA transfer is transferred, the DMA controller informs the termination of the transfer to the CPU by means of the interrupt line.