V3nom's
  • Welcome
  • Getting Started
    • CEH v13
    • Basics of Networking
      • Network Models
        • Application Layer in OSI ->
        • Presentation Layer in OSI ->
          • Comprehensive list of character encoding formats
        • Session Layer in OSI ->
        • Transport Layer in OSI ->
        • Network Layer in OSI ->
        • Data Link Layer in OSI ->
        • Physical Layer ->
    • Arch Linux Installation Guide
    • How to add VBoxLinuxAdditions.run in Debian Based Linux Distros
    • C# Programming Language
  • Research Papers
    • Word Embedding for Anomaly Detection
    • Build your own Redis
    • Blockchain Technology
    • Interactive blocks
    • OpenAPI
    • Integrations
  • Risk Analysis & Mitigation Notes
    • Risk Analysis & Mitigation
      • Unit 1: An Introduction to Risk Management
      • Unit 2: The Threat Assessment Process
      • Unit 3: Vulnerability Issues
      • Unit 4 ( Risk Analysis & Mitigation )
      • Unit 5 ( Risk Analysis & Mitigation )
  • Ethical Hacking
    • Ethical Hacking Syllabus
      • Unit I: Introduction ( English )
      • Unit I: Introduction ( Hinglish )
      • Unit II: The Business Perspective ( English )
      • Unit II: The Business Perspective ( Hinglish )
      • Unit III: Preparing for a Hack ( English )
      • Unit III: Preparing for a Hack ( Hinglish )
      • Unit IV: Enumeration ( English )
      • Unit IV: Enumeration ( Hinglish )
      • Unit V: Deliverables ( English )
      • Unit V: Deliverables ( Hinglish )
  • .NET Framework Notes
    • .NET Framework Syllabus
      • Unit - I ( Hinglish Version )
      • Unit - I ( English - Version for exams )
      • Unit - II ( Hinglish Version - For Understanding )
      • Unit - II (English Version - for papers)
      • Unit - III ( Hinghlish Version )
      • Unit - III ( English - Version )
      • Unit - IV ( Hinglish Version )
      • Unit - IV ( English Version )
      • Unit - V ( Hinglish Version )
      • Unit - V ( English Version )
  • IOT
    • unit 1
    • unit 2
    • unit 3
    • unit 4
    • unit 5
  • AD-Hoc and Wireless Networks
    • Unit 1 ( Hinglish )
    • unit 2 Hinglish
    • All assignments answers with questions
    • Mind Maps for All Questions
    • Page
  • Distributed Systems
    • Unit 1
    • Unit 2
    • Unit 3
    • Unit 4
    • Unit 5
  • Group 1
    • 1’s and 2’s Complement
    • Direct Memory Access
    • Register Transfer Level
    • Interrupt-Based Input/Output (I/O)
    • Memory and CPU Design
    • Instruction Cycle
    • Addressing Modes
    • Pipelining
    • Three Types of Hazards
    • All Types of Differences Tables
    • Parallel Processing
    • Addition/Subtraction Conversion
    • Data Representation
    • Page 1
Powered by GitBook
On this page
  • Direct Memory Access (DMA)
  • Definition:
  • Why DMA Exists:
  • How DMA Works (Step-by-Step):
  • Real-World Example:
  • Key Features of DMA:
  • DMA vs. Programmed I/O vs. Interrupt I/O:
  1. Group 1

Direct Memory Access

Direct Memory Access (DMA)

Definition:

DMA is a hardware feature that allows Input/Output (I/O) devices (like hard drives, network cards, or sound cards) to transfer data directly to or from the main memory (RAM) without involving the CPU for each byte of data. It’s like giving devices a shortcut to memory.

Why DMA Exists:

  • Speed Mismatch: CPUs are extremely fast, but I/O devices (e.g., disks, keyboards) are much slower.

  • Problem: If the CPU handles every byte of data transfer between an I/O device and memory, it gets stuck waiting for the slow device, wasting valuable processing time.

  • Solution: DMA acts as a middleman. The CPU sets up the transfer, and DMA handles the rest, freeing the CPU to perform other tasks.

How DMA Works (Step-by-Step):

  1. CPU Initiates Transfer:

    • The CPU sends instructions to the DMA controller (a specialized chip or module on the motherboard).

    • Instructions include:

      • Which I/O device to interact with (e.g., hard disk).

      • Memory address where data should be read from or written to in RAM.

      • Number of bytes to transfer.

    • After this setup, the CPU is done and can work on other tasks.

  2. DMA Takes Control:

    • The DMA controller takes over the memory bus (the pathway between memory and devices).

    • It manages the data transfer directly between the I/O device and RAM.

    • For example, it reads data from a disk and writes it to memory, or vice versa, without CPU involvement.

  3. Transfer Happens:

    • Data flows directly between the I/O device and memory.

    • The CPU remains free to execute other instructions during this time.

  4. DMA Notifies CPU:

    • Once the transfer is complete, the DMA controller sends an interrupt signal to the CPU.

    • This interrupt tells the CPU, “The job is done, you can take it from here!”

    • The CPU can then process the transferred data or initiate another task.

Real-World Example:

  • Scenario: Copying a large video file (e.g., 1 GB) from a hard disk to RAM.

    • Without DMA: The CPU reads each byte from the disk and writes it to RAM. This is slow and keeps the CPU busy, delaying other tasks.

    • With DMA: The CPU tells the DMA controller to handle the transfer. The disk sends data directly to RAM via the DMA controller. The CPU is free to run other programs (e.g., your video editing software) while the transfer happens.

Key Features of DMA:

  • DMA Controller: A dedicated chip or module that manages data transfers. It’s built into the motherboard or integrated into modern CPUs.

  • Bus Mastering: DMA can take control of the memory bus temporarily, ensuring smooth data flow.

  • High Efficiency: Frees up the CPU, reducing idle time and speeding up system performance.

  • Scalability: Supports multiple devices, each with its own DMA channel in advanced systems.

  • Modes:

    • Burst Mode: Transfers all data in one go, maximizing speed.

    • Cycle Stealing: Transfers data in small chunks, allowing the CPU to use the bus in between.

DMA vs. Programmed I/O vs. Interrupt I/O:

Feature

Programmed I/O

Interrupt I/O

DMA

CPU Involvement

Constant: CPU handles every byte.

On demand: CPU steps in when needed.

Minimal: CPU only sets up transfer.

Efficiency

Low: CPU is tied up, slowing system.

Moderate: CPU is freed somewhat.

High: CPU is mostly free.

Transfer Speed

Slow: Limited by CPU and device speed.

Medium: Faster than programmed I/O.

Fastest: Direct device-to-memory.

Use Case

Simple tasks (e.g., reading keyboard).

Moderate tasks (e.g., small files).

Large data transfers (e.g., videos).

Previous1’s and 2’s ComplementNextRegister Transfer Level

Last updated 21 days ago