code wiki / _hdl_build / nx_nishios_browser.nx
nx_nishios_browser.nx
buildroot/runtime/_hdl_build/nx_nishios_browser.nx
about
nx_nishios_browser.nx -- BROWSER-ON-ALL-OS arc, rung N1: the Nishi browser renders ON NishiOS.
Operator (2026-07-02): "finish getting our nishi browser to s class exceed on all OSs including our
future nishi os." The browser already runs on Linux (nx_browser, X11/WSLg) and native Windows
(nishi.exe PE). This rung puts the SAME OS-agnostic render core (nx_browser_render: br_layout ->
CSS cascade -> box layout -> br_draw_fb paint) onto NISHIOS: it boots the persisted NishiOS image on
the sovereign x86 emu (same unified boot-disk emu proven in nx_nishi_usb_longmode/_desktop), and ONLY
because the disk-loaded kernel reached LONG mode does the browser render a real HTML page and
composite it into the NishiOS desktop framebuffer (nx_fb). Export = knowledge/status/
nishios_browser.bmp + .html = one picture of "boot NishiOS -> open the Nishi browser".
KAT: T1 booted off the persisted image (INT 13h: 0x8000 0->0xBE); T2 disk-loaded kernel reached LONG
mode (mode==2); T3 UART banner == 'NishiOS'; T4 REAL layout (page.ok, box count, page height);
T5 h1 background bar pixels present in the composited desktop; T6 link-blue pixels present;
T7 body-text pixels present; T8 BMP exported at the exact expected size. NEG/liar-kill:
T9 a 0-sector-load sibling image never reaches long mode -> the browser gate never fires (window
region of a fresh desktop stays zero); T10 a tampered EMPTY page collapses the box count below the
T4 threshold (the layout evidence is content-sensitive, not a constant).
HONEST SEAM (no overclaim, same as every nx_nishi_usb_* rung): the emu EXECUTES the MBR loader +
real->protected->long CR0/EFER transition as real x86 off the on-disk bytes; the browser render then
runs in NishiLang (the same sovereign language the kernel compiles from) as the OS's app layer,
painting the nx_fb framebuffer. Running the render loop itself as x86-on-emu, NishiOS-native
networking (fetch on-OS), and live input are the next rungs (N2/N3) -- named, not claimed.
NEVER-BRICK (Rule 26): writes FILE artifacts only (.img/.bmp/.html); 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
| 30 | const NB_MAGIC_200000: i64 = 200000 |
| 31 | const NB_MAGIC_32767: i64 = 32767 |
| 32 | const NB_MAGIC_65536: i64 = 65536 |
| 33 | const NB_MAGIC_202124: i64 = 202124 |
| 115 | const NB_IMG_SZ: i64 = 1024 |
| 203 | const NB_W: i64 = 640 |
| 204 | const NB_H: i64 = 480 |
| 205 | const NB_BW: i64 = 620 // browser page framebuffer width (blit interior of the OS window) |
| 206 | const NB_BH: i64 = 426 // browser page framebuffer height |
| 207 | const NB_OX: i64 = 10 // blit origin in the desktop |
| 208 | const NB_OY: i64 = 38 |
functions
| 35 | 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 |
| 40 | func nb_num(v: i64) -> i64 { nxi_out(v); return 0 } |
| 41 | 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 |
| 42 | func nb_contains(hay: *u8, hn: i64, ndl: *u8, nn: i64) -> i64 called by 1: main |
| 48 | 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 |
| 52 | func nb_emu_boot_disk(mem: *u8, disk: *u8, entry: i64, console: *u8, clen: *i64, st: *i64) -> i64 |
| 117 | func nb_movrax(img: *u8, base: i64, o: i64, b0: i64, b1: i64, b2: i64, b3: i64) -> i64 called by 1: nb_build_image |
| 125 | func nb_build_image(img: *u8) -> i64 |
| 165 | func nb_boot_image(img: *u8, console: *u8, clen: *i64, st: *i64, loaded: *i64) -> i64 |
| 179 | func nb_str(fb: *u8, W: i64, H: i64, x: i64, y: i64, s: *u8, r: i64, g: i64, b: i64) -> i64 |
| 194 | func nb_write_file(path: *u8, data: *u8, n: i64) -> i64 |
| 211 | func nb_count_rgb(desk: *u8, r: i64, g: i64, b: i64) -> i64 called by 1: main |
| 226 | func main() -> i64 |