Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 04 · How Computers Work · Inside the operating system · about 20 min to read

Play it as a journeyTutor comes with a plan

The names a program needs to find

How Code Becomes Execution
How Code Becomes Execution · Open board

The road from the words you type to the bytes the chip runs. This lesson zooms in on its last two stops: joining the pieces, then loading them.

Before you start. A compiler turns the code you write into the chip’s own instructions, one file at a time, and a running program keeps its short-lived work on the stack and its longer-lived things on the heap (How Code Becomes Execution (compilers, stack & heap)). The kernel starts a program by loading it into a fresh process, the walled-off space a running program lives in (Processes, Threads & the Kernel). Memory is handed out in fixed-size blocks called pages. A file can be mapped into a process’s memory, page by page. When two processes map the same file, they share one copy of those pages (The address book every process carries).

Lesson 18 of 41 in How Computers Work

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • February 2016: the bug inside every program at once
  • A promise in the code: the symbol
  • Matching every promise: the linker
  • Copy it in: static linking
  • Fetch it when the program starts: the shared library and the loader
  • One fix reaches every program, and so does one mistake

Terms it explains: symbol, linker, static linking, dynamic loader, shared library, ABI, AST, buffer overflow, bytecode, CALL/RET, compiler, dereference (*), GC, heap, interpreter, JIT, memory leak, pointer, segfault, stack, stack frame, stack overflow, use-after-free / dangling pointer.

Review How Computers Work