当前位置:网站首页>Knowledge points and examples of [seven input / output systems]
Knowledge points and examples of [seven input / output systems]
2022-04-23 16:37:00 【Xipi yo】
One 、 Knowledge point
General overview
IO(Input/Output) equipment It is a device that inputs data into the computer or receives the output of the computer .
mouse 、 All keyboards belong to IO equipment , The interface of the computer to which they are connected is called IO Interface ( Also known as IO controller ).
IO In order to act as a bridge between equipment and computer , He needs multiple registers :
- Data register : Save the output of the device or the output of the computer .
- Control register : The computer needs to control the equipment to operate , The operation to be done exists here .
- Status register : After the operation of the equipment is completed , Need to tell the computer the current state .

The computer can tell the device what to do through the control register ; The device can reflect whether it is currently ready through the status register ; The computer determines whether to access data in the data register through the status register .
You will find that the control register in this process is only useful when the computer sends commands , When IO After the interface receives the command, the register is useless . So we can merge the status register with it , Save space and cost .
One IO Interfaces can correspond to multiple devices , Each device can have its own set of data 、 control 、 Status register , In this way, the computer can control different groups of registers , To control different devices .
These registers are... For computers IO port —— Data port 、 Status port 、 Control port .
So how does the computer interact with IO Interface connection ?
An obvious way : Pull a system bus out ,CPU、 Main memory 、IO The interfaces are connected to it .

A system bus contains data 、 Address 、 Control signal line ,cpu It can be controlled directly through the bus IO Interface , You can also make main memory and IO Transfer data between interfaces .
For example, you hit a letter on the keyboard ,CPU There are two ways to get data :
- Program query method :CPU Will constantly ask whether the status register input of the keyboard is completed , If completion is detected , Will get the data in the data register to the main memory .
- Program interrupt mode :CPU Don't ask ,IO The interface selects whether to send data to the server according to the status register CPU Send an interrupt signal ,CPU When you receive the signal, you will come and collect the data .
Program query mode will lead to cpu Can only wait for the keyboard to enter , You can't do anything else ; Program interrupt mode can allow CPU Do something else first , When the input is complete, come and get it to the main memory .
There is a special kind of IO Interface ——DMA Interface , It can be used DMA The bus is directly connected to the main memory , as long as CPU tell DMA The address where the interface wants to store the data in main memory ,DMA The interface will put the data into main memory according to the address .
about DMA Interface ,CPU You also need to tell it the main memory address , If there are more than one DMA Interface ,CPU Will still be very busy . In order to further liberate CPU, passageway Can replace CPU Do some basic operations .

It's like a low-level CPU, Have their own command system —— Channel command , Able to perform some limited operations . When it receives CPU Emitted IO Instructions after , It can be started as required IO equipment , Or execute channel instructions —— like CPU My little brother .
IO The instruction is logically divided into three fields :
- opcode : Can be used to distinguish from other instructions , Give Way CPU Know this is a IO Instructions .
- Command code : It represents the specific operation of the equipment .
- Equipment code : You can specify the operation of a device , Used to distinguish equipment .
Different equipment IO Instructions vary , Also set the mouse button 、 Light or sensitivity , Different brands have different IO Instructions . That's why when you plug in components such as mouse, keyboard and graphics card , If you want to use it better, you need to install the driver .
Every keystroke of the keyboard sends an interrupt signal to the computer , Generally, the computer will pause the work at hand , First process the input data of the keyboard , Then go back to your previous job .
This raises a lot of questions :
How did the computer receive the interrupt signal ?
There are many interrupt request flag registers inside the computer , When the device sends an interrupt signal, it will modify the data of these registers ,CPU You'll know which devices sent out .

Multiple devices send interrupt signals at the same time , Which... Should the computer handle ?
Hardware or software can be used to determine which interrupt signal needs to be processed first .
Hardware : Treat the interrupt signal of the equipment as an output 1, The equipment can be connected to the circuit in turn , The higher the priority, the higher the priority .

Software : You can write a series of instructions to form Inquiry procedure , Check each register one by one .

After the computer handles the interrupt , How to get back to your job ?
Before the computer handles the interrupt , Will the current PC Save the instruction address in , After the PC Change the value in to the interrupt program address —— This is done by Interrupt implicit instruction command . After processing , Then read the saved instruction address to PC Continue to work in .
If when processing an interrupt , What if you receive the interrupt signal again ?
- Ignore the signal : An... Can be added to the output circuit Interrupt masked word signal , When the shielded word output of the device is 1 when , Shield the interrupt signal of the equipment . If you don't want to receive the interrupt signal , Directly output the shielded words of each device 1—— This operation is called Close the interrupt .

Open another interrupt program : Like a doll , Once again, the current PC Modify the value after saving . You need to pay attention to the order —— We must turn off the interrupt before saving , Avoid interrupting the save action . Save successfully and then Open the interrupt , Receive interrupt message .
Next, let's introduce an important IO equipment —— Mechanical drive , Its working state is like this :

https://pic1.zhimg.com/v2-6792b6cc9c914d34df2001946d591428_b.webp
Data is stored on disk , Read with magnetic head / Write disk . It works by :
disk There is a layer of magnetic material on the surface , To be energized head After crossing a position on the disk , The magnetic pole in the random direction of this position will change in the same direction as the magnetic field generated by the electromagnetic head . When you need the head to read data , The magnetic head will cross an area , Magnetic poles in different directions in this area will produce induced currents in different directions , The magnetic head forms binary information through these weak induced currents .

Source network intrusion and deletion
So here comes the question , How does the magnetic head know which area it should delimit ?
First of all, we need to know what areas are divided into :
Rotate the disk at high speed , When the magnetic head is fixed , The magnetic head will draw a circle on the disk , This ring is Magnetic track , We change the track by moving the head .
Divide the disk into several pieces like cutting a cake Fan , There are multiple divided tracks in each sector , Each track is called A sector —— Each sector has different sizes , But the amount of data stored is the same .

Source network intrusion and deletion
Multiple disks overlap vertically , The same track forms a cylinder .

In order to make the disk rotate at high speed , And the position of the swing head , We need to disc drive Control disk and head .
Listen to the disk drive Disk controller Of , The disk controller receives instructions from the computer , Command the disk drive to work .
The instructions issued by the computer include but are not limited to the following fields :
- Drive letter : Select one from multiple devices .
- cylinder ( Magnetic track ) Number : Move the head to the corresponding track .
- Disk number : Select the corresponding disk surface , Activate the head of the disk .
- Fan area code : Rotating disk , So that the magnetic head crosses the corresponding disk surface .

common I/O The control mode :
1、 Program direct access and loop detection IO The way , Is the oldest way .CPU and IO Serial , Every byte read ( Or word ),CPU Need to constantly detect the status register busy sign , When busy=1 when , Express IO It's not finished yet ; When busy=0 when , Express IO complete . At this point, the process of reading a word is over , Then read the next word .
2、 Interrupt control mode : Cycle detection is more advanced ,IO Equipment and CPU Can work in parallel , Only at the beginning IO And the end IO when , That's what we need CPU. but Only one word can be read at a time .
3、DMA The way :Direct Memory Access, Direct memory access , What's more advanced than interrupt is that you can read one block at a time , Not a word .
4、 Way of access : Than DMA The advanced place is , Multiple blocks can be processed at a time , Not just a piece .
Spread the knowledge
1、IO Interface : towards CPU Provide I/O Equipment status information and command decoding . Provide buffer for transmitted data , To eliminate the computer and peripherals in “ timing ” Or the difference in data processing speed .
IO port : Refer to Interface Some in the circuit register , these register Used to store data and information respectively 、 Control information and status information .
2、

Two 、 Example
1、
answer :B

3、 ... and 、408 The real question of the unified examination
1、


Refer to
Notes on the principles of computer composition -IO Interface and equipment - You know
版权声明
本文为[Xipi yo]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231633584540.html
边栏推荐
- DanceNN:字节自研千亿级规模文件元数据存储系统概述
- RecyclerView advanced use - to realize drag and drop function of imitation Alipay menu edit page
- How to conduct application security test (AST)
- JSP learning 3
- Query the data from 2013 to 2021, and only query the data from 2020. The solution to this problem is carried out
- Research and Practice on business system migration of a government cloud project
- Install MySQL on MAC
- Execution plan calculation for different time types
- Detailed explanation of UWA pipeline function | visual configuration automatic test
- 如何建立 TikTok用户信任并拉动粉丝增长
猜你喜欢

力扣-198.打家劫舍

无线鹅颈麦主播麦手持麦无线麦克风方案应当如何选择

Query the data from 2013 to 2021, and only query the data from 2020. The solution to this problem is carried out

Government cloud migration practice: Beiming digital division used hypermotion cloud migration products to implement the cloud migration project for a government unit, and completed the migration of n

Take according to the actual situation, classify and summarize once every three levels, and see the figure to know the demand

各大框架都在使用的Unsafe类,到底有多神奇?

Day (5) of picking up matlab

1959年高考数学真题

Sort by character occurrence frequency 451

力扣-746.使用最小花费爬楼梯
随机推荐
How magical is the unsafe class used by all major frameworks?
NVIDIA显卡驱动报错
DanceNN:字节自研千亿级规模文件元数据存储系统概述
Homewbrew installation, common commands and installation path
JSP learning 3
第十天 异常机制
建站常用软件PhpStudy V8.1图文安装教程(Windows版)超详细
Use if else to judge in sail software - use the title condition to judge
NVIDIA graphics card driver error
Loading order of logback configuration file
Hypermotion cloud migration helped China Unicom. Qingyun completed the cloud project of a central enterprise and accelerated the cloud process of the group's core business system
Oracle data pump usage
Set the color change of interlaced lines in cells in the sail software and the font becomes larger and red when the number is greater than 100
众昂矿业:萤石浮选工艺
Day 9 static abstract class interface
04 Lua 运算符
Solution to the fourth "intelligence Cup" National College Students' IT skills competition (group B of the final)
Solution of garbled code on idea console
Construction of promtail + Loki + grafana log monitoring system
关于 background-image 渐变gradient()那些事!

