I/O management-I/O core Subsystem
I,I/OScheduling Concept
Operating system developers schedule requests by maintaining a request queue for each device. When an application runs a blocking I/O system call, the request is added to the queue of the corresponding device.
Ii. High-speed cache and buffer zone
1. High-speed cache
High-speed cache is a high-speed memory that can retain data copies.
It is mainly used to speed up access! Example: The speed difference between the first and second start of Chrome browser!
2. Buffer Zone
A buffer is the memory area used to store data between two devices or between devices and applications. Buffer technology can be divided:
Single Buffer: Only one buffer zone is set between the device and the processor, which is shared by the input device and the output device.
Dual-buffer: two buffers are allocated for the input and output devices.
Loop buffer: Multiple buffers are set for the I/O device. One is used for input, and the other is used for output.
Buffer Pool: merges multiple buffers to form a public buffer pool for unified management. The buffer pool can be shared by multiple processes.
[In short: matching between high-speed and low-speed devices]
Iii. device allocation and recovery
1. Overview of device allocation
The task assigned by the device is to request the device's process allocation according to a certain policy.Suitable devices and related hardware. There are three types of devices: exclusive device, shared device, and virtual device.
2. Data Structure for device allocation
Device allocation and management are carried out through the data structure, which describes the system configuration, the status characteristics and current usage of I/O devices. As shown in. The dotted line indicates that the device exists.
Data Structure allocated by devices
Important data structures include:
(1) system device table SDT: A system device table of the entire system [in the operating system ].
(2) device control table DCT: The system configures a DCT [inside the Operating System] for each physical device ].
(3) controller control table coct: The system sets a coct for each controller.
(4) channel control table chct: exists only in the system of channel control mode. Each channel has one.
3. device Allocation Policy
(1) Principle of device allocation: the general principle of device allocation must give full play to the efficiency of equipment use. And avoid process deadlocks.
(2) device allocation method: static allocation is mainly used to allocate dedicated devices, before a user's job starts running, the system allocates all the devices, controllers, and channels required by the job once until the job is revoked. Dynamic Allocation is performed as needed during the process. When a process requires a device, it sends a request to the system. The system allocates the required device, Controller, and channel to the process according to the preset policies, release immediately after use.
(3) device allocation policies: common dynamic device allocation policies include first request first allocation (FIFO) and first allocation with a higher priority.
Iv. Counterfeit offline Technology(Spooling)[Convert an exclusive device to a shared device]
Spooling technology, also known as the off-line technology, refers to the multi-channel program environment, one or two programs in multiple programs are used to simulate the function of the Peripheral Controller in offline input and output to achieve the "offline" input and output.
Composition of the spooling System
(1) Input well and output well: these are two large storage spaces opened up on the disk.
(2) input buffer and output buffer: these are two buffers opened in the memory.
(3) input process SP1 and output process sp0: these are two processes in the memory.
Computer Operating System Study note _ 13_ I/o management-I/O core Subsystem