Principles of I/O Hardware I/O Devices Block devices, Character devices, Others Speed Device Controllers Separation of electronic from mechanical components Memory-Mapped I/O Direct Memory Access Interrupts Revisited
Hardware Mode 0 PC 2000 Int Code xxxx CPU PSW Mode 1 PC 200 Int Code Mode 0 PC 2000 Int Code xxxx NEW PSW OLD PSW 200 IH Process Instr 2000 Kernel Interrupt
Principles of I/O Software Goals of the I/O Software Device independence Uniform naming Error handling Synchronous vs. asynchronous transfers Buffering Sharable vs. dedicated devices Programmed I/O Interrupt-Driven I/O I/O using DMA
I/O Software Layers Interrupt Handlers Device Drivers Device-Independent I/O Software User-Space I/O Software Hardware Interrupt Handlers Device Drivers Device Independent I/O Software User-space I/O Software
User-Space I/O Software Libraries Spooling
Device-Independent I/O Software Uniform Interfacing for device drivers Buffering Error Reporting Allocating and Releasing Dedicated Devices Device-Independent Block Size
Disks Disk Hardware Disk Formatting Disk Arm Scheduling First-Come, First-Served Shortest Seek First Elevator Algorithm Scan
Disks Error Handling Controller Operating System List of bad sectors Stable Storage Stable writes Stable reads Crash recovery