Direct Memory Access-DMA
| MCS-012 Computer
Organisation and Assembly Language programming What is the advantage of DMA? Devices that use DMA provide one significant advantage over devices that do not. What is this advantage? A) Devices that can use DMA are designed for low power consumption, making them perfect for laptops. B) DMA-capable hard drives have much higher seek times than those drives that don’t support DMA. C) A device that supports DMA supports faster CPUs than those devices without DMA support. D) A DMA-capable device can communicate directly with memory, bypassing the CPU. https://www.professormesser.com/free-a-plus-training/a-plus-pop-quizzes/what-is-the-advantage-of-dma/ Direct memory access (DMA) is a method that allows an input/output (I/O) device to send or receive data directly to or from the main memory, bypassing the CPU to speed up memory operations. The process is managed by a chip known as a DMA controller (DMAC). A computer's system resource tools are used for communication between hardware and software. The four types of system resources are I/O addresses Memory addresses Interrupt request numbers (IRQ) Direct memory access (DMA) channels DMA channels are used to communicate data between the peripheral device and the system memory. All four system resources rely on certain lines on a bus. Some lines on the bus are used for IRQs, some for addresses (the I/O addresses and the memory address) and some for DMA channels. A DMA channel enables a device to transfer data without exposing the CPU to a work overload. Without the DMA channels, the CPU copies every piece of data using a peripheral bus from the I/O device. Using a peripheral bus occupies the CPU during the read/write process and does not allow other work to be performed until the operation is completed. With DMA, the CPU can process other tasks while data transfer is being performed. The transfer of data is first initiated by the CPU. During the transfer of data between the DMA channel and I/O device, the CPU performs other tasks. When the data transfer is complete, the CPU receives an interrupt request from the DMA controller. https://www.techopedia.com/definition/2767/direct-memory-access-dma Interrupt driven I/O 1 Interrupt driven I/O means CPU issues commands to the I/O module then proceeds with its normal work until interrupted by I/O device on completion of its work. 2 The problem with the programmed I/O is that the processor has to wait a long time for the input/output module of concern to be ready for either reception or transmission of more data. 3 The processor, while waiting, must repeatedly interrogate the status of the Input/ Output module. As a result the level of performance of entire system is degraded. 4 An alternative approach for this is interrupt driven Input / Output. The processor issue an Input/output command to a module and then go on to do some other useful work. The input/ Output module will then interrupt the processor to request service, when it is ready to exchange data with the processor. 5 The processor then executes the data transfer as before and then resumes its former processing. 6 Interrupt-driven input/output still consumes a lot of time because every data has to pass with processor. DMA 1 Direct Memory Access (DMA) means CPU grants I/O module authority to read from or write to memory without involvement. 2 The previous ways of I/O suffer from two inherent drawbacks. a) The I/O transfer rate is limited by the speed with which the processor can test and service a device. b) The processor is tied up in managing an I/O transfer; a number of instructions must be executed for each I/O transfer. 3 When large volumes of data are to be moved, a more efficient technique is required: Direct memory access. The DMA function can be performed by a separate module on the system bus, or it can be incorporated into an I/O module. In either case, the technique works as follow. 4 When the processor wishes to read or write a block of data, it issues a command to the DMA module by sending the following information. Whether a read or write is requested. The address of the I/O devices. Starting location in memory to read from or write to. The number of words to be read or written. 5 The processor then continues with other work. It has delegated this I/O operation to the DMA module, and that module will take care of it. The DMA module transfers the entire block of data, one word at time, directly to or from memory, without going through the processor. When the transfer is complete, the DMA module sends an interrupt signal to the processor. Thus the processor is involved only at the beginning and at the end of the transfer. 6 In programmed I/O CPU takes care of whether the device is ready or not. Data may be lost. Whereas in Interrupt-driven I/O, device itself inform the CPU by generating an interrupt signal. If the data rate of the I/O is too fast. Data may be lost. In this case CPU most be cut off, since CPU is too slow for the particular device. The initial state is too fast. It is meaningful to allow the device to put the data directly to the memory. This is called DMA. DMA controller will take over the task of CPU. CPU is general purpose but the DMA controller is specific purpose. 7 A DMA module controls the exchange of data between main memory and an I/O module. The processor sends a request for the transfer of a block of data to the DMA module and is interrupted only after the entire block has been transferred. https://www.ques10.com/p/8790/compare-interrupt-driven-io-and-dma-1/ |
Comments
Post a Comment