Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 12

Subjects:

1- DMA.
2- DMA channel.
3- DMA controller.
Computer System Organization
Direct memory access (DMA)
● As you know, the processor is the "brain" of the machine. In early
machines the processor really did almost everything. In addition to
running programs it was also responsible for transferring data to and
from peripherals. Unfortunately,the processor perform these transfers
is very inefficient, because it then is unable to do anything else.

● The invention of DMA enabled the devices to cut out the "middle
man", allowing the processor to do other work and the peripherals
to transfer data themselves, leading to increased performance.

● Direct memory access (DMA) is a feature of modern computer


systems that allows certain hardware subsystems to read/write data
to/from memory without CPU intervention, allowing the processor
to do other work.
DMAC Interface

CPU Memory
Interrupt

Request
DMA Acknowledge
Peripheral
Controller Device 1

Peripheral
Device 2
Direct memory access (DMA)

● Used in disk controllers, video/sound cards etc, or between


memory locations.

● Typically, the CPU initiates DMA transfer, do other


operations while the transfer is in progress, and receives
an interrupt from the DMA controller once the operation
is complete.

● Avoids the slow speed of programmed I/O when moving


large amounts of data between memory and a peripheral
DMA Applications
● 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
real-time applications.
● Wherever large amounts of data need to be transferred fast
between memory and an I/O peripheral device, e.g.
- Hard disk, CD.
- Video cards.
- Sound cards.
- Network cards.
DMA channel

● system pathway used by a device to transfer information


directly to and from memory. There are usually 8 in a
computer system

● Special channels were created, along with circuitry to


control them, that allowed the transfer of information
without the processor controlling every aspect of the
transfer. This circuitry is normally part of the system
chipset on the motherboard
DMA controller (DMAC)

● DMA controller, built into the system chipset on modern PCs

● Data transfer is coordinated by a DMA controller- not the processor

● DMAC: dedicated hardware used for controlling the DMA operation


DMAC Interface
DMA Problem
● DMA can lead to cache coherency problems.
● Imagine a CPU equipped with a cache and an external memory
that can be accessed directly by devices using DMA. When
the CPU accesses location X in the memory, the current value
will be stored in the cache. Subsequent operations on X will
update the cached copy of X, but not the external memory
version of X. If the cache is not flushed to the memory before
the next time a device tries to access X, the device will
receive a stale value of X.

● Similarly, if the cached copy of X is not invalidated when a


device writes a new value to the memory, then the CPU will
operate on a stale value of X.
Cache Coherency

X X Y Y
CPU DMA
Cache External Memory
Summary

● Used for high-speed I/O devices able to transmit


information at close to memory speeds.

● DMA controller transfers blocks of data from


buffer storage directly to main memory
without CPU intervention.

You might also like