Kernel Version: v0.8.1 (Hardened) Architecture: x86 (32-bit Protected Mode)
Boot Standard: Legacy BIOS (Custom Bootloader)
PyramidOS is a sovereign, monolithic kernel operating system written from scratch in C and Assembly. It features a custom multi-stage bootloader, a robust memory management system, and a command-line interface inspired by the responsiveness of classic systems.
The system boots into a Protected Mode Shell with memory management, hardware interrupts, and timekeeping capabilities.
| Component | Status | Description |
|---|---|---|
| Bootloader (Stage 1/2) | โ Stable | MBR, A20 Enable, E820 Map, Kernel Header Parsing, PM Switch. |
| Kernel Entry | โ Stable | Stack setup, GDT, IDT (Exception Handling), ISR Stubs. |
| Memory (PMM/VMM) | โ Stable | Bitmap Allocator, Paging Enabled (Identity Mapped). |
| PIC Driver | โ Stable | 8259 PIC Remapped to vectors 32-47. |
| Keyboard Driver | โ Stable | Scancode Set 1 translation, Shift/Caps state, Circular Input Buffer. |
| System Timer (PIT) | โ Stable | 8253 PIT configured at 100Hz for system ticks and sleep. |
| Real-Time Clock (RTC) | โ Stable | CMOS register parsing for Wall Clock Time (Y/M/D H:M:S). |
| KShell | โ Stable | Interactive command interpreter with history and backspace support. |
| Terminal (VGA Text Mode) | โ Stable | Text Mode (80x25) with hardware cursor support. |
| CPU Idle / Power Management | โ Stable | Uses STI+HLT (cpu_idle()) to avoid busy-waiting when idle. |
| Kernel Heap | โ Stable | Doubly-linked list allocator with kmalloc/kfree and coalescing. |
| VMM | โ Stable | Paging enabled; Heap mapped to 0xD0000000. |
| Storage (ATA/PIO) | ๐ง In Progress | LBA28 PIO reads (Read-Only) + IDENTIFY-based presence detection, stricter status checks. |
| Block Layer (Registry) | โ Stable | Generic BlockDevice registry; ATA registered only when a real device is present (disk0, optional disk1). |
| DevFS (/dev) | โ Stable | Virtual device filesystem exposing /dev/disk0, /dev/disk1, /dev/null, /dev/zero. |
| Partition Discovery (MBR) | โ Stable | Parses MBR and registers disk0p1..disk0p4 block devices (read-only). |
| VFS (Foundation) | โ Stable | Static mount table + FD table; / is nullfs, /dev is devfs. |
| PyFS (Read-Only Bring-up) | ๐ง In Progress | Probes disk0p1 and mounts at /py if superblock is valid; exposes /py/superblock for verification. |
- System: Linux, WSL2, or MacOS.
- Toolchain:
gcc,ld,make,nasm. - Emulator:
qemu-system-i386.
-
Clean and Build (Release default):
make clean && makeGenerates
build/pyramidos.imgandbuild/kernel.map. -
Optional: Debug Build:
make clean && make debug -
Optional: Strict Warnings (Werror):
make clean && make STRICT=1 -
Run:
make run
This repository is currently private / all-rights-reserved. See NOTICE.
- Formatting baseline:
.editorconfig - Contribution guidance:
CONTRIBUTING.md - Ownership / review routing:
.github/CODEOWNERS
Once booted, the KShell accepts the following commands:
help: List available commands.clear: Clear the screen and reset cursor.mem: Display Physical Memory stats (Total/Free RAM).time: Display current Date and Time (from RTC).uptime: Show system running time (ticks/seconds).sleep: Pause execution for 1 second (Busy-wait test).reboot: Restart the system (via Keyboard Controller).diskread: Read and hex-dump a disk sector by LBA (e.g.,diskread 0,diskread 60).blkinfo: List registered block devices (includesdisk0p1after MBR scan).mounts: List VFS mounts (expects/dev+ optional/py).pyfs_sb: Read/py/superblockvia VFS (PyFS probe verification).diagnose: Run kernel diagnostics (PMM/Heap/ATA).crash: Force a kernel crash (for testing the panic/exception path).
/
โโโ Makefile # Master build orchestration (release/debug/strict)
โโโ NOTICE # Private / all-rights-reserved notice (no license granted)
โโโ docs/ # Strategic, Architectural, and Tactical roadmaps
โโโ boot/
โ โโโ src/legacy/ # 16-bit Assembly Bootloader (MBR + Loader)
โโโ kernel/
โโโ arch/
โ โโโ i386/ # Architecture-specific code (x86)
โ โโโ entry.asm # Kernel entry (stack + handoff to C)
โ โโโ idt.c/h # Interrupt Descriptor Table
โ โโโ idt_asm.asm # ISR/IRQ stubs
โ โโโ cpu.h # Registers + CPU helpers (cli/sti/hlt/idle)
โโโ core/ # Kernel Core Logic
โ โโโ main.c # Entry point / init ordering
โ โโโ pmm.c/h # Physical Memory Manager
โ โโโ vmm.c/h # Virtual Memory Manager
โ โโโ heap.c/h # Kernel Heap Allocator
โ โโโ debug.c/h # Panic system
โ โโโ shell.c/h # KShell logic
โ โโโ selftest.c/h # Diagnostics
โโโ drivers/ # Hardware drivers
โ โโโ pic.c/h # 8259 PIC (remap + mask control)
โ โโโ keyboard.c/h # PS/2 keyboard (buffered input)
โ โโโ timer.c/h # PIT driver
โ โโโ rtc.c/h # RTC/CMOS wall-clock time
โ โโโ ata.c/h # ATA PIO (read-only)
โ โโโ terminal.c/h # VGA text-mode terminal
โโโ lib/ # Freestanding libc-like helpers
โโโ string.c/h # Memory/string ops + atoi
- Boot Sequence: BIOS -> MBR (Stage 1) -> Loader (Stage 2) -> Protected Mode -> Kernel (
0x10000). - Initialization:
- PMM: Reads E820 map, initializes Bitmap at
0x20000. - IDT: Sets up 256 interrupt vectors (Exceptions + IRQs).
- PIC: Remaps IRQs to avoid CPU conflicts.
- VMM: Identity maps lower 4MB, enables Paging (CR0).
- HAL: Initializes Timer (100Hz) and Keyboard.
- PMM: Reads E820 map, initializes Bitmap at
- Runtime: The kernel yields control to
shell_run(), which blocks on buffered keyboard input while the CPU idles viacpu_idle()(STI+HLT).
- Current: Storage consumption bring-up: DevFS + MBR partitions + PyFS read-only probe.
- Next Up: PyFS real directory/file reads + VFS-backed shell commands (
ls,cat, etc).
See docs/ for detailed Roadmap Layers.