当前位置:网站首页>x86 Exception Handling and Interrupt Mechanism (3) Interrupt Handling Process
x86 Exception Handling and Interrupt Mechanism (3) Interrupt Handling Process
2022-08-09 11:15:00 【XV_】
After finishing the process of finding the interrupt service routine according to the interrupt type number in the previous section, let's focus on explaining the more complete process of interrupt handling.
This section takes the interrupt processing process of the 8086 era as an example to illustrate, mainly divided into two parts
- Hardware processing
- Software processing
It should be noted that this is not absolute, it depends on the actual situation. In short, if the hardware has already completed the necessary actions, the interrupt service routine does not need to be executed. If not, it needs to be written into the program to executerelated operations.
1 Interrupt process
1.1 Prerequisite: Generate & Detect Interrupt
The premise of interrupt processing is to generate an interrupt and then detectTo interrupt, otherwise how to deal with it?
For the generation of interrupts, it is divided into internal and external. The internal is generated by the execution of the instruction. I will not say the specifics. There are also external ones. Generally, special peripherals such as power failure cannot be shielded. Other peripheralsSuch as the mouse and keyboard, through the interrupt controller such as 8259A to generate external interrupts.
As for the detection of interrupts, internal interrupts generally have related hardware that can directly detect and release a certain signal, while external interrupts depend on some register flag bits and the like, depending on the situation.
1.2 Interrupt Handling
The division of labor between software and hardware is not absolute. We need to analyze the actual situation. If the hardware is done, the software is not needed.If it is done, the software must be done if the hardware is not done.
Hardware processing
Software processing
Interrupt handling is similar
- Interrupt generated, interrupt detected
- Protect the scene
- Find the corresponding interrupt service routine
- Execute interrupt handler
- Restore site
- Return to continue execution
In addition, the interrupt service routine itself is also a program that may generate interrupts during its execution, that is, interrupt nesting, which depends on the interrupt switch, the specificThe details depend on the implementation, not necessarily.
All in all, through a series of abstractions, we can only obtain the rough process of interrupt processing. The actual process is closely related to the actual situation, and the situation is changeable, which requires more use and practice.
边栏推荐
猜你喜欢
Cluster understanding
美的数字化平台 iBUILDING 背后的技术选型
c语言函数的递归调用(汉诺塔问题,楼梯递归问题等)
Quartz的理解
∘(空心的点乘)的数学含义
CentOS6.5 32bit安装Oracle-11gR2步骤说明
vite的原理,手写vite
PoseNet: A Convolutional Network for Real-Time 6-DOF Camera Relocalization Paper Reading
CSDN的markdown编辑器语法完整大全
OpenSSF's open source software risk assessment tool: Scorecards
随机推荐
Qt获取EXE可执行文件的上一级目录下的文件
信号量SIGCHLD的使用,如何让父进程得知子进程执行结束,如何让父进程区分多个子进程的结束
Netscope:神经网络结构在线可视化工具
Beauty Values
FreeRTOS任务创建源码分析
WebSocket
MySQL传统方案和通过SSH连接哪个好?
matlab图像分割,从基因芯片荧光图像中提取阴性点(弱)和阳性点(强)
Cluster understanding
使用.NET简单实现一个Redis的高性能克隆版(四、五)
PTA 换硬币
Quartz分布式实现
聚类了解
双向链表的各种操作
activemq 消息持久化
CAN总线发送数据
Qt读写.ini配置文件
torch.stack()的官方解释,详解以及例子
caffe ---make all editing error
激光条纹中心提取——Steger