Difference between revisions of "Trap"
From Computer History Wiki
(An OK start) |
m (+cat) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | A '''trap''' is similar to an [[interrupt]] in terms of the mechanism, and what happens when one occurs (in terms of saving the state of the [[Central Processing Unit|CPU]] at the time the trap happened, and the invocation of a '''trap handler'''), but differs from an interrupt in that the latter is usually caused by some ''external'' event, whereas traps are almost always caused by an ''internal'' event. | + | A '''trap''' of '''fault''' is similar to an [[interrupt]] in terms of the mechanism, and what happens when one occurs (in terms of saving the state of the [[Central Processing Unit|CPU]] at the time the trap happened, and the invocation of a '''trap handler'''), but differs from an interrupt in that the latter is usually caused by some ''external'' event, whereas traps are almost always caused by an ''internal'' event. |
− | For example, traps may happen in response to things like an attempt to divide by zero, or an attempt to take some action that it not allowed to a [[user]]'s [[process]], only the [[operating system]] (e.g. halt the machine). | + | For example, traps may happen in response to things like an attempt to divide by zero, or an attempt to take some action that it not allowed to a [[user]]'s [[process]], only to the [[operating system]] (e.g. [[halt]] the machine). |
− | {{stub}} | + | {{semi-stub}} |
+ | |||
+ | [[Category: CPU Basics]] |
Latest revision as of 15:30, 15 December 2018
A trap of fault is similar to an interrupt in terms of the mechanism, and what happens when one occurs (in terms of saving the state of the CPU at the time the trap happened, and the invocation of a trap handler), but differs from an interrupt in that the latter is usually caused by some external event, whereas traps are almost always caused by an internal event.
For example, traps may happen in response to things like an attempt to divide by zero, or an attempt to take some action that it not allowed to a user's process, only to the operating system (e.g. halt the machine).