📔【操作系统】陷阱、中断、异常、信号 #86
Replies: 8 comments
-
陷阱也被称为软中断,好像有点问题 |
Beta Was this translation helpful? Give feedback.
-
@nengqi 你的意思是,陷阱 trap 属于一个异常(不符合预期),而不是一个软中断(符合预期)? 可以举几个 exception 中属于 trap 的例子吗? |
Beta Was this translation helpful? Give feedback.
-
https://stackoverflow.com/questions/56877451/difference-between-trap-and-exceptions
感觉是概念问题
齐能
***@***.***
…------------------ 原始邮件 ------------------
From: Images。 ***@***.***>
发送时间: 10/26/2021, 18:39
To: imageslr/blog ***@***.***>
抄送: Qi Neng ***@***.***>, Mention ***@***.***>
Subject: Reply:[imageslr/blog] ��【操作系统】陷阱、中断、异常、信号 (#44)
@nengqi 你的意思是,陷阱 trap 属于一个异常(不符合预期),而不是一个软中断(符合预期)?
可以举几个 exception 中属于 trap 的例子吗?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Beta Was this translation helpful? Give feedback.
-
赞。感觉可以这样理解:如果是符合预期的“好”的异常 exception,就是陷阱 trap;如果是不符合预期的“坏”的异常,就是故障 abort。这个概念在《CSAPP》上有描述,我之后再看一下。 |
Beta Was this translation helpful? Give feedback.
-
我觉得是翻译的问题,文中所谓的“坏的异常”应该指的是为error,而“异常控制流”的异常exception,我觉得翻译为例外更好
用的就是page fault error |
Beta Was this translation helpful? Give feedback.
-
@Vector6662 有道理。这里的名词 interrupt、trap、abort、error、exception 当时也让我纠结了很久。 在第四小节中,我其实是没有明确区分”异常 exception”、“错误 error” 和 “故障 abort”。当时这么写的:
所以全文都是在说“异常控制流”,这里的语义和你表达的“例外”是一样的。 然后如果仅专注于第四小节的话,我把“异常”“错误情况”“故障”都统称为异常了。严谨点来说,那里用“错误 error”或者“故障 abort”更合适一些。 |
Beta Was this translation helpful? Give feedback.
-
参考资料里边的《Linux系统调用指南》链接挂了,请问能给个新的链接吗? |
Beta Was this translation helpful? Give feedback.
-
@Vector6662 已更新 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
https://imageslr.github.io/2020/07/09/trap-interrupt-exception.html
前言:异常控制流 每个进程对应的程序文件由一条一条的指令组成。进程在执行的时候,会将程序文件加载到进程的内存空间中,这些指令在内存空间中是相邻的。进程会通过调整程序计数器 PC 的值,一条一条地执行指令。我们将进程执行的指令序列叫做处理器的「控制流」。
Beta Was this translation helpful? Give feedback.
All reactions