code wiki / _hdl_build / nx_fw_robust_gate.nx
nx_fw_robust_gate.nx
buildroot/runtime/_hdl_build/nx_fw_robust_gate.nx
about
nx_fw_robust_gate.nx -- proves S-class never-brick holds in SUBOPTIMAL conditions.
Fault-injects a crash at EVERY interruption point of the A/B + factory + atomic-commit flash and
asserts rf_select() still returns a BOOTABLE image -- i.e. the device is never bricked no matter
where power is lost; plus a teeth neg-control proving rf_select is honest when truly hopeless:
T0 clean-commit : a clean flash commits the inactive bank -> FW_OK + selectable + active flipped
F1 powerloss-mid-write : crash while writing the inactive bank -> HELD, active retained + selectable
F2 powerloss-pre-commit: crash after verify, before the selector flip-> old bank selected + selectable
F3 powerloss-at-commit : crash at/after the atomic selector flip -> new bank selected + selectable
F4 double-fault : BOTH banks dead (e.g. bad flash + crash) -> immutable FACTORY + selectable
F5 selector-lost : the selector itself is corrupt/missing -> default bank + selectable
N1 truly-hopeless (teeth): banks AND factory all gone -> rf_select == null (NOT selectable)
GREEN only if T0,F1,F2,F3,F4,F5 are selectable AND N1 is not. Evidence -> knowledge/status/fw_robust_gate.log.
Sovereign: imports the robust-flash organ (-> nx_fw_safeflash -> nx_sha256) + nx_framed_append + nx_syscalls.
license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_fw_robust_flash.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
| 22 | const RG_LOG: *u8 = "knowledge/status/fw_robust_gate.log" |
| 23 | const RG_FAC: *u8 = "FACTORY-immutable-recovery-anchor" |
| 24 | const RG_GOOD: *u8 = "NISHI-fw-current-good-image" |
| 25 | const RG_NEW: *u8 = "NISHI-fw-new-candidate-image" |
functions
| 27 | func rg_len(s: *u8) -> i64 { var i: i64 = 0; while s[i] != 0 as u8 { i = i + 1 } return i } called by 1: main |
| 30 | func rg_garbage(path: *u8) -> i64 |
| 36 | func rg_row(name: *u8, pass: i64) -> i64 |
| 49 | func main() -> i64 |