code wiki / _hdl_build / nx_fw_safeflash_gate.nx
nx_fw_safeflash_gate.nx
buildroot/runtime/_hdl_build/nx_fw_safeflash_gate.nx
about
nx_fw_safeflash_gate.nx -- THE REFEREE for the never-brick firmware flash.
Proves fw_safe_flash upholds the NEVER-BRICK invariant (active is BOOTABLE after every flash)
against deliberate failures, AND that each guard actually fires (no-fabricated-green):
T1 good-flash : valid new image, clean write -> FW_OK + active bootable
N1 reject-bad : the SOURCE image is corrupt -> FW_REJECTED_PRE + active bootable (untouched)
N2 mid-corrupt : write injected with corruption -> FW_RECOVERED + active bootable (from golden)
N3 no-anchor : golden (recovery copy) is corrupt -> FW_REFUSED_NO_ANCHOR + active bootable (untouched)
N4 host-path : active path is NOT under /tmp/ -> FW_SANDBOX_VIOLATION (cannot touch host)
INV never-brick : active is BOOTABLE after T1,N1,N2,N3 (the headline guarantee)
GREEN only if all six hold. Evidence -> knowledge/status/fw_safeflash_gate.log.
Sovereign: imports the organ + nx_framed_append + nx_syscalls (no gcc). license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_fw_safeflash.nxnx_framed_append.nxnx_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
| 19 | const FWSF_LOG: *u8 = "knowledge/status/fw_safeflash_gate.log" |
| 20 | const FWSF_GOOD: *u8 = "GOLDEN-ANCHOR-firmware-v1-immutable-recovery-copy" |
| 21 | const FWSF_NEW: *u8 = "NEW-firmware-v2-candidate-image-being-flashed-in" |
functions
| 23 | func et_len(s: *u8) -> i64 { var i: i64 = 0; while s[i] != 0 as u8 { i = i + 1 } return i } called by 1: main |
| 25 | func et_row(name: *u8, pass: i64) -> i64 |
| 38 | func main() -> i64 |