explaingit

tuhdo/os01

13,543TeXAudience · developerComplexity · 5/5Setup · hard

TLDR

A free book that teaches you to build a working operating system from scratch, covering x86 hardware, assembly language, and OS internals by reading real Intel manufacturer documentation.

Mindmap

mindmap
  root((os01 book))
    Content
      Hardware fundamentals
      x86 assembly
      Program loading
      OS components
    Tools Used
      QEMU emulator
      gdb debugger
      LyX document format
    Learning Approach
      Intel manuals first
      Hands-on assignments
      Sample OS companion
    Audience
      Self-learners
      C programmers
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Work through the book to understand how x86 processors work at the hardware level and how programs are structured so an OS can load and run them.

USE CASE 2

Set up QEMU and gdb to write and debug bare-metal x86 assembly code that runs directly on hardware without an operating system.

USE CASE 3

Build your own mini OS by completing the hands-on implementation assignments in Part 3 of the book.

USE CASE 4

Learn to read Intel hardware manuals directly so you can reason about any x86 platform from the primary source.

Tech stack

Cx86 AssemblyLyXQEMUgdb

Getting it running

Difficulty · hard Time to first run · 1day+

Requires QEMU, gdb, and a working x86 cross-compiler toolchain to run the code examples and assignments.

In plain English

This repository hosts a free book called "Operating Systems: From 0 to 1" that teaches you how to build a working operating system from the ground up. The book is aimed at self-learners who already have basic C programming experience and some familiarity with the Linux command line. It does not assume you have studied operating systems before, but it does expect you to be comfortable writing small programs in C. The book is structured in three parts. The first two parts, covering eight chapters, walk through the foundational concepts: how computers work at the hardware level, how x86 assembly language functions, how programs are structured so an operating system can load and run them, and how to debug code running directly on hardware using tools called gdb and QEMU. These chapters are described as essentially complete. Part three is a series of implementation assignments where you build components of an operating system yourself, but those later chapters are still in progress. A distinguishing feature of the book's approach is that it teaches you to read official hardware documentation directly from manufacturers like Intel, rather than relying only on secondhand explanations. The reasoning is that hardware manufacturers are the primary source of truth about how their hardware behaves, and learning to read those documents gives you a skill you can apply to any hardware platform throughout your career. The book uses Intel's official manuals as teaching material rather than as supplementary reference. A companion sample operating system repository accompanies the book. It demonstrates concepts from the first ten chapters, including protected mode, process management with task state structures, interrupts, and local interrupt controllers. Paging and input/output handling are not yet implemented in that sample. The book source is written in a document format called LyX, and a compiled PDF is available directly from the repository. Contributions fixing grammar or unclear passages are welcome via GitHub issues or pull requests.

Copy-paste prompts

Prompt 1
I'm reading 'Operating Systems: From 0 to 1'. Help me write a minimal x86 bootloader in assembly that switches from real mode to protected mode and prints a message to the screen.
Prompt 2
Using the os01 approach, help me set up QEMU and gdb to debug a bare-metal x86 program, show me the exact commands to start QEMU in debug mode and attach gdb.
Prompt 3
Explain how the x86 Task State Segment (TSS) works for process management, as covered in the os01 sample OS, with a concrete code example.
Prompt 4
Help me implement a basic interrupt descriptor table (IDT) for an x86 OS project, following the approach described in the os01 book.
Open on GitHub → Explain another repo

← tuhdo on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.