LeveretOS_

A small educational operating system built completely from scratch, with each new addition split into a separate lesson. Every change is commented for beginners, so this repository doubles as a step-by-step guide to how an OS actually works, starting from the very first instruction that runs at boot.

The idea

Each lesson has its own numbered folder and adds one new feature on top of the last. Code that is reused from earlier lessons will be left without educative comments, while keeping other comments. New or changed code will contain comments to guide you through each part.

Why "LeveretOS"?

A leveret is a baby hare , small, quick, and one of the fastest-growing young animals around. It felt like the right mascot for an OS that started as almost nothing and grows a little better with every lesson.

A leveret, a young hare, resting in grass

Photo by Tony Stoddard on Unsplash.

Lessons so far

#LessonWhat it adds
01Hello WorldBooting via GRUB and writing text to VGA memory
02Text OutputA moving cursor for typing, putchar/print, newlines and wrapping
03Text InputReading the keyboard: scancodes, getchar, read_line
04Print NumbersTurning integers into on-screen digits
05String helpersCreate helpers for strings and memory

Building and running a lesson

Each lesson folder is self-contained and includes a build.sh that assembles the bootloader, compiles the kernel, makes a bootable ISO, and launches it in QEMU. You will need nasm, a 32-bit-capable g++, grub-mkrescue, xorriso, and qemu-system-i386 (on Windows, a Linux environment such as WSL works well).

A good guide for setting up the necessary software to be able to boot: OSDev Bare Bones.

The goal

The current goal is to create an educational OS that can connect to the web.