code wiki / _hdl_build / nx_spore_min_test.nx
nx_spore_min_test.nx
buildroot/runtime/_hdl_build/nx_spore_min_test.nx
about
nx_spore_min_test.nx -- the minimal SPORE, and it MEASURES ITS OWN footprint.
The spore is the tiniest viable bootstrap: it carries just the trust core it
needs to safely pull + verify the first seed pieces (the FNV-1a piece hash =
germination integrity), and nothing else. Because a NishiLang binary is a
STATIC, libc-FREE, OS-runtime-FREE ELF -- just machine code + raw syscalls --
the spore is KILOBYTES, not the megabytes a runtime-dependent stack needs.
THIS is what makes "a USB drive as a proper computer" real: the bootstrap owes
nothing to a host OS/runtime.
The spore reads its OWN ELF size (/proc/self/exe, lseek SEEK_END) -- sovereign
self-awareness of its footprint -- and gates that it stays under budget.
Known answer: prints "spore=<bytes>" and exit 0 iff the trust core works AND
the footprint is tiny (< 16 KB).
dependencies 1 imports · 0 importers
imports: nx_spore_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 22 | const SPORE_BUDGET: i64 = 12288 // 12 KB ceiling on the bootstrap |
| 23 | const FNV_OFFSET: i64 = 0 - 3750763034362895579 // 0xcbf29ce484222325 |
| 24 | const FNV_PRIME: i64 = 1099511628211 // 0x100000001b3 |
| 25 | const SEEK_END: i64 = 2 |
functions
| 27 | func sp_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } called by 1: main |
| 28 | func sp_hash(s: *u8, len: i64) -> i64 called by 1: main |
| 34 | func _emit(name: *u8, v: i64) -> i64 |
| 44 | func main() -> i64 |