Skip to content
Mohiuddin Khan Inamdar edited this page Jun 21, 2026 · 1 revision

MyOS-Simple Wiki

A field guide to building a bare-metal x86 operating system from a 512-byte boot sector up to a protected-mode C system with a shell, a clock, processes, and a calculator.

This wiki is the companion reference for MyOS-Simple — a progressive, five-stage OS tutorial. The project's README.md tells you what each stage is; this wiki explains how and why every mechanism works, down to the byte. Every article is checked against the actual source in this repository and cites it as path:line.

💡 Tidbit: Nothing in this project depends on an existing OS at runtime. From the first 512 bytes onward, the only thing beneath your code is the BIOS — and by Stage 2, not even that.

Start here

If you want to… Go to
Boot something in two minutes Building and running
Follow the story stage by stage Stage 12345
Understand one idea deeply Concepts below
Look up a number, port, or byte Reference below
Extend the OS yourself Writing your own stage

The five stages

# Stage Mode What it adds
1 Assembly boot sector 16-bit real Boot, BIOS print, color + keyboard variant
2 C kernel in protected mode 32-bit protected Bootloader, GDT, real→protected switch, C kernel, direct VGA
3 Interactive shell 32-bit protected Polled keyboard, command interpreter (5 commands)
4 Clock, processes, calculator 32-bit protected CMOS RTC, process model, fixed-point calc, history/tab/aliases (20 commands)
5 The stabilized release 32-bit protected Consolidated command set (18), committed build artifacts

Concepts

The theory, one idea per page. Read these alongside the stage that introduces them.

Firmware & boot

Into protected mode

Talking to hardware

What an OS does

Reference

Dense, authoritative lookups.

Guides

How to read this wiki

The stages are a narrative; the concepts are the encyclopedia behind it. The most rewarding path is to read a stage page, then chase its links into the concept pages whenever you want the full theory, and keep the reference pages open in another tab.

💡 Tidbit: The hardest leap in the whole tutorial is not the C — it is getting the machine into a state where C can run at all. That is the entire job of Stage 2: a GDT, the protected-mode switch, and a fixed load address.

⚠️ Caveat: This is a teaching OS. The process scheduler is an instructive model — the register-level context switch is described but not performed — and several shortcuts (no A20 handling, no RTC update-race guard, fixed sector counts tuned for QEMU) are documented honestly on the relevant pages rather than hidden. Learn the shape here; learn the production details elsewhere.

Clone this wiki locally