code wiki / _hdl_build / nx_bootcap.nx
nx_bootcap.nx
buildroot/runtime/_hdl_build/nx_bootcap.nx
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
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
| 22 | const BOOTCAP_MEM_BASE: i64 = 0x80000000 |
| 23 | const BOOTCAP_MEM_SIZE: i64 = 65536 |
| 24 | const BOOTCAP_MAX_STEPS: i64 = 100000 |
| 26 | const BOOTCAP_R_HALTED: i64 = 0 |
| 27 | const BOOTCAP_R_CODE: i64 = 1 |
| 28 | const BOOTCAP_R_STEPS: i64 = 2 |
| 29 | const BOOTCAP_R_TXN: i64 = 3 |
| 30 | const BOOTCAP_R_N: i64 = 4 |
functions
| 34 | func bootcap_run(img: *u8, ilen: i64, tx_buf: *u8, txcap: i64, res: *i64) -> i64 |
| 83 | func bootcap_load(primary: *u8, alt: *u8, lenp: *i64, outpath: *i64) -> *u8 |