当前位置:网站首页>Input / output system
Input / output system
2022-04-23 08:22:00 【Long water day】
Catalog
1. Basic concepts
I/O System
Input / The output is host centric , Transferring information from an external device to a host is called input , The opposite is called output . Input / The main problem solved by the input system is to control the input and output of various forms of information .
I/O Several basic concepts in the system are as follows :
- Peripheral : Including the input / Output device and through input / An external storage device that can only be accessed by the output interface .
- Interface : A logical unit that performs various coordinated work when transmitting data between each peripheral and the host . Coordination includes speed matching during transmission 、 Level and format conversion, etc .
- input device : Used to enter commands and text into a computer system 、 Data and other information components .
- Output devices : It is used to output the information in the computer system to the external display of the computer 、 Exchange parts, etc .
- External storage device : Except for computer memory and CPU Memory other than cache . Hard disk 、 CD is the most basic external storage device .
Generally speaking ,I/O System consists of I/O Software and I/O The hardware consists of two parts :
- I/O Software : Including drivers 、 User programs 、 Management procedure 、 Upgrade patches, etc . Usually used I/O Instruction and channel instruction implementation CPU And I/O Information exchange of equipment .
- I/O Hardware : Including external equipment 、 Equipment controller and interface 、I/O Bus etc. . Control by device controller I/O Specific actions of the equipment , adopt I/O Interface with host ( Bus ) Connected to a .
The control mode
In the input / In the output system , A large amount of data transmission is often required , In the process of transmission, there are various I/O The control mode , The basic control methods mainly include the following 4 Kind of :
- Program query method : from CPU Continuously query through the program I/O Whether the equipment is ready , To control I/O The device exchanges information with the host .
- Program interrupt mode : Only in I/O The equipment is ready and sent to CPU Respond only when an interrupt request is made .
- DMA The way : Main memory and I/O There is a direct data path between the devices , When main memory and I/O When the device exchanges information , There is no need to call the interrupt service program .
- Way of access : A channel control part is set in the system , Each channel is connected with several peripherals , The host is executing I/O On command , Just start the relevant channel , The channel will execute the channel program , To complete the I/O operation .
One way is 1 and 2 It is mainly used for external equipment with low data transmission rate , Method 3 and 4 It is mainly used for equipment with high data transmission rate .
2. Peripheral
External devices are also called peripherals , It is a device other than the host that can exchange information with the computer directly or indirectly . The input device has a keyboard 、 Mouse, etc. , The output device has a display 、 Printers, etc .
3.I/O Interface
I/O Interface (I/O controller ) It is the interface between the host and peripherals , Through the interface, the information exchange between the host and peripherals can be realized . The host and peripherals have their own working characteristics , They have great differences in information form and working speed , The interface is set up to solve these differences .
I/O Function of interface
I/O The main functions of the interface are as follows :
- Realize the communication control between the host and peripherals . Solve the timing matching problem between the host and peripherals , Coordinate the exchange of information between peripherals and hosts at different working speeds , To ensure that the whole computer system can be unified 、 Work in coordination .
- Address decoding and device selection .CPU After sending the address code of the selected peripheral , The interface must decode the address to generate device selection information , Enables the host to exchange information with designated peripherals .
- Realize data buffering .CPU And the speed between peripherals often does not match , To eliminate speed differences , The interface must set the data buffer register , Used for temporary storage of data , To avoid data loss due to inconsistent speeds .
- Conversion of signal format . The level of both peripheral and host 、 There may be differences in data formats , The interface shall provide the conversion function of signal format between computer and peripheral equipment , Such as level conversion 、 and / String or string / And convert 、 Count / Modulo conversion or modulo conversion / Number conversion, etc .
- Transmit control commands and status information .CPU To start a peripheral , Send the start command through the command register in the interface ; When the peripherals are ready , Then the status information is sent back to the status register in the interface , And feedback to CPU.
I/O The basic structure of the interface
Structure diagram is as follows :
- I/O The interface passes through the host side I/O Bus and memory 、CPU Connected to a . Via data bus , In the data buffer register with memory or CPU Data transfer between registers . At the same time, the status information of the interface and equipment is recorded in the status register , Send information to the status line CPU.CPU Control commands to peripherals are also transmitted through data lines , Usually send it to I/O Interface control register . The status register and the control register are opposite in the transfer direction .
- The address line in the interface is used to give the address to be accessed I/O The address of the register in the interface , It and reading / The write control signal is sent to I/O Control logic unit of interface , The address information is used to select the register to exchange information with the host , A read transmitted through a control line / The write signal confirms whether to read the register or write the register , In addition, the control line will also transmit some arbitration signals and handshake signals .
- Interface I/O The control logic should also be able to decode the command word in the control register , And send the decoded control signal to the peripheral through the peripheral interface control logic , At the same time, send the data of the data buffer register to the peripheral or receive the data from the peripheral to the data buffer register . in addition , It also has the function of collecting peripheral status to status register .
- Data buffer register 、 state / The access operation of control register is completed through corresponding instructions , Such instructions are commonly referred to as I/O Instructions ,I/O Instructions can only be used at the bottom of the operating system kernel I/O Use... In software , Is a privileged instruction .
- It should be noted that , Interface and port are two different concepts . Port refers to the interface circuit that can be read / Write register , Several ports and corresponding control logic can form an interface .
I/O Type of interface
- According to the way of data transmission , It can be divided into parallel interfaces ( All bits of a byte or word are transmitted simultaneously ) And serial interface ( Send... One by one ), The interface shall complete the conversion of data format .
( The data transmission mode mentioned here refers to the transmission mode on the side of peripherals and interfaces , The interface is on the side of the host , Data is always transmitted in parallel .) - Access by host I/O The control mode of equipment can be divided into program query interface 、 Interrupt interface and DMA Interfaces, etc. .
- According to the flexibility of function selection, it can be divided into programmable interface and non programmable interface .
I/O Port and its addressing
I/O A port is a port that can be used in an interface circuit CPU Direct access registers , There are mainly data ports 、 Status port and control port , Several ports and corresponding control logic circuits form the interface . Usually ,CPU Can read and write to the data port , However, only read operations can be performed on the status port , Only write operations can be performed on the control port .
I/O If the port wants to be able to be CPU visit , Each port must be numbered , Each port corresponds to a port address . And yes I/O There are two addressing modes of ports: unified addressing with memory and independent addressing .
- Unified addressing, also known as memory mapping , It means that I/O The port is used as a unit of memory for address allocation , This way, CPU There is no need to set up a special I/O Instructions , With a unified memory access instruction, you can access I/O port .
- Independent addressing is also known as I/O How to map ,I/O Port address space and main memory address space are two independent address spaces , Therefore, it is impossible to distinguish from the form of address code , Need to set up a special I/O Command to access I/O port .
4.I/O The way
common I/O The way is program query 、 Program interrupt 、DMA etc. .
Program query method
The control of information exchange is completely realized by the host execution program , Set a data buffer register in the program query mode interface ( Data port ) And a device status register ( Status port ). The main engine is running I/O In operation , Send a signal first , Read the status of the device and decide whether to transfer data or wait according to the next operation of the device .
Program interrupt mode
Program interruption refers to the process of executing the current program by the computer , There are some exceptions or special requests that need to be handled urgently ,CPU Suspend the current procedure , And turn to deal with these exceptions or special requests , After processing CPU It automatically returns to the breakpoint of the current program , Continue with the original procedure .
DMA The way
DMA Mode is a control mode of group information transmission completely by hardware , It has the advantage of program interrupt mode , That is, in the data preparation stage ,CPU Work in parallel with peripherals .DMA Way to open a path between peripherals and memory “ Direct data channel ”, Information is no longer transmitted CPU, To reduce the CPU The cost of transmitting data , Therefore, it is called direct memory access mode . Because data transmission does not go through CPU, There is no need to protect 、 recovery CPU Site and other cumbersome operations .
版权声明
本文为[Long water day]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230705076485.html
边栏推荐
- 关于ORB——SLAM运行中关键帧位置越来越近的异常说明
- MySQL数据库中delete、truncate、drop原理详解
- QFileDialog 选择多个文件或文件夹
- Rotation function of leetcode medium problem
- 2022.4.11-4.17 AI industry weekly (issue 93): the dilemma of AI industry
- Common regular expressions
- 作文以记之 ~ 二叉树的前序遍历
- Search the complete navigation program source code
- 记录:js删除数组中某一项或几项的几种方法
- ASAN 极简原理
猜你喜欢
idea:使用easyYapi插件导出yapi接口
AAAI 2022 recruit speakers!!
Using qlst excel file
【解释】get ORA-12838: cannot read/modify an object after modifying it in parallel
浅谈ES6尾调优化
谈谈那些基础但不简单的股票数据
synchronized 实现原理
mysql查询字符串类型的字段使用数字类型查询时问题
分布式消息中间件框架选型-数字化架构设计(7)
Description of the abnormity that the key frame is getting closer and closer in the operation of orb slam
随机推荐
dmp引擎工作总结(2021,光剑)
[appium] encountered the problem of switching the H5 page embedded in the mobile phone during the test
剑指offer day24 数学(中等)
pdf加水印
DOM 学习之—添加+-按钮
sql 使用过的查询语句
Notes on English class (4)
ansible自動化運維詳解(一)ansible的安裝部署、參數使用、清單管理、配置文件參數及用戶級ansible操作環境構建
[explanation] get ora-12838: cannot read / modify an object after modifying it in parallel
5.6 comprehensive case - RTU-
一款拥有漂亮外表的Typecho简洁主题_Scarfskin 源码下载
记录:js删除数组中某一项或几项的几种方法
ansible自动化运维详解(一)ansible的安装部署、参数使用、清单管理、配置文件参数及用户级ansible操作环境构建
作文以记之 ~ 二叉树的后序遍历
How to encrypt devices under the interconnection of all things
室内定位技术对比
QFileDialog 选择多个文件或文件夹
使用JWT生成与解析Token
对OutputStream类的flush()方法的误解
redis主从服务器问题