<aside>
💡
Summary of Section 11.1 - The Hardware-Software Interface (C191: Operating Systems for Programmers | zyBooks)
</aside>
1. The I/O Hierarchy
A general-purpose computer system includes I/O devices for interaction, storage, and networking. Devices are connected via device controllers, which are electronic circuits operating specific I/O devices using binary signals. These controllers interact with the device driver, a software component implementing I/O operations requested by applications or the OS.
- Device controllers have hardware registers and flags accessible by drivers.
- Device drivers enable OS interaction with devices, abstracting differences in speed, latency, and data format.
- Generic API instructions allow integration of new devices without OS modification. Common categories:
- Block-oriented devices (e.g., disks, CDs, flash storage)
- Character-oriented devices (e.g., keyboards, printers, cameras)
- Network devices (e.g., modems, Ethernet adapters)
Example: A disk driver processes read/write requests, translating high-level instructions into device-specific operations.
2. Programmed I/O with Polling
I/O operations are managed via hardware registers:
- Opcode Register: Specifies requested operation (read/write).
- Operand Registers: Holds operation parameters.
- Busy Flag: Indicates if the device is in use.
- Status Register: Reports success or failure.
- Data Buffer: Stores data for transfer.
With programmed I/O, the CPU manually transfers data between the I/O device and main memory. Polling involves repeatedly checking the busy flag to determine when an operation completes.
Steps in Programmed I/O with Polling
- The CPU writes an opcode to the device controller.
- It repeatedly reads the busy flag until the operation is complete.
- If successful, the CPU copies data from the buffer to memory.