I. IO system architecture
In a computer system, the CPU interacts with many peripherals. such as mouse, keyboard, network card and so on.
1. How does io coordinate the work?
(1) For the equipment, it has two parts, part is the mechanical part, the other part is the electronic control part.
and the electronic control part is through the various registers and the CPU carries on the communication, is controlled by the CPU.
such as control registers, data registers, status registers. They are connected to the control bus, data bus, and state bus respectively.
(2) Management of IO devices by operating system
Mainly divided into three parts: logic io, device driver, interrupt service Program
Device drivers: Complete a variety of controls on different devices, providing interfaces to the application layer.
Interrupt Service Program: When the device ends, the interrupt signal is signaled to the CPU.
2, the classification of equipment--by the data organization
2.1 Pieces of equipment: a unit of data block as the transport storage
2.2-character Device: stores transmission information in characters.
3. The goals and tasks of IO Management (why device Management)
(1) According to the user's request, control the various operation of the equipment. Completes the IO device and memory data exchange, finally completes the IO request.
Device Allocation and recycling: View the status of the device, invoke the relevant allocation policy, and make the allocation of the device.
Execute device driver: The user completes the control of the device through the device driver.
Set Interrupt handling: Interrupts the CPU when the device is complete.
(2) to establish a convenient and unified device-independent interface
Convenience: The user provides a convenient interface, so that the control of external devices without regard to complex physical characteristics.
(3) Make full use of various technologies (channel, interrupt, buffer, etc.) to improve the parallel working ability between CPU and equipment, equipment and equipment.
4. IO control mode
(1) Polling method: Constantly view the status information of the IO device, and then respond.
(2) Interrupt mode: Interrupts the CPU when the device completes operation.
(3) DMA: No direct data exchange via CPU, memory and IO devices.
5. Design of IO Software
Layered design ideas.
The bottom layer is the control and operation of the hardware. The upper level is the logical operation.
(1) User-level IO software: The user performs input and output system calls to format IO data.
(2) device-independent software layer
(3) Device driver layer
(4) Interrupt processing layer: When the IO operation is complete, the device driver process is awakened and the interrupt processing is performed.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Operating System--io Management