code wiki / _hdl_build / nx_bootcap.nx

nx_bootcap.nx

buildroot/runtime/_hdl_build/nx_bootcap.nx

4589 B90 linesdepth 5pulls 16 transitivereach 4 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_bootcap.nx -- ONE boot-and-capture primitive for every organ that needs to know what the live kernel actually SAID. WHY: measuring a kernel means booting the ARTIFACT and reading its serial -- not parsing a log ABOUT the artifact, which can be stale, written by a different build, or absent entirely. That boot-and-capture block had already been copy-pasted into nx_nishios_kernel_gate and nx_kernel_adoption and was about to land in nx_kernel_census as a third copy; three copies of a measurement primitive is three chances for the rulers to silently disagree about what booted. Also owns the TWO-ROOTS resolution: the buildroot keeps the image under runtime/_hdl_build/ while the live serving root keeps it at ./ -- one name, two roots. Callers get the resolved path back so they can PRINT which artifact they actually measured; a ruler that will not say which artifact it read is not reporting a measurement. license_tier: ORIGINAL

dependencies 6 imports · 4 importers

rv64im_min_sim.nx rv64im_min_csr.nx rv64im_min_clint.nx rv64im_min_uart.nx rv64im_min_virtio.nx rv64im_min_nvme.nx nx_bootcap.nx nx_boot_run_sov.nx nx_kernel_adoption.nx nx_kernel_census.nx nx_nishios_kernel_gate.nx

imports: rv64im_min_sim.nxrv64im_min_csr.nxrv64im_min_clint.nxrv64im_min_uart.nxrv64im_min_virtio.nxrv64im_min_nvme.nx

imported by: nx_boot_run_sov.nxnx_kernel_adoption.nxnx_kernel_census.nxnx_nishios_kernel_gate.nx

structs

none

consts

22const BOOTCAP_MEM_BASE: i64 = 0x80000000
23const BOOTCAP_MEM_SIZE: i64 = 65536
24const BOOTCAP_MAX_STEPS: i64 = 100000
26const BOOTCAP_R_HALTED: i64 = 0
27const BOOTCAP_R_CODE: i64 = 1
28const BOOTCAP_R_STEPS: i64 = 2
29const BOOTCAP_R_TXN: i64 = 3
30const BOOTCAP_R_N: i64 = 4

functions

34func bootcap_run(img: *u8, ilen: i64, tx_buf: *u8, txcap: i64, res: *i64) -> i64
83func bootcap_load(primary: *u8, alt: *u8, lenp: *i64, outpath: *i64) -> *u8
called by 2: mainmain calls 1: sys_read_file