code wiki / _hdl_build / nx_uefi_ovmf_oracle.nx
nx_uefi_ovmf_oracle.nx
buildroot/runtime/_hdl_build/nx_uefi_ovmf_oracle.nx
about
nx_uefi_ovmf_oracle.nx -- BENCH-ONLY ORACLE (operator law 2026-07-20).
THE THIRD REFERENCE FOR THE UEFI LANE. nx_boot_uefi AUTHORS the EFI image and nx_emu_uefi
EXECUTES it -- but both are OURS, so a GREEN from that pair proves the pair is self-consistent,
never that real firmware agrees. ("A TWO-WAY COMPARISON ATTRIBUTES THE INCUMBENT'S ERROR TO
YOU -- BUILD THE THIRD REFERENCE ONCE AND REUSE IT AT EVERY SCALE.") The third reference is
EDK2/OVMF: an independent UEFI implementation nobody here wrote.
This organ does NOT run qemu (qemu is a foreign binary and lives only on the laptop; the NAS
has neither qemu nor OVMF -- measured 2026-08-08). It is the RULER: it takes the framebuffer
real firmware actually produced (a qemu `screendump` P6 PPM) and the framebuffer the sovereign
emulator modelled (`nx_emu_uefi --shot` 24-bit BMP) and compares them PIXEL FOR PIXEL, plus
re-derives nx_emu_uefi's own fb_measure statistics over the FOREIGN buffer so both engines are
judged by ONE ruler on ONE scale.
Orientation/channel order are NOT assumed: PPM is top-down RGB, BMP is bottom-up BGR, and the
transform is applied explicitly. Geometry comes FROM each file's own header, never from a
constant -- a comparator that trusts the writer's constants is one implementation, not two.
Usage: nx_uefi_ovmf_oracle <ovmf.ppm> <sov.bmp>
nx_uefi_ovmf_oracle selftest (teeth, incl. a planted-difference negative control)
Exit: 0 GREEN (dims agree AND zero differing pixels) | 1 RED | 3 UNPROVEN (could not read)
-- the third state exists so "I could not look" never reports as "it is broken".
Log -> knowledge/status/nishi_os.log, canonical verdict= on the LAST field (positional anchor).
Sovereign: syscalls only, no gcc/.sh. license_tier: ORIGINAL
dependencies 1 imports · 0 importers
imports: nx_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
| 27 | const OVO_MAGIC_4096: i64 = 4096 |
| 29 | const OVO_MAXW: i64 = 8192 |
| 30 | const OVO_MAXH: i64 = 8192 |
| 33 | const O_W: i64 = 0 |
| 34 | const O_H: i64 = 1 |
| 35 | const O_TOTAL: i64 = 2 |
| 36 | const O_EQUAL: i64 = 3 |
| 37 | const O_DIFF: i64 = 4 |
| 38 | const O_FDX: i64 = 5 |
| 39 | const O_FDY: i64 = 6 |
| 40 | const O_COLOR: i64 = 7 |
| 41 | const O_MATCH: i64 = 8 |
| 42 | const O_ZEROS: i64 = 9 |
| 43 | const O_TRANS: i64 = 10 |
functions
| 45 | func o_p(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 46 | func o_fp(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 } |
| 47 | func o_fn(fd: i64, v: i64) -> i64 |
| 57 | func o_fx(fd: i64, v: i64) -> i64 |
| 64 | func o_eq(a: *u8, b: *u8) -> i64 called by 1: main |
| 70 | func rd32(b: *u8, o: i64) -> i64 called by 1: fb_compare |
| 77 | func ppm_ws(b: *u8, len: i64, ip: *i64) -> i64 called by 1: fb_compare |
| 102 | func ppm_int(b: *u8, len: i64, ip: *i64) -> i64 called by 1: fb_compare |
| 124 | func fb_compare(pp: *u8, plen: i64, bm: *u8, blen: i64, out: *i64) -> i64 |
| 216 | func mk_ppm(b: *u8, w: i64, h: i64) -> i64 called by 1: ovo_selftest |
| 230 | func mk_bmp(b: *u8, w: i64, h: i64) -> i64 called by 1: ovo_selftest |
| 260 | func ovo_selftest() -> i64 |
| 350 | func main(argc: i64, argv: *i64) -> i64 |