Prerequisites

What You Need Before Starting

Required

Proficiency in at least one programming language. C is strongly recommended and will make everything in this book click faster. If you know C, you already understand pointers, manual memory management, and the fact that arrays have no bounds checking. All of that is directly relevant.

If you know Python, Java, or C++, this book is still accessible — but you will encounter concepts (stack frames, pointer arithmetic, raw memory) that may be unfamiliar. Chapter 4 covers memory in enough depth that a Python programmer can catch up.

If you do not yet program: learn C first. Kernighan and Ritchie's The C Programming Language is the standard. Come back when you understand pointers.

Basic command-line comfort. You will be working in a terminal throughout this book. You need to be able to navigate directories, create files, run programs, and install software with a package manager. Linux is the primary platform; Windows with WSL2 works well. macOS (especially Apple Silicon) works but has some differences noted in the ARM64 chapters.

Basic binary and hexadecimal knowledge (helpful but not required). Chapter 2 covers this completely. If binary and hex are new to you, read Chapter 2 carefully. If they are familiar, skim it.

Some C experience beyond beginner level. Having written a program that uses malloc, pointers, and structs will make Chapters 11, 12, and 20–24 much easier.

Familiarity with using a debugger. Any debugger experience (even print-statement debugging) helps. Chapter 5 introduces GDB from scratch, but prior experience with any debugging tool helps.

Basic understanding of how processes work. Understanding that a running program has memory, a file descriptor table, and a main function is enough. Chapter 4 builds on this.

Not Required

Prior assembly language experience. This book starts from zero.

Operating systems knowledge. The book explains everything it needs from OS internals.

Hardware/electronics background. We are programming at the software level. You do not need to know how transistors work.

Mathematics beyond basic algebra. The most complex math in this book is two's complement arithmetic and IEEE 754 floating point — both covered in Chapter 2 from scratch.

Self-Assessment Checklist

Work through this checklist. If you can do all of these comfortably, you are ready to start.

  • [ ] Write a C function that takes a pointer and modifies the value it points to
  • [ ] Explain the difference between int *p = &x and int *p = malloc(sizeof(int))
  • [ ] Convert the decimal number 255 to hexadecimal (answer: 0xFF)
  • [ ] Open a terminal and navigate to a directory using cd and ls
  • [ ] Compile a C program from the command line: gcc hello.c -o hello
  • [ ] Run a program and check its exit code: ./hello; echo $?

If most of these are unfamiliar, spend a few hours with a C tutorial and the Linux command line before starting Chapter 1.

Resources for C Review

If your C is rusty: - The C Programming Language (Kernighan & Ritchie, 2nd Ed.) — the definitive reference, short and dense - C Programming Absolute Beginner's Guide (Perry & Miller) — for those new to C - The C track on exercism.org — practice exercises with mentorship - man 3 pages on Linux — the standard library documentation

For command-line skills: - The Linux Command Line (William Shotts) — free at linuxcommand.org - MIT's "Missing Semester" course (missing.csail.mit.edu) — shell, tools, scripting

Platform Notes

Linux (recommended): Ubuntu 22.04 LTS is the reference platform. All examples are tested on Linux. The apt commands in Chapter 5 assume Ubuntu/Debian.

Windows with WSL2: Works well. Install WSL2 with Ubuntu 22.04 from the Microsoft Store. All Linux-targeted content applies directly inside WSL2. QEMU for the OS project works in WSL2.

macOS (Apple Silicon): Native ARM64. You can run the ARM64 chapters natively. For x86-64 chapters, use QEMU or a remote Linux server. The Homebrew package manager provides NASM, binutils, and GDB (as aarch64-elf-gdb). Chapter 18 has macOS-specific notes.

macOS (Intel): x86-64 native. Use Homebrew for tools. The macOS system call interface differs from Linux (noted where relevant). For the OS kernel project (Chapter 28+), a Linux VM or QEMU is easier.