1. The concept and classification of I/O devices
Basic knowledge
mind Mapping
What is an I/O device?
classification
![
I/O controller
mind Mapping
I/O controller function
The composition of the I/O controller
Memory mapped I/O vs independent register addressing
I/O control method
1. Direct program control method
In order to solve the shortcomings in the above methods, an interrupt-driven method was created
2. Interrupt drive mode
Compared with direct program control, the differences are:
1. After the CPU sends a read/write command, the process waiting for I/O can be blocked and switched to another process for execution.
2. After the I/O is completed, the controller will The CPU sends out an interrupt signal. After the CPU detects the interrupt signal, it saves the operating environment information of the current process and then executes the interrupt handler to handle the interrupt.
3. The CPU reads a word of data from the I/O controller and transfers it to the CPU register, and then writes it to the main memory.
Problem: It is necessary to save and restore the operating environment of the process during interrupt processing. This process requires a certain amount of time and overhead. It can be seen that if the frequency of interrupts is too high, system performance will also be reduced; each word transfer between the I/O device and the memory needs to pass through the CPU. To this end, the DMA method is proposed.
3. DMA mode (direct memory access)
1. The operation from the CPU to the I/O is completed by the DMA controller, and the data transmission is not processed by the CPU. The CPU only needs to intervene at the beginning and end of transmitting one or more data blocks.
2. Different from the interrupt-driven mode, one more DMA controller is added for data transmission.
3. DMA controller:
1. It can be seen from the DMA control diagram that the data transfer from memory to I/O devices can be completed through DMA, which does not require CPU intervention, which greatly improves the parallel efficiency between CPU and I/O devices
2. The CPU is only responsible for issuing requests to I/O devices and receiving interrupts when the data transmission is complete
4. Channel control method
The channel control method is different from the DMA method: when the CPU requests an I/O device, it will first add a task to the task list in the memory, and then the channel checks the task list in the memory. If there is a task, the channel is responsible for communicating with the I/O device. data transmission. Therefore, a set of data blocks can be read and written each time.