A minimalistic, bare-metal 32-bit x86 operating system kernel built from scratch in C and Assembly.
This project was started as a way to bridge the gap between Operating Systems class theory and actual, bare-metal implementation.
- Environment Setup: Configured a native
i686-elfcross-compiler toolchain on an M1 Mac (Apple Silicon). - The Boot Stub: Wrote a Multiboot-compliant Assembly stub (
boot.s) to interface with the bootloader and set up the C stack. - The Bare-Bones Kernel: Implemented a minimal C kernel (
kernel.c) that bypasses the standard library and prints directly to physical memory (VGA text buffer at0xB8000). - Memory Layout: Configured a custom linker script (
linker.ld) to load the kernel at the standard1MBmark. - Build Automation: Wrote a
Makefileto automatically assemble, compile, link, and boot the OS inside the QEMU emulator.
- VGA Text Driver: Upgrade the hardcoded terminal output into a full C driver that handles newlines (
\n), cursor movement, and screen scrolling. - CPU Architecture: Set up the Global Descriptor Table (GDT) and the Interrupt Descriptor Table (IDT).
- Hardware Interrupts: Write Interrupt Service Routines (ISRs) to handle keyboard input and timer ticks.
- Bootable ISO: Pack the kernel into a bootable CD-ROM image (
.iso) using GRUB.
This project is being built with the help of the following incredible community resources:
- The Little OS Book: My primary step-by-step guide for implementing the C kernel.
- The OSDev Wiki: The ultimate reference manual for hardware specifics and bare-metal programming.
- Writing a Simple OS from Scratch: Used as a theoretical companion to understand the "why" behind x86 hardware behavior.