2 min read
How to make an OS

Building an OS while understanding how it works. As of now, this is just me logging my progress as I cross checkpoints set by myself.

I might paste my in detail notes in here later, avoiding it now to reduce the clutter.

1. Simple Bootloader

source code

Goals :

✅ Fits within 512 bytes and contains the boot signature (0xAA55)

✅ Basic screen output (using INT 10h)

✅ Simple message display routine

✅ Build script

Takeaways :

Setup assembler and emulator. Wrote first assembly code. Deep dive into the boot process

2. Simple Kernel

source code

Goals :

✅ Custom bootloader to load kernet at far address 0x10000

✅ Setup global descriptor table (GDT)

✅ Switch from read mode to protected mode

✅ Clear screen and print white on black

Takeaways :

Have to be very careful about memory.

3. Basic I/O

source code

Goals :

✅ Write a VGA text-mode driver for output

✅ Clear screen, place character, handle newline, scroll

✅ Read scancodes via ports 0x60/0x64, map them to ASCII using a lookup

Takeaways :

Tired of assembly, transition to C soon.

4. Transition to C

Goals :

◻ Setup minimal C enviroment (stack, calling)

◻ Linker script

◻ Memory detection

◻ Physical memory allocator (bitmap)

◻ Basic heap allocation (malloc/free)