nx_nishios_gui.nx
buildroot/runtime/nx_nishios_gui.nx
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
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
structs
| none |
consts
| 15 | const K_MAGIC_2835: i64 = 2835 |
functions
| 17 | func 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 } |
| 22 | func gui_num(v: i64) -> i64 { nxi_out(v); return 0 } |
| 25 | func setpx(fb: *u8, W: i64, H: i64, x: i64, y: i64, r: i64, g: i64, b: i64) -> i64 called by 1: fill_rect |
| 29 | func fill_rect(fb: *u8, W: i64, H: i64, x: i64, y: i64, w: i64, h: i64, r: i64, g: i64, b: i64) -> i64 |
| 35 | func draw_char(fb: *u8, W: i64, H: i64, x: i64, y: i64, g: *u8, scale: i64, r: i64, gg: i64, b: i64) -> i64 |
| 48 | func 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 |
| 58 | func 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 |
| 63 | func 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 |
| 64 | func 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 |
| 66 | func main() -> i64 |