What is the difference between DMA and memory-mapped IO? They both look similar to me.
What is the difference between the two modes? PIO stands for Programmed Input/Output, which is a protocol for data transfer. Since it involves the CPU, the use of PIO mode for data transfer can slow a computer down considerably. On the contrary, DMA (Direct Memory Access) does not involve the CPU.
The basic difference between memory mapped IO and IO mapped IO is that memory mapped IO uses the same address space for both memory and IO device while IO mapped IO uses two separate address spaces for memory and IO device.
DMA is an abbreviation of direct memory access. DMA is a method of data transfer between main memory and peripheral devices. The hardware unit that controls the DMA transfer is a DMA controller. DMA controller transfers the data to and from memory without the participation of the processor.
Memory-mapped I/O uses the same address space to address both memory and I/O devices. The memory and registers of the I/O devices are mapped to (associated with) address values. So when an address is accessed by the CPU, it may refer to a portion of physical RAM, or it can instead refer to memory of the I/O device.
Memory-mapped I/O allows the CPU to control hardware by reading and writing specific memory addresses. Usually, this would be used for low-bandwidth operations such as changing control bits.
DMA allows hardware to directly read and write memory without involving the CPU. Usually, this would be used for high-bandwidth operations such as disk I/O or camera video input.
Here is a paper has a thorough comparison between MMIO and DMA.
Design Guidelines for High Performance RDMA Systems
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With