I/O Systems
I/O device control has always been problem for OS designers because of the many different types of devices(mouse, disk, monitor, etc)
Kernel I/O Subsystem
two trends:
- standardization of s/w & h/w interfaces
- broad variety of devices
Basic concepts
- port -- connection point for device signals
- bus -- common set of wires with specific message protocols
- daisy chain
- controller -- electronics that operate ports, busses, devices
- host adapter -- complicated controller
- expansion bus -- slow devices
Processor to controller communications (I/O Port)
- typical registers
- status
- control (or command)
- data-in
- data-out
- I/O instructions or memory mapped I/O?
- polling vs interupt
- sense device busy bit
- when clear, for write op, set write bit and put info byte in data-out
- set command ready bit
- controller sets busy bit, reads data-out byte, puts in on device
- controller clears command ready bit, error bit, busy bit
interupt is similiar, but processor senses "interupt request line"
- maskable vs non-maskable lines
priority interupts
system calls and corresponding "software interupts" or traps
- DMA (Direct Memory Access) -- controller seizes memory bus which may slow CPU
Transparent I/O ops for applications
- Device drivers in a layered system
|----------------|
| Application |
|----------------|
| Kernel |
|----------------|
| Kernel I/O sub |
|----------------|
| Device Driver |
|----------------|
| Controller |
|----------------|
| Device |
|----------------|
- Issues
- char or block
- sequential or random access
- synch or asynch
- fast or slow
- sharable or dedicated
- read or write or both
- blocking or non-block
- Performance
- scheduling
- buffering - speed mismatch, size mismatch, copy semantics
- caching vs buffering
- spooling
- Main Performance Issues
- reduce context switches
- reduce copying
- reduce interupts (large blocks, polling)
- increase concurrancy (DMA, I/O primatives to h/w)
- balance overall performance
Copyright ©2017, G. Hill Price
Send comments to G. Hill Price