Chapter 7: Exceptions and System Calls — The Boundary of User Mode
Vol 3: Computer Core Expedition · Chapter 7
Metadata Card
| Attribute | Value |
|---|---|
| Keywords | Interrupts, 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
- Interrupt: External hardware event (timer, disk, network)
- Trap: Intentional call to OS (system call)
- Fault: Error that may be recoverable (page fault)
- Abort: Fatal error (illegal instruction)
Encounter 3: System Call Flow
User program → syscall instruction → trap to kernel mode
→ kernel handles request → return to user modeThe 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