## Major Features ### 1. Dynamic ELF64 Binary Loading - Implemented ELF parser with full header validation (core/loader/elf.nim) - Created kexec() loader supporting PT_LOAD segment mapping - Added BSS initialization and data copying from VFS - Assembly trampoline (rumpk_enter_userland) for userland entry ### 2. Syscall Infrastructure - Added CMD_SYS_EXEC (0x400) for consciousness swapping - Integrated exec command in NipBox shell - Implemented syscall routing through command ring - Added provenance tracking via SipHash ### 3. Test Binary & Build System - Created hello.c test program for alien binary execution - Automated compilation and initrd inclusion in build.sh - Added libnexus.h header for standalone C programs ### 4. VFS Integration - Implemented TarFS file cursor system for sequential reads - Fixed infinite loop bug in cat command - Added debug logging for VFS mount process ## Technical Improvements ### Memory Management - Fixed input ring null pointer dereference - Implemented CMD_ION_FREE syscall for packet reclamation - Resolved memory leak in input/output pipeline - Added FileHandle with persistent offset tracking ### ABI Stability - Split kprint into 1-arg (Nim) and kwrite (C ABI) - Fixed cstring conversion warnings across codebase - Corrected RISC-V assembly (csrw sie, zero) ### Documentation - Comprehensive Phase 8 documentation (docs/PHASE-8-ELF-LOADER.md) - Detailed implementation notes and debugging status ## Current Status ✅ ELF parser, loader, and syscall infrastructure complete ✅ Test binary compiles and embeds in VFS ✅ Shell integration functional 🔧 Debugging command ring communication (syscall not reaching kernel) ## Files Changed Core: - core/loader.nim, core/loader/elf.nim (NEW) - core/kernel.nim, core/ion.nim (syscall handling) - core/fs/tar.nim (file cursor system) - hal/arch/riscv64/switch.S (userland trampoline) Userland: - npl/nipbox/nipbox.nim (exec command) - libs/membrane/libc_shim.zig (syscall implementation) - libs/membrane/ion.zig (command ring API) Build & Test: - build.sh (hello.c compilation) - rootfs/src/hello.c, rootfs/src/libnexus.h (NEW) - apps/subject_entry.S (NEW) ## Next Steps 1. Debug SysTable and command ring communication 2. Verify ION fiber polling of chan_cmd 3. Test full ELF loading and execution flow 4. Add memory protection (future phase) Co-authored-by: <ai@voxisforge.dev> |
||
|---|---|---|
| .zig-cache | ||
| apps | ||
| boot | ||
| core | ||
| docs | ||
| hal | ||
| io | ||
| libs | ||
| npl | ||
| rootfs | ||
| src/npl/system | ||
| vendor/lwip | ||
| 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