gitmyhub

os01

TeX ★ 14k updated 2y ago

Bootstrap yourself to write an OS from scratch. A book for self-learner.

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.

Cx86 AssemblyLyXQEMUgdbsetup: hardcomplexity 5/5

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.

Where it fits