code wiki / (root) / nx_nishios_gui.nx

nx_nishios_gui.nx

buildroot/runtime/nx_nishios_gui.nx

9381 B141 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic nishios
docsdependenciesstructsconstsfunctions

about

nx_nishios_gui.nx -- NishiOS GUI rung-1: the kernel DRAWS A DESKTOP into a framebuffer + exports it as a REAL viewable image. On real x86 a kernel gets a linear framebuffer (VESA/VBE or UEFI GOP) and draws pixels into it. This models exactly that: a 320x200 RGB framebuffer + kernel drawing primitives (clear / filled rect / bitmap-font text), used to render a NishiOS desktop -- title bar, a window with its own title strip, a logo, a taskbar with a start button -- then writes it out as a genuine 24-bit BMP (BITMAPFILEHEADER+BITMAPINFOHEADER, BGR bottom-up) you can open in any image viewer / browser, plus an HTML wrapper for the "window". This is the GUI you can SEE, drawn by our own code, not a mockup. KAT: the framebuffer holds the expected desktop pixels (bg / title bar / window fill / rendered text) and the BMP is well-formed ('BM', correct filesize, 24bpp). HONEST SCOPE: a STATIC render (no mouse/event-loop/input yet). A live compositor with input + a real framebuffer device wired into the boot kernel are the next rungs. No hw writes (Rule 26). expect_exit: 0 license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_itoa_lib.nx nx_nishios_gui.nx

imports: nx_syscalls.nxnx_itoa_lib.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main gui_puts sys_write sys_mmap gly fill_rect setpx draw_text draw_char fill_rect ↻ put32 put16 sys_openat_wr sys_exit sys_write ↻ sys_close gui_num nxi_out nxi_fd sys_mmap ↻ ccz_cat_num sys_write ↻ sys_munmap

structs

none

consts

15const K_MAGIC_2835: i64 = 2835

functions

17func gui_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 calls 1: sys_write
22func gui_num(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
25func setpx(fb: *u8, W: i64, H: i64, x: i64, y: i64, r: i64, g: i64, b: i64) -> i64
called by 1: fill_rect
29func fill_rect(fb: *u8, W: i64, H: i64, x: i64, y: i64, w: i64, h: i64, r: i64, g: i64, b: i64) -> i64
called by 2: draw_charmain calls 1: setpx
35func draw_char(fb: *u8, W: i64, H: i64, x: i64, y: i64, g: *u8, scale: i64, r: i64, gg: i64, b: i64) -> i64
called by 1: draw_text calls 1: fill_rect
48func draw_text(fb: *u8, W: i64, H: i64, font: *u8, idx: *u8, n: i64, x: i64, y: i64, scale: i64, r: i64, g: i64, b: i64) -> i64
called by 1: main calls 1: draw_char
58func gly(f: *u8, i: i64, r0: i64, r1: i64, r2: i64, r3: i64, r4: i64, r5: i64, r6: i64, r7: i64) -> i64
called by 1: main
63func put32(buf: *u8, o: i64, v: i64) -> i64 { buf[o]=(v & 0xFF) as u8; buf[o+1]=((v>>8)&0xFF) as u8; buf[o+2]=((v>>16)&0xFF) as u8; buf[o+3]=((v>>24)&0xFF) as u8; return o+4 }
called by 1: main
64func put16(buf: *u8, o: i64, v: i64) -> i64 { buf[o]=(v & 0xFF) as u8; buf[o+1]=((v>>8)&0xFF) as u8; return o+2 }
called by 1: main
66func main() -> i64