operating-systems

Definition

Trap

A Trap (or synchronous interrupt) is an exception generated by the CPU during the execution of an instruction.

Causes

  • Errors: Illegal operations such as division by zero, invalid opcode, or segmentation fault.
  • Intentional: Software instructions used for debugging (breakpoints) or initiating system calls.