THE PLATFORM HAS PURPOSE ======================== Rumpk now has a payload loading system: NPL (Nexus Payload). OUTPUT ------ [NPL] ✅ Verification PASSED [NPL] Executing payload... [NPL] ✅ Payload returned! [NPL] ✅ Bad sig rejected NPL FORMAT (128-byte header) ---------------------------- - Magic: \x7fNPL (4 bytes) - Version: 1 (1 byte) - Arch: 0xAA=ARM64, 0xEE=x86_64, 0x55=RISC-V (1 byte) - Flags: 2 bytes - Signature: 64 bytes (Ed25519 placeholder) - Body Size: 8 bytes - Reserved: 48 bytes IMPLEMENTATION -------------- core/npl.nim: - NPLHeader struct (packed, 128 bytes) - loadNpl() - validates magic, version, arch, signature - buildTestPayload() - creates test NPL in memory - Signature verification (mock: rejects 0xFF) TESTS VERIFIED -------------- 1. Valid payload: Loads and executes RET instruction 2. Bad signature: Correctly rejected (0xFF in sig[0]) 3. Cross-arch: Would reject wrong arch code PHASE SUMMARY ------------- ✅ Phase 1: Documentation (SPEC-008/009/010) ✅ Phase 2: Pure Zig libc (Freestanding Doctrine) ✅ Phase 3: Cooperative Fibers (Ping Pong) ✅ Phase 4: NPL Loader (with mock signature) → Phase 4.2: Ed25519 verification (Monocypher) → Phase 5: VisionFive 2 RISC-V hardware The unikernel can now load and execute signed payloads. Next: Real Ed25519 verification. |
||
|---|---|---|
| .. | ||
| include | ||
| README.md | ||
| cstubs.c | ||
| fiber.nim | ||
| kernel.nim | ||
| npl.nim | ||
| panicoverride.nim | ||
| ring.nim | ||
README.md
Rumpk Core (L1)
Language: Nim
Purpose: Architecture-agnostic kernel logic
Module Index
| File | Purpose |
|---|---|
kernel.nim |
Main entry point (kmain), fiber test |
fiber.nim |
Cooperative fiber abstraction |
ring.nim |
Lock-free Disruptor ring buffer |
panicoverride.nim |
Nim panic handler for freestanding |
Architecture Independence
This folder contains no architecture-specific code. All platform-specific
details are handled by the HAL layer (../hal/).
Compile-time architecture selection uses Nim's when defined():
when defined(amd64):
const CONTEXT_SIZE = 56
elif defined(arm64):
const CONTEXT_SIZE = 96
elif defined(riscv64):
const CONTEXT_SIZE = 112
Dependencies
- Imports
console_write,rumpk_haltfrom HAL (Zig L0) - Imports
cpu_switch_tofrom arch-specific assembly - Uses
mm:arcmemory management (no GC)
Build
Built via ../build.sh [aarch64|x86_64|riscv64]