Module 12 - I/O systems. The role of the operating system in computer I/O is to manage and control I/O operations and I/O devices. Although related topics appear in other chapters, here we bring together the pieces to paint a complete picture. In this chapter we describe I/O Structure, Devices, Device Drivers, Caching, and Terminal I/O. | Lecture Operating system concepts Fifth edition Module 12 - Avi Silberschatz Peter Galvin Module 12 I O Systems I O hardwared Application I O Interface Kernel I O Subsystem Transforming I O Requests to Hardware Operations Performance Silberschatz and Galvin 1999 I O Hardware Incredible variety of I O devices Common concepts Port Bus daisy chain or shared direct access Controller host adapter I O instructions control devices Devices have addresses used by Direct I O instructions Memory-mapped I O Silberschatz and Galvin 1999 Polling Determines state of device command-ready busy error Busy-wait cycle to wait for I O from device Silberschatz and Galvin 1999 Interrupts CPU Interrupt request line triggered by I O device Interrupt handler receives interrupts Maskable to ignore or delay some interrupts Interrupt vector to dispatch interrupt to correct handler Based on priority Some unmaskable Interrupt mechanism also used for exceptions Silberschatz and Galvin 1999 Interrupt-drive I O Cycle Silberschatz and Galvin 1999 Direct Memory Access Used to avoid programmed I O for large data movement Requires DMA controller Bypasses CPU to transfer data directly between I O device and memory Silberschatz and Galvin 1999 Six step process to perform DMA transfer Silberschatz and Galvin 1999 Application I O Interface I O system calls encapsulate device behaviors in generic classes Device-driver layer hides differences among I O controllers from kernel Devices vary in many dimensions Character-stream or block Sequential or random-access Sharable or dedicated Speed of operation read-write read only or write only Silberschatz and Galvin 1999 Block and Character Devices Block devices include disk drives Commands include read write seek Raw I O or file-system access Memory-mapped file access possible Character devices include keyboards mice serial ports Commands include get put Libraries layered on top allow line editing Silberschatz and .