code wiki / _hdl_build / _boot_stub_gate.nx
_boot_stub_gate.nx
buildroot/runtime/_hdl_build/_boot_stub_gate.nx
about
_boot_stub_gate.nx -- the K-R0 gate (kernel-up ladder rung 0). Drives the full
author->boot chain with NO mocks: runs the REAL nx_boot_stub_emit (the team authors
the stub from the spec), then runs the REAL qemu-system-riscv64 -machine virt (the
declared hardware-oracle lane, per the ladder), captures the serial output, and
asserts the K-R0 acceptance: banner "NISHI" on serial + clean exit (qemu status 0,
the SiFive finisher pass). Evidence -> knowledge/status/boot_stub.log (BOOTGATE row,
the row's ||MARK= reads it). Sovereign orchestration (fork/dup3/execve/wait4).
NOTE: the emitted stub ALWAYS writes the finisher, so qemu self-exits; no watchdog
needed for our own artifact (a watchdog is a hardening follow-up if arbitrary stubs
are ever gated). license_tier: ORIGINAL
dependencies 1 imports · 0 importers
imports: nx_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
| none |
functions
| 13 | func g_p(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 14 | func g_fp(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 } |
| 15 | func g_fn(fd: i64, v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m}; let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48;k=1}; while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1}; var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(fd,bb,k); return 0 } |
| 18 | func g_run_emit(spec: *u8) -> i64 |
| 39 | func g_run_qemu(binpath: *u8, outpath: *u8) -> i64 |
| 64 | func g_run_sov(binpath: *u8, outpath: *u8) -> i64 |
| 85 | func g_file_has(path: *u8, pat: *u8) -> i64 |
| 106 | func main() -> i64 |