Module 10 - IO Systems
Module 10 - IO Systems
26/12/2021
College of Computing and Informatics
OPERATING SYSTEMS
Operating Systems
Module 10
I/O Hardware
Synchronous Asynchronous
VECTORED I/O
Vectored I/O allows one system call to perform multiple I/O operations
For example, Unix readve() accepts a vector of multiple buffers to read into or
write from
This scatter-gather method better than multiple individual I/O calls
Decreases context switching and system call overhead
Some versions provide atomicity
Avoid for example worry about multiple threads changing data as reads / writes
occurring
KERNEL I/O SUBSYSTEM
Scheduling
Some I/O request ordering via per-device queue
Some OSs try fairness
Some implement Quality Of Service (i.e. IPQOS)
Buffering - store data in memory while transferring between devices
To cope with device speed mismatch
To cope with device transfer size mismatch
To maintain “copy semantics”
Double buffering – two copies of the data
Kernel and user
Varying sizes
Full / being processed and not-full / being used
Copy-on-write can be used for efficiency in some cases
DEVICE STATUS TABLE
I/O DEVICE AND INTERFACE SPEEDS
KERNEL I/O SUBSYSTEM
Caching - faster device holding copy of data
Always just a copy
Key to performance
Sometimes combined with buffering
Spooling - hold output for a device
If device can serve only one request at a time
i.e., Printing
Device reservation - provides exclusive access to a device
System calls for allocation and de-allocation
Watch out for deadlock
ERROR HANDLING
OS can recover from disk read, device unavailable, transient write failures
Retry a read or write, for example
Some systems more advanced – Solaris FMA, AIX
Track error frequencies, stop using device with increasing frequency of retry-able
errors
Most return an error number or code when I/O request fails
System error logs hold problem reports
I/O PROTECTION
User process may accidentally or purposefully attempt to disrupt normal
operation via illegal I/O instructions
All I/O instructions defined to be privileged
I/O must be performed via system calls
Memory-mapped and I/O port memory locations must be protected too
SYSTEM CALL
POWER MANAGEMENT
Not strictly domain of I/O, but much is I/O related
Computers and devices use electricity, generate heat, frequently require cooling
OSes can help manage and improve use
Cloud computing environments move virtual machines between servers
Can end up evacuating whole systems and shutting them down
Mobile computing has power management as first class OS aspect
TRANSFORMING I/O REQUESTS TO HARDWARE
OPERATIONS
Consider reading a file from disk for a process:
Determine device holding file
Translate name to device representation
Physically read data from disk into buffer
Make data available to requesting process
Return control to process
LIFE CYCLE OF AN I/O REQUEST
Main Reference
Chapter 12: I/O Systems
(Operating System Concepts by Silberschatz, Abraham, et
al. 10th ed., ISBN: 978-1-119-32091-3, 2018)
Additional References
Chapter 5.1
Chapter 5.2
Chapter 5.3
(Modern Operating Systems by Andrew S. Tanenbaum and Herbert Bos. 4th
ed., ISBN-10: 0-13-359162-X, ISBN-13: 978-0-13-359162-0, 2015)
sentation is mainly dependent on the textbook: Operating System Concepts by Silberschatz, Abrah
Thank You