Machine, Process, Memory & I/O Foundations

Systems stop feeling mysterious when CPU work, kernel-owned process state, translated memory and persistent I/O can be traced as one concrete path. This first section builds that path before adding concurrency or a network.

Section 1 of 7 · 10 units · about 47 hours

0/10

By the end you can Trace a process from creation to exit and a checksummed file from application write to recovered state. Show one page-fault observation, one descriptor or signal transition, one container resource-limit failure and one measured locality change.

Units

Build it

Mini project · about 12 to 16 hours

Mechanisms laboratory: kernel, process, memory, file and container

Build the repository-wide mechanisms laboratory that later sections reuse: small kernel, locality, process, memory, file and container experiments with correctness checks and retained raw output. Each experiment pairs a measurement with its environment so later claims stay reproducible.

  1. 1Create the repository with lab/, kv/ and dossier/ directories, where each experiment is one make check target that writes raw output beside its environment record of CPUs, kernel, compiler and interpreter versions and pinning.
  2. 2Build scalar, vectorized, dependency and branch variants of one reduction kernel, verify each sum against a Python oracle, and compare enabled and disabled vectorization in saved objdump output with pinned repeated timings.
  3. 3Extend the row-first and column-first traversals into working-set and stride sweeps, read the cache sizes from sysfs and predict where the knees fall, then check each sweep against a Python oracle and keep pinned repeated timings with a topology note.
  4. 4Write lab/supervise.py to run a pipe worker from a descriptor ownership diagram, keep a leaked-writer regression that fails before the fix, and show SIGTERM termination with zombie observation and reaping and closure on every exit path under strace.
  5. 5Trace first-touch faults and copy-on-write isolation, stage allocate, free, reuse and free-all cycles with snapshots of requested payload beside resident and virtual sizes, add one sparse mapping, and diagnose retained capacity apart from growth.
  6. 6Turn atomic publication into lab/publish.py with ordered write, file sync, rename and directory sync checked in strace, failure tests that leave the old file intact, and a cached read comparison labeled as page-cache reads.
  7. 7Retain one inspected Docker container OOM with namespace, credential and mount diagrams, configured limits compared with effective limits, PID 1 duties and an orchestrator checklist, and add the Nand2Tetris gate and assembler suites as the logic oracle.
What you hand in
  • The lab/ directory with one checked experiment per target, raw outputs, environment records and a passing make check.
  • Kernel, locality and I/O tables with pinned repeats, saved assembly, cache sizes and filesystem notes.
  • lab/supervise.py and lab/publish.py with diagrams, regression tests and the memory and container reports.
How to check it
  • Self-grade with the rubric below
How it's graded

Correctness before timing

Pass: Every experiment prints a check asserted by make check, and each table was verified against its Python oracle.

Great: Each timing names its oracle and pinning, and the write-up explains assembly and cache evidence plus untested effects.

Processes and descriptors

Pass: The leaked-writer test fails before the fix and passes after, and signal handling reaps on every path shown in strace.

Great: The diagram predicts the observed closes, and an injected parent failure still leaves no zombie and no open pipe.

Memory, files and containers

Pass: Staged snapshots separate retention from growth, publication failures keep the old file, and limits match effective values.

Great: The diagnosis names the reusable capacity, the sparse case separates virtual from resident size, and the checklist ties each action to its trigger.

Resources

  • Operating Systems: Three Easy Pieces - selected foundationsRemzi and Andrea Arpaci-Dusseau

    Read Chapters 4-7, 13-15, 18-21, 36, 39-40, 42 and 45. Work from process state to address translation, devices, files, journaling and integrity. For every chapter, draw the owned state and one failure boundary instead of collecting summaries.

  • MIT 6.1810 - selected xv6 process and memory labsMIT PDOS

    Use Fall 2025 Lectures 1, 3-6, 8 and 10-11. Complete the util lab, one syscall task, and the page-table inspection plus ugetpid task from pgtbl. Add cow only if copy-on-write remains unclear. Keep all work in your own course checkout and stop before the full xv6 sequence.

  • OSTEP homework - process, paging, disk and integrity simulatorsOSTEP authors

    Solve process-run.py, paging-linear-translate.py, paging-policy.py, disk.py, fsck.py and checksum.py for at least two seeds each before using the answer flag. Then reproduce one prediction using strace, /proc or a small local program.

  • Algorithmica - Algorithms for Modern HardwareSergey Slotin

    Use the Instruction-Level Parallelism, SIMD Parallelism and RAM & CPU Caches chapters for measured pipeline, branch, vectorization, bandwidth, latency and cache-line effects. The figures are the author's Zen 2 measurements at a fixed 2 GHz: predict and measure your own.

  • AlgoMaster Operating Systems - selected observation routeAlgoMaster

    After OSTEP, use the matching lessons as a second explanation and recall check: fork, exec, wait, and exit; Zombies and Orphans; Signals; Context Switching; The Process Address Space; Paging; The TLB: Hits, Misses, and Invalidation; Page Faults; Copy-on-Write; mmap and Memory-Mapped Files; How malloc Works; VSZ, RSS, PSS, and What They Mean; File Descriptors; The Page Cache and Write-Back; Durability and fsync; Crash Consistency; Linux Namespaces; Control Groups; PID 1 and Signal Handling; Container Resource Failures; and the Investigating lessons. Treat quizzes as recall checks and keep your own traces as evidence.

  • Linux proc and strace referencesman7.org and strace project

    Use proc(5), getrusage(2), mmap(2), fsync(2), rename(2), wait(2) and signal(7) while tracing a parent-child pipe, page faults, file publication and a resource-limit failure. Record exact commands and raw observations.

  • MIT 6.S894 Accelerated Computing - Throughput ProcessorsMIT

    Use Lecture 2 for the processor model behind this section: superscalar issue, out-of-order execution, speculation and SIMD's need for coherent control. The labs run on the course's remote machines and target AVX-512 and NVIDIA GPUs, so they belong to the GPU track.

  • Auto-Vectorization in LLVMLLVM Project

    Use The Loop Vectorizer Usage and Diagnostics sections for the Clang remarks the pipelines unit asks for; the Features list is optional depth.

  • AlgoMaster: hardware and container storage companionsAlgoMaster

    Use Memory Ordering, Barriers, and False Sharing (coherence and false-sharing headings only); Huge Pages, NUMA, and ASLR (NUMA headings only); Storage Hardware; RAID Fundamentals (comparison and backup boundaries); and Container File Systems. These fill hardware and image-layer gaps outside the pool's selected OS revision lessons.

  • Nand2Tetris - Projects 1 and 4 onlyNand2Tetris

    Use Project 1 for Boolean logic and Project 4 for machine-language execution only if the binary or instruction-level entry check fails. Do not take the full course as a second systems curriculum.