Operating Systems Level 11
PART 3 • MEMORY & STORAGE

Coordinate Devices without Making the CPU Wait

Follow an application request through drivers and controllers, compare programmed, interrupt-driven and DMA transfer, then schedule storage requests explicitly.

Level 11 of 15 Intermediate 110–140 minutes Disk scheduling lab
BY THE END, YOU CAN

Reason about data movement

  • Explain the I/O software stack.
  • Compare polling, interrupts and DMA.
  • Trace buffering and caching.
  • Run FCFS, SSTF, SCAN and C-SCAN.
  • Compare foundational RAID levels.
01 • CROSS THE DEVICE BOUNDARY

Drivers Convert Generic Requests into Device Commands

1

Application/API

A process calls read, write or an asynchronous interface without knowing controller registers.

2

Device-independent I/O

The kernel checks permissions, names devices, buffers data and applies common error handling.

3

Driver

Device-specific software builds commands, manages queues and interprets completion status.

4

Controller and device

Hardware moves bits and reports completion or error through status registers and interrupts.

Spooling queues complete jobs for a serially shared device such as a printer. Buffering absorbs speed mismatch during transfer. Caching retains reusable data to avoid repeated slow access. The concepts overlap but answer different problems.

02 • CHOOSE HOW THE CPU PARTICIPATES

Polling, Interrupts and DMA Trade Simplicity for Parallelism

PROGRAMMED I/O

CPU polls and copies

Simple but repeated status checks waste CPU time when devices are slow.

INTERRUPT-DRIVEN

Device announces readiness

The CPU does other work, then saves state and runs a handler on completion.

DMA

Controller transfers blocks

The CPU programs source, destination and length; DMA moves bulk data and interrupts after completion.

03 • INTERACTIVE DISK-SCHEDULING LAB

Measure Head Movement on One Request Queue

For teaching, seek cost is approximated by absolute cylinder movement. SSDs do not have a mechanical head, so these classical policies mainly explain HDD scheduling foundations.

READY

Run one policy

The service path and total movement will appear here.

Policy Rule Benefit Risk
FCFS Arrival order Fair and simple Large movement
SSTF Nearest request Lower local seek Far requests may starve
SCAN Sweep then reverse Bounded directional service Middle can wait less than edges
C-SCAN Serve one direction More uniform waiting Return movement overhead
04 • COMBINE DISKS FOR PERFORMANCE OR REDUNDANCY

RAID Level Numbers Describe Different Layouts

RAID 0

Striping

High parallel throughput and full capacity, but one disk failure loses the array. It is not redundancy.

RAID 1

Mirroring

Duplicate copies improve read options and tolerate a mirror member failure at roughly half raw capacity.

RAID 5/6

Distributed parity

Capacity-efficient failure tolerance, but small writes need parity work and rebuild risk must be managed.

RAID is not a backup: it does not protect against accidental deletion, corruption replicated across members, theft or site loss. Backups need separate versions and tested restoration.

05 • PROGRAM TRACING

Trace One DMA Read

DMA PATH ·

06 • CHECK YOUR UNDERSTANDING

Ten Concept Checks

Answered correctly: 0 of 10
07 • EXAM & INTERVIEW PREPARATION

Explain Both Software and Hardware Roles

2-MARK
  1. What is a driver?
  2. Define DMA.
  3. Buffer versus cache?
  4. What is spooling?
  5. RAID 0 versus 1?
5-MARK
  1. Trace an I/O request.
  2. Compare transfer modes.
  3. Run SSTF and SCAN.
  4. Compare RAID levels.
  5. Explain interrupt handling.
INTERVIEW
  1. Why are interrupts expensive?
  2. Can SSTF starve?
  3. Why is RAID not backup?
  4. What changes for SSDs?
  5. What is memory-mapped I/O?
LEVEL 11 SUMMARY

You Can Trace a Request from Process to Device

  • Drivers translate generic operations into controller commands.
  • Interrupts avoid continuous polling.
  • DMA moves bulk data with limited CPU involvement.
  • Disk scheduling trades seek cost, fairness and starvation.
  • RAID improves selected availability/performance goals but is not backup.
COURSE CHECKPOINT

Mark complete after calculating one full disk schedule.

Saved only in this browser.