当前位置:网站首页>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.
边栏推荐
猜你喜欢

全网最简单解决OneNote中英字体不统一

matlab图像分割,从基因芯片荧光图像中提取阴性点(弱)和阳性点(强)

OpenSSF's open source software risk assessment tool: Scorecards

Since I use the HiFlow scene connector, I don't have to worry about becoming a "dropper" anymore

【VIBE: Video Inference for Human Body Pose and Shape Estimation】论文阅读

电磁场与电磁波-场论基础

UNIX哲学

golang 标准库json Marshal、Unmarshal坑

∘(空心的点乘)的数学含义

信号量SIGCHLD的使用,如何让父进程得知子进程执行结束,如何让父进程区分多个子进程的结束
随机推荐
PTA习题 分类统计字符个数(C)
String类型的字符串对象转实体类和String类型的Array转List
For versions corresponding to tensorflow and numpy, report FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecate
Oracle数据库的两种进入方式
Netscope:神经网络结构在线可视化工具
torch.stack()的官方解释,详解以及例子
学习阶段总结(背包问题)
使用gdb调试多进程程序、同时调试父进程和子进程
caffe ---make all编辑出错
PTA 求一批整数中出现最多的个位数字
jmeter BeanShell 后置处理器
electron 应用开发优秀实践
matlab fcnchk 函数用法
MySQL查询性能优化七种武器之索引潜水
gdb tui的使用
关于anaconda中conda下载包或者pip下载包很慢的原因,加速下载包的方法(无视anaconda版本和环境)
Cesium加载三维模型数据
无重复字符的最长子串
在线编译matlab,亲测好用
获取指定年度所有周的工具类