DMA and Interrupt-driven I/O Flashcards
Explain why DMA is appropriate for a network.
Yes, using DMA for network devices is appropriate because it efficiently transfers large amounts of data between the network device and memory without constant CPU involvement. This offloads the CPU, allowing it to handle other tasks while the DMA controller manages data flow. It’s especially beneficial for high-speed networks, where fast and continuous data transfer is crucial. However, for small or irregular data transfers, DMA might be less efficient.
What is the difference in functionality between DMA and interrupt-driven I/O?
- DMA
Transfers data directly between memory and the device without CPU intervention. Allows the CPU to perform other tasks during data transfer, increasing efficiency. - ID-I/O
The CPU is interrupted when the device is ready for data transfer. The CPU manages the transfer, one interrupt at a time, which can be slower.
What size and frequency can DMA and interrupt-driven I/O handle?
- DMA
Ideal for large, continuous data transfers. - ID-I/O
Suitable for smaller, frequent data transfers.
What are the pros and cons of DMA?
Pros: Reduces CPU load, high transfer speeds, efficient for large data volumes.
Cons: Requires complex hardware, can be expensive, risk of data corruption if mismanaged.
What are the pros and cons of ID-I/O?
Pros:
Simpler hardware, lower cost, good for small, frequent data transfers.
Cons:
Increases CPU overhead, inefficient for large data volumes, can create bottlenecks with frequent interrupts.
Explain the various aspects of Programmed I/O and provide an example scenario.
How it works
- CPU constantly checks if device is ready.
CPU Involvement
- High - CPU does all the work.
Efficiency
- Least efficient - wastes CPU time.
Ideal use Case
- Simple devices like keyboards.
Speed
- Slow - CPU constantly checks.
Example Scenario
- Reading keystrokes from a keyboard.
Explain the various aspects of Interrupt-Driven I/O and provide an example scenario.
How it works
- Device interrupts CPU when ready.
CPU Involvement
- Moderate - CPU waits for the device to interrupt.
Efficiency
- More efficient - CPU can work on other tasks.
Ideal use Case
- Moderate-speed devices like printers.
Speed
- Faster than programmed I/O
Example Scenario
- Sending data to a printer while the CPU does other tasks.
Explain the various aspects of DMA and provide an example scenario.
How it works
- DMA controller handles data transfer without CPU.
CPU Involvement
- Low - CPU is free; DMA does the transfer.
Efficiency
- Most efficient - CPU is mostly free.
Ideal use Case
- High-Speed transfers like hard disk to memory.
Speed
- Fastest - DMA matches device speed.
Example Scenario
- Transferring large files from disk to memory.