13 Io-Systems Printable
13 Io-Systems Printable
Amir H. Payberah
[email protected]
2022
Overview
1 / 36
I/O Hardware
2 / 36
I/O Hardware
I We only need to understand how the devices are attached and how the
software can control the hardware.
3 / 36
Common Concepts in I/O Hardware
I Bus: set of wires and protocols that specify the messages that can be
sent on the wires.
4 / 36
Port
5 / 36
Bus
6 / 36
Host-Device Interaction
7 / 36
Host-Device Interaction
I Polling
I Interrupt
8 / 36
Polling (1/2)
9 / 36
Polling (2/2)
10 / 36
Interrupts (1/3)
11 / 36
Interrupts (2/3)
12 / 36
Interrupts (3/3)
13 / 36
Direct Memory Access (DMA)
14 / 36
Application I/O Interface
15 / 36
Application I/O Interface
I Each OS has its own I/O subsystem structures and device driver frame-
works.
16 / 36
A Kernel I/O Structure
17 / 36
Characteristics of I/O Devices (1/2)
18 / 36
Characteristics of I/O Devices (2/2)
19 / 36
Character Devices
20 / 36
Block Devices
21 / 36
Network Devices
22 / 36
Clocks and Timers
I Programmable interval timer, the hardware used for timings, and periodic
interrupts.
23 / 36
Blocking, Nonblocking and Asynchronous I/O
24 / 36
Synchronous vs. Asynchronous I/O Methods
Synchronous Asynchronous
25 / 36
Kernel I/O Subsystem
26 / 36
Kernel I/O Subsystem
27 / 36
Scheduling (1/2)
28 / 36
Scheduling (2/2)
I In asynchronous I/O the kernel must be able to keep track of many I/O
requests at the same time.
• The OS attaches the wait queue to a device-status table.
• The table contains an entry for each I/O device.
• If the device is busy with a request, the type of request and other
parameters will be stored in the table entry for that device.
29 / 36
Buffering and Caching
30 / 36
Spooling and Device Reservation
31 / 36
Error Handling
I OS can recover from disk read, device unavailable, and transient write
failures.
• Retry a read or write.
• Track error frequencies, stop using device with increasing frequency of
retry-able errors.
32 / 36
I/O Protection
33 / 36
Summary
34 / 36
Summary
35 / 36
Questions?
Acknowledgements
Some slides were derived from Avi Silberschatz slides.
36 / 36