Skip to content

Chapter 7: Exceptions and System Calls — The Boundary of User Mode

Vol 3: Computer Core Expedition · Chapter 7


Metadata Card

AttributeValue
KeywordsInterrupts, Exceptions, Traps, System Calls, User Mode, Kernel Mode

Your Progress

"Every time you call read(), write(), or open(), your program surrenders control to the OS kernel. This handoff is managed through a carefully designed mechanism — the system call."


Encounter 1: User Mode vs Kernel Mode

  • User mode: Restricted access to hardware, limited instruction set
  • Kernel mode: Full hardware access, all instructions available

Encounter 2: Types of Events

  1. Interrupt: External hardware event (timer, disk, network)
  2. Trap: Intentional call to OS (system call)
  3. Fault: Error that may be recoverable (page fault)
  4. Abort: Fatal error (illegal instruction)

Encounter 3: System Call Flow

User program → syscall instruction → trap to kernel mode
  → kernel handles request → return to user mode

The system call number identifies the specific service requested. Arguments are passed in registers.


Verification Checklist

  • [ ] Can explain the difference between user mode and kernel mode
  • [ ] Can describe the system call execution flow
  • [ ] Can distinguish interrupts, traps, faults, and aborts

Next Stop Preview

Chapter 8: Process Context — Who's Running Your Code

Built with VitePress | Software Systems Atlas