IO software level
I/O device
Mechanical components
Classification
device controller
register addressing
IO control method
direct program control
interrupt driven
DMA mode
Channel control method
interrupt handler
device driver
Device Independent Software
I/O scheduling
equipment protection
Equipment Distribution and Recycling
Static allocation and dynamic allocation
data structure
Device Assignment Steps
Improve
buffer management
Buffer composition
- Hardware registers
are expensive, and the general user team requires high speed, such as fast tables for memory management and data buffers for device controllers - RAM
for most scenarios
buffer role
- Alleviate speed mismatch between cpu and IO devices
- Reduce the interrupt frequency of the cpu
If a little data is reached, a little data is sent, then the interrupt of the cpu will become very frequent - Solve the problem of data granularity mismatch
Solve the problem of data exchange unit size mismatch between producers and consumers - Improve parallelism of cpu and IO devices
single buffer
double buffering
circular buffer
buffer pool
user-level software
system call
network device interface
Spooling
offline technology
- Offline I/O method
In order to alleviate the contradiction between the speed mismatch between the host cpu and the IO device, the offline IO technology has emerged
- Under the control of the peripheral machine, the data is input to the disk through the input device; when the CPU needs it, the data is directly transferred from the disk to the memory
- Conversely, when the processor outputs data, it first outputs the data to the disk; then, under the control of another peripheral machine, the data is output through the output device.
Spooling technology
- Spooling technology
In a multi-channel system, a program can be used to simulate the peripheral machine, so that the previous off-line input and output functions can be realized under the direct control of the host computer, and the peripheral operation and CPU data processing can be carried out simultaneously. This technology has becomeSpooling technology (Spooling technology)
application