code wiki / _hdl_build / nx_nishios_browser_input.nx
nx_nishios_browser_input.nx
buildroot/runtime/_hdl_build/nx_nishios_browser_input.nx
about
nx_nishios_browser_input.nx -- BROWSER-ON-ALL-OS arc, rung N2: the Nishi browser is USED on NishiOS.
N1 (nx_nishios_browser) proved the browser RENDERS on NishiOS. This rung proves INPUT + NAVIGATION:
the OS delivers a click at the desktop point over a link in the rendered page; the browser maps it to
page coordinates, hit-tests it with the SAME br_hit_link the Linux/Windows browsers use, resolves the
href, loads the target page from the OS content store (disk), re-lays-out and re-renders -- a real
browse interaction (click a link -> the page changes), frame0/frame1 exported as BMPs.
KAT: T1 booted off the persisted image; T2 LONG mode; T3 start page laid out; T4 the OS click HITS the
link box (br_hit_link==1); T5 the resolved href is exactly '/wiki/'; T6 the target page laid out;
T7 the target page rendered (h1 bar pixels in frame1); T8 frame0 and frame1 DIFFER across the window
region (navigation visibly changed the page); T9 both BMPs exported at the exact expected size.
NEG/liar-kill: T10 a click at a NON-link point hits nothing (no navigation -- input evidence is
box-sensitive, not a constant); T11 a 0-sector-load sibling image never reaches long mode -> no frame
is ever drawn.
HONEST SEAM (same class as nx_nishios_events/kbd): the click SOURCE is scripted (a live PS/2
controller on the emu = the hardware rung); the click HANDLING (desktop->page mapping, br_hit_link,
href resolve, load, re-render) is the real browser input path. Navigation loads from DISK (the OS
content store); NishiOS-native network fetch = rung N3 (nx_nishios_net), named not claimed.
NEVER-BRICK (Rule 26): writes FILE artifacts only; models INT 13h *reads*; no /dev.
expect_exit: 0 license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_browser_render.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
| 25 | const NB_MAGIC_200000: i64 = 200000 |
| 26 | const NB_MAGIC_32767: i64 = 32767 |
| 27 | const NB_MAGIC_65536: i64 = 65536 |
| 104 | const NB_IMG_SZ: i64 = 1024 |
| 185 | const NB_W: i64 = 640 |
| 186 | const NB_H: i64 = 480 |
| 187 | const NB_BW: i64 = 620 |
| 188 | const NB_BH: i64 = 426 |
| 189 | const NB_OX: i64 = 10 |
| 190 | const NB_OY: i64 = 38 |
functions
| 29 | 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 |
| 30 | func nb_num(v: i64) -> i64 { let b: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)} let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i: i64=0; while i<k{b[i]=t[k-1-i];i=i+1} sys_write(1,b,k); return 0 } called by 1: main |
| 31 | func nb_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 32 | func nb_contains(hay: *u8, hn: i64, ndl: *u8, nn: i64) -> i64 |
| 38 | 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 |
| 41 | func nb_emu_boot_disk(mem: *u8, disk: *u8, entry: i64, console: *u8, clen: *i64, st: *i64) -> i64 |
| 106 | func nb_movrax(img: *u8, base: i64, o: i64, b0: i64, b1: i64, b2: i64, b3: i64) -> i64 called by 1: nb_build_image |
| 111 | func nb_build_image(img: *u8) -> i64 |
| 150 | func nb_boot_image(img: *u8, console: *u8, clen: *i64, st: *i64, loaded: *i64) -> i64 |
| 163 | func nb_str(fb: *u8, W: i64, H: i64, x: i64, y: i64, s: *u8, r: i64, g: i64, b: i64) -> i64 |
| 177 | func nb_write_file(path: *u8, data: *u8, n: i64) -> i64 |
| 193 | func nb_draw_desktop(desk: *u8, page: *Page, url: *u8, ulen: i64, cx: i64, cy: i64) -> i64 |
| 228 | func nb_find_link(page: *Page, want: *u8, wlen: i64, ox: *i64, oy: *i64) -> i64 |
| 248 | func main() -> i64 |