THE GHOST IN THE MACHINE IS EXORCISED ====================================== Rumpk now builds with ZERO C source files. All libc functions are implemented in pure Zig. WHAT CHANGED ------------ - NEW: hal/stubs.zig - Pure Zig libc implementation - memcpy, memset, memmove, memcmp - strlen, strcmp, strcpy - malloc, free, realloc, calloc (bump allocator) - printf, puts, putchar (route to UART) - exit, abort (halt CPU) - signal, raise (no-op stubs) - REMOVED: core/cstubs.c dependency from build - C code is now only Nim's generated IR - UPDATED: kernel.nim - Removed malloc/free/realloc exports - Now imports from Zig stubs - UPDATED: build.sh - Compiles hal/stubs.zig separately - Links stubs.o with hal.o and nimcache/*.o DOCTRINE DOCUMENT ----------------- - .agents/steering/FREESTANDING-DOCTRINE.md - Codifies the 'Pure Zig ABI' principle - Documents build requirements - Lists all exported symbols VERIFICATION ------------ $ file build/rumpk.elf ELF 64-bit LSB executable, ARM aarch64, statically linked $ qemu-system-aarch64 -M virt -kernel build/rumpk.elf [Rumpk L0] Zig HAL Initialized [Rumpk L1] Nim Kernel Alive! [Rumpk L1] The Rubicon is crossed. [Rumpk L1] Zig + Nim = Sovereign Metal. This proves: - POSIX is optional - GCC is optional - glibc/musl is optional - We are the standard library now |
||
|---|---|---|
| .zig-cache | ||
| boot | ||
| core | ||
| hal | ||
| io | ||
| README.md | ||
| build.sh | ||
| build.zig | ||
| run.sh | ||
README.md
Rumpk: The Modular Unikernel
"The Kernel is a Library. The App is the OS."
Status: EXPERIMENTAL
Languages: Zig (L0) + Nim (L1)
Design: POSIX-hostile, Military-grade
Directory Structure
rumpk/
├── boot/ [L0] Entry & Architecture (Zig/Asm)
│ ├── start.S Multiboot2/EFI entry point
│ └── arch/ Architecture-specific code
├── hal/ [L0] Hardware Abstraction (Zig)
│ ├── mm.zig Physical/Virtual Memory
│ ├── irq.zig Interrupt handling
│ ├── serial.zig UART/Early logging
│ └── abi.zig C-ABI export to Nim
├── core/ [L1] Logic (Nim)
│ ├── kernel.nim kmain() entry
│ ├── sched.nim LWKT Scheduler
│ ├── fiber.nim Fiber/Context management
│ └── ring.nim Disruptor buffer
├── sys/ [L2] ABI Glue
│ └── syscall.zig System call handlers
├── payload/ [L3] NPL/NPK Loaders
│ └── loader.nim Signature verification
└── io/ I/O Subsystem
└── governor.nim Adaptive War/Peace mode
Key Features
- Adaptive I/O: War Mode (polling) ↔ Peace Mode (interrupts)
- Disruptor Ring: Lock-free inter-fiber communication
- SipHash IDs: Collision-resistant process identification
- Ed25519: Only signed code executes
Specifications
Build (Coming Soon)
cd core/rumpk
zig build # Build L0 HAL
nimble build # Build L1 Logic