[Operating system] 04. Device management

IO software level

image.png

image.png

I/O device

image.png
image.png

Mechanical components

image.png
image.png

image.png

Classification

image.png

image.png

image.png

device controller

image.png

image.png

image.png

image.png

image.png

register addressing
image.png

IO control method

image.png

direct program control

image.png

image.png

image.png

interrupt driven

image.png

image.png

DMA mode

image.png

image.png
image.png

Channel control method

image.png

image.png

interrupt handler

image.png

device driver

image.png

Device Independent Software

image.png
image.png
image.png
image.png
image.png
image.png

I/O scheduling

image.png

equipment protection

image.png

Equipment Distribution and Recycling

image.png

image.png

image.png

Static allocation and dynamic allocation

image.png

data structure

image.png
image.png
image.png
image.png
image.png

Device Assignment Steps

image.png

Improve
image.png

buffer management

image.png

image.png
Buffer composition

  1. 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
  2. RAM
    for most scenarios

buffer role

image.png

  • 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

image.png
image.png

double buffering

image.png
image.png

image.png

image.png

circular buffer

image.png

buffer pool

image.png

user-level software

image.png

image.png

system call

image.png

image.png

image.png

network device interface
image.png

Spooling

image.png

offline technology

image.png

  • Offline I/O method

image.png

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)
image.png

application

image.png
image.png
image.png

disk

image.png

disk structure

image.png

image.png

image.png

read and write data

image.png

Disk Scheduling Algorithm

image.png

image.png

first come first serve

image.png

The shortest search time is limited

image.png

scan algorithm

image.png

Look Algorithm

image.png

cycle scan algorithm

image.png

C-look algorithm

image.png

Reduce disk latency

image.png

SSD

image.png

image.png

image.png

Guess you like

Origin blog.csdn.net/weixin_50799082/article/details/130950417