Low-Level Atlas II
From “I understand the machine” to “I built real systems with it”
The practical continuation of Low-Level Atlas: nine real systems built from scratch in C — a shell, a malloc, a regex engine, a Git clone, an HTTP server, and a database engine with a B-Tree, a WAL, and a SQL layer. No frameworks, no shortcuts. Assumes you already did Atlas I.
Read it as a build queue, not a course catalog.
Warm up with a shell, a malloc, and a regex engine, then move to data (a Git clone), networking (an HTTP server) and concurrency in practice — and let the database engine pull it all together, v0 to v3.
Orientation
Where to start, what Atlas I you need first, and how this atlas is organized as a build queue.
Warm-up Builds
Short, self-contained builds that put Atlas I's fundamentals to work: a shell, a malloc, a regex engine — one to two weeks each.
Shell from Scratch
A minimal bash-like shell: command parsing, fork/exec, pipes, I/O redirection, signal handling, and job control — foreground/background, Ctrl-Z.
Exploremalloc from Scratch
A real malloc/free/realloc: free lists, coalescing, sbrk vs mmap, alignment, fragmentation — measured against glibc's allocator.
ExploreRegex Engine from Scratch
A minimal Thompson-NFA regex engine: pattern to state machine, no exponential backtracking. Parsing and automata in a self-contained project.
ExploreData & Serialization
Content-addressed storage and serialization: a minimal Git, hashing, the commit graph — data structures with a result you can actually use.
Networked Systems
A real HTTP/1.1 server from raw sockets: protocol parsing by hand, an epoll/kqueue event loop, keep-alive, concurrent connections.
Concurrency & Performance II
Atlas I's concurrency theory anchored in the server and the database engine: thread pools, lock-free structures, false sharing, real load benchmarking.
The Database Engine
The spine project: a persistent KV store on a B-Tree, durability and crash recovery, a relational layer, and a minimal SQL engine — v0 through v3.
KV Store & Durability
First half of the database engine: a persistent key-value store on a copy-on-write B-Tree, fsync durability, write-ahead log, crash recovery, free-space management.
ExploreRelational Layer & Query Engine
Second half, on top of the KV store: tables and indexes over the B-Tree, a minimal SQL subset, a planner/executor, and concurrent copy-on-write transactions.
ExploreAlways Active
TDD and craftsmanship for systems with state: testing protocol parsers, concurrency bugs, fuzzing binary formats, property-based testing, TDD when state lives on disk.
The database engine, v0 → v3
Built across two branches — a persistent KV store, then a relational layer on top — the same way Atlas I built an OS from scratch: in milestones, not all at once.
In-memory KV store
A B-Tree, no persistence yet. Just the data structure.
Real durability
fsync, write-ahead log, crash recovery. Now it's an actual database.
Relational layer
Tables and secondary indexes, built on top of the KV store.
SQL + transactions
A minimal SQL parser, a planner/executor, concurrent transactions, load benchmarks.
Registries and operating memory
Registries keep external references, specs, tools, and source material normalized behind short atomic notes.