code wiki / _hdl_build / nx_nishios_browser_x86.nx
nx_nishios_browser_x86.nx
buildroot/runtime/_hdl_build/nx_nishios_browser_x86.nx
about
nx_nishios_browser_x86.nx -- BROWSER-ON-ALL-OS arc, rung N4: the browser's pixels land in the NishiOS
framebuffer via EXECUTED x86 STORE INSTRUCTIONS (the draw-as-x86 seam, same move as nx_nishios_fb_x86).
N1 proved the browser RENDERS on NishiOS and N2 proved INPUT -- but the window pixels were written by
a NishiLang blit loop. This rung closes that seam one level deeper: after the boot gate, the page is
laid out + painted by the browser core into an RGB buffer (the PREP), then an AUTHORED REAL-ENCODING
x86 program (movabs imm64 / mov r32 load+store / add imm8 / mov rcx,imm32 / dec / jnz / hlt -- a
2-level strided copy loop) is EXECUTED on a sovereign mini-emu, and it is those executed `89 10`
(mov [rax],edx) stores that write EVERY byte of the browser window region of the NishiOS framebuffer,
row-strided into place. Byte-verified against a NishiLang oracle blit; the executed-store COUNT must
equal the window byte count / 4 exactly.
KAT: T1 booted off the persisted image; T2 LONG mode + banner; T3 page laid out; T4 the x86 program
ran to a clean HLT; T5 executed 32-bit stores == 465*426 exactly (every window word written by x86);
T6 window region byte-IDENTICAL to the oracle blit; T7 x86 never scribbled outside the window (chrome
pixel intact); T8 BMP exported at the exact expected size. NEG/liar-kill: T9 a corrupted store opcode
(0x89 -> 0x88, an encoding this emu does not implement) REFUSES execution and leaves the window
unwritten; T10 a 0-sector-load sibling image never reaches long mode -> nothing is drawn at all.
HONEST SEAM (stated, not hidden): layout/paint PREP is NishiLang (running the full render core as
x86-on-emu = compiling the browser itself to the emu's ISA, a far deeper rung); what this rung proves
is that the FRAMEBUFFER WRITES -- the pixels you see in the window -- were performed by real executed
x86 stores, strides and all. NishiOS-native fetch (nx_nishios_net) remains the named next rung.
NEVER-BRICK (Rule 26): writes FILE artifacts only; models INT 13h *reads*; no /dev.
expect_exit: 0 license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_browser_render.nxnx_itoa_lib.nxnx_fb.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
| 29 | const NB_MAGIC_200000: i64 = 200000 |
| 30 | const NB_MAGIC_32767: i64 = 32767 |
| 31 | const NB_MAGIC_65536: i64 = 65536 |
| 32 | const NB_MAGIC_3000000: i64 = 3000000 |
| 113 | const NB_IMG_SZ: i64 = 1024 |
| 193 | const NB_W: i64 = 640 |
| 194 | const NB_H: i64 = 480 |
| 195 | const NB_BW: i64 = 620 |
| 196 | const NB_BH: i64 = 426 |
| 197 | const NB_OX: i64 = 10 |
| 198 | const NB_OY: i64 = 38 |
| 200 | const NX86_SRC: i64 = 4096 |
| 201 | const NX86_FB: i64 = 1048576 |
| 203 | const NX86_ROWW: i64 = 465 |
| 204 | const NX86_ROWS: i64 = 426 |
functions
| 34 | func nb_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } called by 1: main |
| 39 | func nb_num(v: i64) -> i64 { nxi_out(v); return 0 } |
| 40 | func nb_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } called by 1: main |
| 41 | func nb_contains(hay: *u8, hn: i64, ndl: *u8, nn: i64) -> i64 called by 1: main |
| 47 | func nb_mode(cr0: i64, efer: i64) -> i64 { let pe: i64=cr0&1; let pg: i64=(cr0>>31)&1; let lme: i64=(efer>>8)&1; if pe==0 { return 0 } if pg==1 { if lme==1 { return 2 } } return 1 } called by 1: nb_emu_boot_disk |
| 50 | func nb_emu_boot_disk(mem: *u8, disk: *u8, entry: i64, console: *u8, clen: *i64, st: *i64) -> i64 |
| 115 | func nb_movrax(img: *u8, base: i64, o: i64, b0: i64, b1: i64, b2: i64, b3: i64) -> i64 called by 1: nb_build_image |
| 120 | func nb_build_image(img: *u8) -> i64 |
| 159 | func nb_boot_image(img: *u8, console: *u8, clen: *i64, st: *i64, loaded: *i64) -> i64 |
| 171 | func nb_str(fb: *u8, W: i64, H: i64, x: i64, y: i64, s: *u8, r: i64, g: i64, b: i64) -> i64 |
| 185 | func nb_write_file(path: *u8, data: *u8, n: i64) -> i64 |
| 209 | func nx86_run(mem: *u8, memsz: i64, entry: i64, stores: *i64) -> i64 called by 1: main |
| 265 | func nx86_movabs(code: *u8, p: i64, reg2: i64, v: i64) -> i64 called by 1: nx86_author |
| 271 | func nx86_movrcx32(code: *u8, p: i64, v: i64) -> i64 called by 1: nx86_author |
| 282 | func nx86_author(code: *u8, dst0: i64, src0: i64) -> i64 |
| 303 | func main() -> i64 |