A small, hands-on book on writing an operating system that boots on an actual computer.
Most OS-development resources either send you to a comprehensive academic textbook (OSTEP) or hand you a tutorial that works perfectly in QEMU and silently fails on real hardware. Build Your Own Operating System does neither.
It is a brisk, opinionated companion to NexusOS, a ~3,000-line x86-64 reference kernel. The kernel boots from a 512-byte BIOS bootloader you can read in one sitting, runs in 64-bit long mode with its own GDT and four-level page tables, manages physical and virtual memory through a real PMM / VMM / heap stack, preempts tasks at 100 Hz with mutex, semaphore, and condition-variable primitives, talks to a disk over PIO ATA and reads a FAT12 filesystem, composites a graphical desktop with a draggable terminal window, and boots on actual hardware, not just in the emulator.
Each chapter introduces one subsystem in plain language, inlines the actual code that implements it (line numbers match the source tree), and ends with exercises that ask you to modify the reference kernel rather than retype 3,000 lines from a blank file.
What makes this book different from the free alternatives
Real-hardware war stories. When NexusOS first booted on an ASUS desktop, the BIOS E820 call returned a memory map with no usable RAM. Then the ATA driver hung forever on a SATA-only machine, because the legacy IDE port reads 0xFF, which has the busy bit set. Then VBE hung inside the BIOS call, and you cannot time-out a BIOS call that never returns. Every chapter has the specific bug, the specific fix, and the defensive code that survived. Chapter 12 is the most honest chapter in the book.
A working kernel, not pseudocode. xv6 is RISC-V (or older x86) and academic. Phil Opp's series is excellent, but it's in Rust. NexusOS is C and assembly, x86-64, and you can make rungui today and modify it tonight.
What you'll need
Comfort with C and a little assembly. WSL on Windows, or any Linux or macOS shell. No prior bare-metal experience. About 90 pages of focused reading, plus as much time at the keyboard as you choose to give it.
What you'll have at the end
By Chapter 11, a graphical desktop running in an emulator. By Chapter 12, the same OS running on a real PC, with a panic dump you wrote yourself arriving over a serial cable when something goes wrong. By Chapter 13, a clear picture of what to build next — user mode, syscalls, ELF, SMP, networking, porting — and how to start.
Free sample
Includes the Preface and Chapters 1–2: enough to read the philosophy of the book, set up your toolchain, and write the smallest real OS — a 512-byte boot sector that prints OK on a virtual machine.