Open In App

Direct Memory Access in OS

During transferring the data process, involves processors, memory, and input-output devices. The transfer starts when the processor initiates it and ends upon storage of the data. Therefore, the processor’s load increases and should be constant to keep its efficiency high. While a station master assists with increasing the pace of data transmission between I/O devices and memory, the DMA controller functions like the station master. To reduce their work, the DMA controller tries to minimize the role of the processor in this whole operation.

What is Direct Memory Access?

Some computer bus architectures incorporate a functionality called Direct Memory Access whereby data can be transferred directly from an attached device like a disk drive to the system’s main memory in the motherboard without necessarily passing through the CPU. Data transfer frees the microprocessor from operations that include data transfer leading to a faster computer work rate.



DMA is basically about allowing disk drives, external memory, graphic cards, network cards, and sound cards among other devices to read and write data into the memory of the computer. This is achieved without interfering with the operations of the other sections like the CPU.

The process of data management avoids overloading the computer’s CPU with many requests for external devices, which prevents the performing of other operations by the computer. A user can operate a CPU to commence a data transfer on DMA with another attached equipment while other works are being executed in parallel. Data movement between devices and the computer is possible at a reduced cost for the CPU through DMA.



Instead of DMA, we have the Ultra DMA delivering up to a transfer rate of 33 MBps. Hard disks with ultra DMA/33 operate in PIO-1, PIO-3, PIO-4, and multiword DMA-2 mode at 16.8 MBs.

Direct Memory Access

The CPU sends a signal to the DMA controller to start transferring data, and it sets up the addressing of the system memory as well as the read/write modes in the process.

How Does DMA Work?

By using DMA, usually some specified portion of memory is allocated and earmarked to be utilized for direct memory access. As an illustration, 00765K of memory can be addressed for DMA in Industry’s Standard Architecture bus. In other such buses standards, memory access might be through the full range of addressable locations. With regards to this, peripheral component interconnect has the ability of utilizing a bus master where the CPU gives orders on I/O control to the PCI controller.

Data transfers between a system’s memory and various peripheral devices occur through DMA channels. The system includes bus lines connecting CPU, memory, I/O attached devices and a DMA controller for system resources including the DMA channels. The controller DMA starts memory reading or writing cycles as well as generating addresses of memory.

A memory address is specified which is associated with the CPU to instruct it to get the DMA controller to start a data transfer.ҽ Thus, DMA controller specifies destination address to the system’s memory and also sets the read/write line. The process then alters the internal memory address after every byte transported until it has moved a whole block of information.

Data transfer modes in DMA controller.

For sending large block data, the alternative methods do not help. This function is performed by the DMA controller, who, in fact does it faster and efficiently, especially for larger blocks.

The modes in which the Direct Memory Access(DMA) controller transfers the data are:

DMA vs RDMA

DMA (Direct Memory Access)

RDMA (Remote Direct Memory Access)

Direct memory access (DMA) enables peripheral device transfers of data to system memory without engaging CPU. By passing the CPU in every data transfer, it improves the data throughput by boosting efficiencies.

Unlike RDMA, this advanced technology provides direct memory-to-memory communication and excludes the CPUs of both systems.

The host CPU usually starts and monitors all its DMA transfers. The computer then informs the DMA controller on which address to transfer data from, how much data, and where to store it.

This eliminates the need for the CPU to be involved in data transfer. Instead, such transfers operate as a result of the interaction between the network adapters.

It is commonly employed within connections where it facilitates rapid transfer of information at a pace between system memory and peripheral, for example on networks and in cases of storing devices.

Distributed systems typically utilize them, particularly in situations involving high performance computing and networks that demand very low latency and throughput.

It communicates within the system and transfers data among the different internal elements of it.

RDMA creates point to point channels of data transfer between computers in a distributed network allowing for direct memory-to-memory communication which is suitable for distributed computing and storage architectures.

However, there is some latency involved because the CPU must set up the transfer and control the DMA controller.

Compared to traditional DMA, RDMA tends to have less latency because the processor is not involved in the data transfers.

Conclusion

Lastly, Direct Memory Access (DMA) acts as a traffic officer for your computer’s data. It relieves the main processor thus making it easier for devices such as hard drives and graphics cards to communicate with the memory of computers. Therefore, data transfer becomes quicker and your computer can perform more tasks at a time without being bogged down. There are several types of DMA and each mode transfers data very intelligently.

Additionally, we examined another variant of DMA called RDMA (remote direct memory access), which can be useful for example at the data center. However, DMA has its demerits such as building cost and possible problems related to cache. However, DMA essentially contributes towards ensuring smooth running and faster operation of your PC. It is like when you give a computer a high-way of data traffic and then work becomes much easier due to this.

Frequently Asked Questions on DMA – FAQs

State advantages of DMA controllers?

These are the advantages of the DMA controllers. It passes the data without using the processor, and this contributes towards speeding of the read-write task. This reduces the number of clocks cycles needed to write or read a set of data. The processors are relieved as a result.

How many input-output devices under the control of DMA is dependent on?

How many DMA channels have it.

In what instances can DMA be used in different operations?

Direct Memory Access (DMA) can be used, especially in the case of massive data transmission between memory and devices. It makes possible quick transfer without involving the central processing unit which can enable the processor engage in other activities at the same time.

How do other data-transfers methods compare with DMA?

Alternatively, programmed I/O and interrupt driven I/O could be applied instead of Direct Memory Access (DMA).

State disadvantages of DMA controllers?

Disadvantages of DMA Controllers-following.

  • This being a hardware unit will cost money for its construction.
  • While using cache, the problem of cache coherence arises.

Article Tags :