Direct Memory Access (DMA) and Buffer

Direct Memory Access (DMA)
  • Allows peripheral devices (ex. disk drives, graphics cards, sound cards, network
    A diagram showing the position of the DMA in realtion to peripheral devices, the CPU and internal memory
    cards, etc.) to access the main memory without involvement of the CPU
    • Allows tasks to run in the background without slowing down the CPU, since the CPU doesn't have to take care of the fairly basic reading/writing processes itself.
    • For example: Ultra DMA HDDs can access the main memory directly and transfer any required data without the involvement of the CPU. Previous HDDs required the CPU to transfer the data from the HDD to the main memory or vice versa, causing the transfer to be less efficient.

  • Allows for storage of information temporarily to increase system performance
    • In order to not slow down the fast components, the data from these components = stored in a buffer until used by the slower components
      • ex. Writing to a HDD usually takes a very long time compared to the time needed for the CPU to output the data; to not keep the CPU from performing other tasks, the data is stored in a buffer until it is written onto the HDD
      • ex2. When you stream a movie or sound file from the Internet the first part of the file is usually loaded into the buffer before playing, so that the file plays from the buffer and not directly from the Internet. Meanwhile the rest of the file is also loaded into the buffer. This decreases the chance of the file to stop playing due to slow network or network congestion.
  • Located in RAM
  • To 'flush' a buffer = to write all the buffer's content to the HDD & clear the buffer
  • If buffer = empty, it sends an interrupt to the CPU, which refills it
    • If CPU has more important tasks to perform, buffer might not be refilled immediately
      • 2 buffers might be used, so that while the CPU refills the first buffer, the application can use the data stored in the second buffer, so that no pauses occur

Created By: Jocbe
Last update: 7. January 2011