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/How Programs Run
Operating Systems

How Programs Run

What an OS is for, and what happens between `./server` and the first instruction on a CPU: loader, address space, process, scheduler.

The question this module answers · Several programs want the same CPU, memory, disk and NIC. Who coordinates them?
What an Operating System Is For
▶ interactive

Several programs want the same CPU, memory, disk and network card at the same time; the operating system is the program that owns those resources and hands them out, and everything it does follows from that job.

Follow a Program: from `./server` to the First Instruction
▶ interactive

Typing `./server` triggers a chain — shell, fork, exec, loader, address space, dynamic linker, stack, heap, registers, scheduler — and the first instruction of your `main` runs only after every one of those steps has succeeded.

Program versus Process
▶ interactive

A program is a passive file of instructions on disk; a process is one running instance of it with its own address space, state and PID — which is why one `chrome` binary can be twenty processes and why killing one leaves the file untouched.

The Process Memory Layout
▶ interactive

A process’s virtual address space is divided into regions with different lifetimes and permissions — text, data, BSS, heap, mapped libraries, stack — and knowing which region a variable lives in tells you how it is allocated, how long it lives and how it can be corrupted.

Engineer Atlas
GitHub·LinkedIn