Engineer Atlas
OverviewLearnJourneysOS LabFinderRoadmapPracticeInterviewCheat SheetCompareConnections
OverviewLearnJourneysOS LabFinderRoadmapPracticeInterviewCheat SheetCompareConnections
Operating Systems
  • How Programs Run
  • Processes
  • Threads, Async & Event Loops
  • CPU Scheduling
  • System Calls & Kernel Mode
  • Stack & Heap
  • Virtual Memory & Paging
  • Files, File Systems & Descriptors
  • I/O
  • Concurrency, Synchronization & Deadlocks
  • Inter-Process Communication
  • Sockets
  • Containers & the OS
  • OS Internals Lab
  • OS Debugging & Capstone
OS + Networking
  • OS + Networking Together
OS/Learn/System Calls & Kernel Mode
Operating Systems

System Calls & Kernel Mode

Why applications cannot touch hardware directly, the user/kernel boundary, and what a system call costs.

The question this module answers · Why can’t my program just write to the disk itself?
System Calls
▶ interactive

An application cannot read a disk, send a packet or create a process on its own; it deposits a request number and arguments in registers, executes a trap instruction, and the kernel does it — a few hundred nanoseconds per crossing, which is why batching interfaces exist.

User Mode vs Kernel Mode
▶ interactive

The CPU runs in one of two privilege levels; user mode cannot touch devices, page tables or other processes, and the only ways into kernel mode are a trap, an interrupt or an exception — which is why a segfault is a fault delivered to you as a signal, not a crash of the machine.

Engineer Atlas
GitHub·LinkedIn