Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • 2
    I agree. I think it started with „capturing“ or „intercepting“ special conditions in the code (I.e. division by zero) and then the same mechanism (address tables for indirect jumps) was used for other purposes. Then instructions were included to support compilers to generate „capture code“ for their own special conditions and finally it is used as „normal“ subroutine calls that require full control by the OS. The instruction set of of the MC68k is a perfect example for all of that. With that context in mind, I think, the quote does not sound strange. Commented Dec 9, 2020 at 7:19
  • 1
    Motorla 68000 had a 'trap' instruction in Atari ST TOS. Commented Dec 16, 2020 at 9:28
  • That line, I suppose, is coming from the book OS: 3 easy pieces from this chapter pages.cs.wisc.edu/~remzi/OSTEP/cpu-mechanisms.pdf, page 4. I think the trap word used here is because if you want to move from User mode to Kernel mode, you have to call a trap instruction. When you make a system call, the system call calls the trap instruction with given arguments. So, I think the author here is saying that any system call you make, calls the trap instruction inside its implementation. Commented Jan 18, 2022 at 3:24
  • I think there is a snippet from the book explaining this, on page 3 in a greyed area. You can also read it here textbin.xyz/… Commented Jan 18, 2022 at 3:27
  • The IBM 704, introduced in 1954, used interrupts with a "transfer trap", which could invoke a special routine when a branch instruction was encountered. Commented Jun 9, 2023 at 18:54