code wiki / (root) / nx_nishios_boot_gui.nx

nx_nishios_boot_gui.nx

buildroot/runtime/nx_nishios_boot_gui.nx

9293 B119 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind tooltopic nishios
docsdependenciesstructsconstsfunctions

about

nx_nishios_boot_gui.nx -- NishiOS KEYSTONE rung: BOOT -> GUI (the two halves fused). The boot/loader half (real-mode boot, INT13h loader) and the GUI half (framebuffer compositor) have been proven separately. This connects them: an x86 kernel BOOTS on the sovereign emu -- prints "NISHIOS" over the UART and enters PROTECTED mode (the real mode transition) -- and then the kernel's sovereign framebuffer driver (nx_fb) initializes a linear framebuffer and DRAWS THE DESKTOP into it. Export = nishios_boot_screen.bmp = "what the screen shows after boot". This is the single picture of the whole thing: power on -> kernel -> desktop. KAT: the boot reached protected mode, the UART banner is "NISHIOS", and the post-boot framebuffer holds the desktop (background + window + title text); BMP exported. HONEST SEAM (no overclaim): the emu EXECUTES the boot + mode transition as real x86; the desktop is drawn by nx_fb -- the kernel's framebuffer driver written in NishiLang, the SAME sovereign language the kernel compiles from. Running the draw loop itself as x86-on-the-emu (vs calling the NishiLang driver) + a real VESA/GOP framebuffer on hardware are the next rungs. No hw writes (Rule 26). expect_exit: 0 license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_fb.nx nx_font8x8.nx nx_nishios_boot_gui.nx

imports: nx_fb.nxnx_font8x8.nx

imported by: nobody (leaf or entry point)

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

main bg_puts bg_b emit_uart_str bg_b ↻ boot_kernel bg_mode bg_i32 bg_num fb_nishi_font fb_gly font8x8_table sys_mmap fg fb_rect fb_setpx fb_text fb_char fb_rect ↻ fb_window fb_rect ↻ fb_text ↻ fb_cursor sys_mmap ↻ fb_setpx ↻ fb_bmp_save sys_mmap ↻ fb_p32 fb_p16 sys_openat_wr sys_write sys_close sys_openat_wr ↻ bg_beq

structs

none

consts

17const K_MAGIC_1024: i64 = 1024
18const K_MAGIC_192054: i64 = 192054

functions

20func bg_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
21func bg_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
22func bg_beq(a: *u8, b: *u8, n: i64) -> i64 { var i: i64=0; while i<n { if a[i]!=b[i] { return 0 } i=i+1 } return 1 }
called by 1: main
23func bg_i32(c: *u8, o: i64) -> i64 { return (c[o] as i64) | ((c[o+1] as i64)<<8) | ((c[o+2] as i64)<<16) | ((c[o+3] as i64)<<24) }
called by 1: boot_kernel
24func bg_b(c: *u8, o: i64, b: i64) -> i64 { c[o]=(b & 0xff) as u8; return o+1 }
called by 2: emit_uart_strmain
25func bg_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: boot_kernel
28func boot_kernel(code: *u8, len: i64, uart: *u8, ulen: *i64, st: *i64) -> i64
called by 1: main calls 2: bg_modebg_i32
52func emit_uart_str(c: *u8, o: i64, s: *u8) -> i64
called by 1: main calls 1: bg_b
58func main() -> i64