title: What does a trap instruction do in an operating system?
body: <p>While studying operating systems concepts, I saw the term trap instruction.
  &quot;A TRAP instruction is performed to switch from
  user mode to kernel mode.&quot; I failed to understand what a trap instruction does.</p>