code wiki / _hdl_build / nx_fw_boot_proof_gate.nx

nx_fw_boot_proof_gate.nx

buildroot/runtime/_hdl_build/nx_fw_boot_proof_gate.nx

5561 B125 linesdepth 6pulls 8 transitivereach 0 importersview sourcekind gate/prooftopic fw
docsdependenciesstructsconstsfunctions

about

nx_fw_boot_proof_gate.nx -- the never-brick CAPSTONE: the recovered firmware actually BOOTS. Closes the loop on a REAL artifact, EXECUTED in the sovereign emu (no qemu/laptop): corrupt the real nx_boot_uefi.efi mid-flash -> golden-recover -> UNWRAP -> RUN in nx_emu_uefi -> it prints NISHI (exit 0). REC : the corrupted flash auto-recovers from golden -> FW_RECOVERED EXACT : the recovered payload is byte-identical to the .efi -> in-process compare BOOTS : the recovered raw .efi EXECUTES + prints NISHI -> emu fork rc == 0 GREEN only if all three hold. ONE emu fork+exec (the proven br_guarded execve idiom, blocking wait): repeated fork+execs in a single process intermittently spawn-fail in this runtime, so the emu runs ONCE on the recovered image. The emu's DISCRIMINATION (it rejects corrupt code: "NOS-EXEC RED") is proven by nx_emu_uefi's own tamper-gate; the recovery rigor is the in-process REC + byte-EXACT checks here + nx_fw_real_flash_gate. Evidence -> knowledge/status/fw_boot_proof_gate.log. The emu must be pre-built: ./_offc/nx_sov_build_run.elf nx_emu_uefi Sovereign: imports the safe-flash organ (-> nx_sha256) + nx_framed_append + nx_syscalls. license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_fw_safeflash.nx nx_framed_append.nx nx_syscalls.nx nx_fw_boot_proof_gate.nx

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

main fw_puts sys_write sys_now_realtime_sec sys_mmap sys_clock_gettime_real sys_mmap ↻ fw_read sys_openat_rd sys_mmap ↻ sys_read sys_close fw_path fw_cat fw_catn sys_mmap ↻ fw_make sys_mmap ↻ fw_wr_u32 sha256_digest sys_mmap ↻ sha256_init sys_mmap ↻ sha256_k sha256_update sha256_compress_ni_blocks blk_set_byte sha256_compress sha256_compress_ni blk_word blk_byte sha256_final blk_set_byte ↻ sha256_compress ↻ fw_write_bytes sys_openat_wr sys_write ↻ sys_close ↻ fw_safe_flash fw_is_sandbox

structs

none

consts

22const BP_LOG: *u8 = "knowledge/status/fw_boot_proof_gate.log"
23const BP_EFI: *u8 = "_offc/nx_boot_uefi.efi"
24const BP_EMU_ELF: *u8 = "/tmp/nx_emu_uefi.sov.elf"

functions

27func bp_run(elf: *u8, a1: *u8) -> i64
47func bp_row(name: *u8, pass: i64) -> i64
60func main() -> i64