A minimal x86 kernel built from scratch with the sole purpose of understanding how a machine actually executes code, from the first instruction to hardware interaction.
This project avoids abstractions and external dependencies. Every component is implemented manually to expose the real mechanics of:
- CPU execution
- memory layout
- privilege boundaries
- hardware communication
This is not a framework, and not an attempt to recreate an existing OS.
The objective is to own the execution environment completely:
- No runtime
- No standard library
- No hidden initialization
- No reliance on existing kernel code
Every step is explicit, controlled, and documented.
The kernel is developed incrementally, following the actual hardware bring-up sequence on x86.
- Execution environment setup (stack, segments)
- Memory management (segmentation → paging)
- Interrupt handling (exceptions + hardware IRQs)
- Basic device interaction (VGA, keyboard)
- Time and scheduling primitives
- Kernel entry point
- Stack initialization
- Direct VGA text output
- Basic printing utilities
- Global Descriptor Table (GDT)
- Interrupt Descriptor Table (IDT)
- PIC remapping
- Interrupt Service Routines (ISR)
- Hardware IRQ handling
- Timer (PIT)
- Keyboard input
- Paging (virtual memory)
- Address space control
- Task switching primitives
- Basic scheduler
- System call interface
boot/ # Boot and low-level entry (assembly)
kernel/ # Core kernel code (C + ASM)
docs/ # Technical documentation (per subsystem)
linker.ld # Memory layout definition
Makefile # Build system
nasmgcc(32-bit support or cross-compiler)ldmakeqemu-system-x86_64
makemake runThe kernel is loaded and executed directly without a full bootloader stack (GRUB optional).
At runtime:
- CPU begins execution at
_start - Stack is initialized manually
- Control is transferred to
kmain - Kernel interacts directly with hardware (e.g., VGA memory at
0xB8000)
All subsystems are documented under /docs.
Each document includes:
- CPU-level behavior
- Memory layout
- Implementation details
- Execution flow
- Known pitfalls
This repository is meant to be both:
- a working kernel
- a long-term technical reference
- The project targets x86 (32-bit) initially
- No external libraries are used
- All behavior is verified through QEMU
Actively developed — focus is currently on CPU control structures (GDT / IDT) and establishing a reliable interrupt handling foundation.