Skip to content

AditS-H/BlitzOS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

BlitzOS - A Modern x86-64 Operating System

Building a high-performance operating system from scratch with multitasking support

πŸŽ‰ Project Status: MULTITASKING WORKING! πŸŽ‰

Current Achievement: Full cooperative multitasking with 3+ concurrent processes, round-robin scheduling, and context switching. See A, B, C characters printing in rotation!

οΏ½ Documentation Structure

Essential Reading (Start Here)

  • [whole documentation/INDEX.md](whole documentation/INDEX.md) - Complete documentation index and navigation
  • [whole documentation/achieved.md](whole documentation/achieved.md) - βœ… All completed features
  • [whole documentation/OS_QUICK_REFERENCE.md](whole documentation/OS_QUICK_REFERENCE.md) - Strategic overview & current status
  • [whole documentation/learning.md](whole documentation/learning.md) - Complete implementation guide (3,500+ lines with multitasking!)
  • [whole documentation/OS_PROGRESS_TRACKING.md](whole documentation/OS_PROGRESS_TRACKING.md) - Feature comparison matrix

Strategic Documents

  • [whole documentation/OS_COMPETITIVE_ADVANTAGE.md](whole documentation/OS_COMPETITIVE_ADVANTAGE.md) - Why BlitzOS is better than Linux for specific use cases
  • [whole documentation/architecture.md](whole documentation/architecture.md) - Architecture decisions and technology stack

πŸ—οΈ Architecture Decisions

Design Philosophy: Unix-like monolithic kernel
Target Architecture: x86-64 (64-bit long mode)
Primary Language: C (92%) + Assembly x86-64 (8%)
Build System: GNU Make + GCC cross-compiler
Testing Platform: QEMU emulator

Why These Choices?

  • Unix-like: Proven design, excellent learning resources, everything-is-a-file simplicity
  • Monolithic kernel: Simpler to implement initially, better performance, easier debugging
  • x86-64: Widespread hardware support, comprehensive documentation, modern architecture
  • C: Industry standard, direct hardware access, no runtime overhead

πŸš€ Quick Start

Prerequisites

  1. WSL2 (Windows Subsystem for Linux) or native Linux
  2. Cross-compiler toolchain (x86_64-elf-gcc)
  3. QEMU emulator
  4. NASM assembler
  5. Git for version control

Installation

# Install WSL2 (PowerShell as Administrator)
wsl --install -d Ubuntu

# Inside WSL, install development tools
sudo apt update
sudo apt install build-essential nasm qemu-system-x86 gdb git
sudo apt install libgmp-dev libmpfr-dev libmpc-dev texinfo

Build & Run Your Kernel

# From Windows (WSL2):
wsl -e bash -c "cd /mnt/c/Users/over9/Desktop/Coding/OS && make clean && make all"

# Or from inside WSL:
cd ~/OS  # or wherever you cloned
make all              # Compile kernel and create BlitzOS.iso
make run              # Run in QEMU and watch multitasking!
make run-serial       # Run in QEMU with serial output
make debug            # Debug with GDB
make clean            # Remove build artifacts
make help             # Show all available commands

πŸ“– Learning Path & Current Progress

βœ… Phase 1: Foundation (COMPLETE)

  • βœ… Environment setup (cross-compiler, QEMU, build system)
  • βœ… Bootloader (GRUB2 + Multiboot2)
  • βœ… Basic kernel with VGA text output
  • βœ… Interrupt handling (GDT, IDT, ISR)

βœ… Phase 2: Memory Management (COMPLETE)

  • βœ… Physical memory manager (bitmap-based)
  • βœ… Virtual memory (4-level paging)
  • βœ… Kernel heap allocator (kmalloc/kfree)
  • βœ… Memory protection via paging

βœ… Phase 3: Process Management & Multitasking (COMPLETE!) πŸŽ‰

  • βœ… Process structures (Task Control Block - TCB)
  • βœ… Context switching (save/restore CPU registers)
  • βœ… Scheduler implementation (round-robin)
  • βœ… Cooperative multitasking
  • βœ… Process creation and lifecycle
  • βœ… DEMO: 3 concurrent processes printing AAABBBCCC...

⏳ Phase 4: Preemptive Multitasking (PLANNED)

  • ⏳ Timer interrupt forced context switches
  • ⏳ Process priorities
  • ⏳ Sleep/wake mechanisms
  • ⏳ Preemptive scheduler improvements

⏳ Phase 5: File System (NOT STARTED)

  • ⏳ VFS layer design
  • ⏳ Basic filesystem implementation
  • ⏳ File operations
  • ⏳ Directory management

⏳ Phase 6: Advanced Drivers (NOT STARTED)

  • ⏳ Disk driver (ATA/AHCI)
  • ⏳ Serial port for debugging
  • ⏳ Network stack (future)
  • ⏳ GPU support (future)

Phase 6: User Space (Weeks 21-24)

  • ELF loader
  • Standard C library port
  • Shell implementation
  • Basic utilities

Phase 7: Advanced Features (Weeks 25+)

  • Multi-core support (SMP)
  • Network stack
  • Security features
  • Performance optimization

πŸŽ“ Essential Resources

Must-Read

Reference Operating Systems

  • xv6 - MIT's educational Unix (9,000 lines, perfect for learning)
  • Linux - Industry reference (start with older 2.6 versions)
  • SerenityOS - Modern from-scratch OS with excellent documentation

Community Support

  • Reddit: r/osdev
  • Discord: OSDev server
  • Forum: forum.osdev.org
  • IRC: #osdev on Libera.Chat

πŸ› οΈ Development Tools

  • Compiler: GCC (x86_64-elf-gcc cross-compiler)
  • Assembler: NASM
  • Linker: GNU ld
  • Debugger: GDB
  • Emulator: QEMU
  • Version Control: Git
  • Editor: VS Code (recommended) / Vim / Emacs

πŸ› Common Issues

  • Black screen: Check VGA memory address (0xB8000), verify code reaches output
  • Triple fault: Usually GDT/IDT setup issue, use Bochs for detailed debugging
  • Cross-compiler not found: Add to PATH, check installation
  • Build errors: Verify linker script syntax, check Makefile dependencies

See troubleshooting.md for detailed solutions.

πŸ“ Project Structure (Planned)

OS/
β”œβ”€β”€ boot/                   # Bootloader code
β”œβ”€β”€ kernel/                 # Core kernel
β”‚   β”œβ”€β”€ arch/               # Architecture-specific code
β”‚   β”œβ”€β”€ mm/                 # Memory management
β”‚   β”œβ”€β”€ process/            # Process management
β”‚   └── fs/                 # File system
β”œβ”€β”€ drivers/                # Device drivers
β”œβ”€β”€ lib/                    # Kernel library functions
β”œβ”€β”€ include/                # Header files
β”œβ”€β”€ userspace/              # User programs and shell
β”œβ”€β”€ build/                  # Build artifacts
β”œβ”€β”€ docs/                   # Documentation
β”œβ”€β”€ tools/                  # Development utilities
└── whole documentation/    # All the ReadMe with whole structure 

🎯 Current Status

Status: βœ… Kernel Foundation Complete (v0.5 - Post-Heap Edition)
Lines of Code: ~5,000 lines kernel + 6,000 lines documentation
What Works:

  • βœ… Boot system (GRUB2 + Multiboot2, 32β†’64-bit transition)
  • βœ… Memory management (PMM, 4-level paging, kernel heap with kmalloc/kfree)
  • βœ… Interrupts (GDT, IDT, PIC, ISR/IRQ handlers)
  • βœ… Drivers (VGA text-mode, PIT timer @ 100Hz, PS/2 keyboard)
  • βœ… Interactive shell (keyboard echo)

Next Milestone: Process scheduler & multitasking
Timeline: Following 3-month roadmap to production

🀝 Contributing

This is a personal learning project, but suggestions and feedback are welcome! Feel free to:

  • Report issues or ask questions
  • Suggest improvements to documentation
  • Share your own OS development experiences

πŸ“ Development Journal

Document your daily progress, challenges, and solutions. This will be invaluable for:

  • Tracking learning progress
  • Debugging similar issues later
  • Helping others who follow this path
  • Building a portfolio of your work

πŸ† Milestones

  • Environment setup complete
  • First bootable kernel
  • VGA text output working
  • Keyboard input functional
  • Interrupt system operational (GDT, IDT, PIC)
  • Timer driver working (PIT @ 100Hz)
  • Memory management operational (PMM, paging, heap)
  • Interactive shell (keyboard echo)
  • Process scheduler & multitasking
  • Virtual memory & per-process address spaces
  • System calls interface
  • User mode execution
  • File system reads files
  • ELF program loader
  • Boots on real hardware

πŸ“œ License

This educational project and its documentation are for learning purposes. Code will be released under MIT License once substantial implementation exists.

🌟 Acknowledgments

Standing on the shoulders of giants:

  • The OSDev community
  • xv6 and MINIX for educational inspiration
  • Linux and BSD for production references
  • Countless tutorials and guides shared freely

πŸ“Š Project Statistics

Kernel Code:         ~5,000 lines
Documentation:       ~6,000 lines
Total Project:       ~11,000 lines
Comparison:          0.018% of Linux kernel size
Boot Time (QEMU):    <100ms
Memory Footprint:    ~2-5 MB

Key Achievement: Complete understanding of every single line of code in the OS. No black boxes, no mysteries.


Remember: Every expert OS developer started as a beginner. The journey of a thousand lines begins with a single boot sector! πŸš€

Last Updated: December 16, 2025
Version: 0.5 - Post-Heap Edition

About

A high-performance 64-bit OS built from scratch, engineered for speed and simplicity. Boots in <100ms, 5,400x smaller than Linux (5K vs 27M lines). Complete with memory management, interrupts, drivers, and kernel heap. Perfect for embedded systems, real-time applications, and learning OS internals. No bloat. No mysteries. Pure performance.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors