explaingit

cfenollosa/os-tutorial

30,435CAudience · developerComplexity · 4/5MaintainedLicenseSetup · moderate

TLDR

Step-by-step tutorial for building a minimal operating system from scratch, starting with bootloaders and progressing through Assembly, C, interrupts, and basic kernel features.

Mindmap

mindmap
  root((os-tutorial))
    What it teaches
      Bootloaders
      Interrupt handling
      Memory management
      Shell basics
    How it works
      Short lessons
      Commented code
      Hands-on approach
    Tech stack
      Assembly
      C language
    Use cases
      Learn OS internals
      Build bootloader
      Understand hardware
      Kernel development

Things people build with this

USE CASE 1

Learn how a computer boots and loads an operating system by writing your own bootloader.

USE CASE 2

Understand interrupt handling and hardware communication by implementing keyboard input and screen output.

USE CASE 3

Build a minimal kernel with basic memory management and shell functionality from the ground up.

USE CASE 4

Gain hands-on experience with low-level Assembly and C programming in a real systems context.

Tech stack

CAssemblyx86

Getting it running

Difficulty · moderate Time to first run · 1h+

Requires cross-compiler toolchain (gcc, binutils for x86) and emulator (QEMU) setup; building and testing each step takes time.

Use freely for any purpose including commercial. Keep the copyright notice and don't use the authors' names to endorse derivative work.

In plain English

This is a step-by-step tutorial for learning how to build a minimal operating system from scratch. Rather than reading an existing kernel, the tutorial walks through writing a working OS piece by piece: starting from the very first boot sector, the tiny blob of code a computer runs before any operating system loads, then moving into 32-bit mode, jumping from Assembly language into C, adding interrupt handling (the mechanism that lets hardware events like key presses notify the CPU), implementing basic screen output and keyboard input, and eventually working toward a simple shell and memory management. Each lesson is kept intentionally short, the README estimates 5 to 15 minutes per lesson, with a brief written explanation followed by heavily commented code samples. The philosophy is minimal theory and maximum hands-on code, aimed at programmers who are comfortable with low-level computing concepts but have never gone all the way down to building a bootloader and kernel themselves. A programmer curious about how computers actually start and how an operating system is built at the lowest level would work through this when they want practical experience rather than textbook reading. The README warns it is an old, abandoned project with known technical issues, and suggests also consulting more modern and authoritative sources on OS development. It is written in C and Assembly.

Copy-paste prompts

Prompt 1
Walk me through the first lesson of this OS tutorial: what does the boot sector code do, and how do I compile and test it?
Prompt 2
I want to follow this tutorial to build a minimal OS. What tools do I need to install, and what's the recommended order of lessons?
Prompt 3
Explain the interrupt handling lesson in this tutorial: how does the CPU know when a key is pressed, and how does my code respond?
Prompt 4
Show me how to extend the keyboard input code from this tutorial to capture multiple key presses and store them in a buffer.
Prompt 5
What are the known limitations and issues mentioned in this tutorial, and what modern OS development resources should I consult alongside it?
Open on GitHub → Explain another repo

Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.