Not logged inTalkContributionsCreate accountLog in

GUI & Desktop

From nexOS Wiki
Framebuffer drawing, Alpine theme, wallpaper, rounded windows, terminal, browser

Contents

[hide]

The desktop is overlapping widgets drawn to the framebuffer — no toolkit, no compositor. Each window is x/y/w/h integers plus a draw function, hit-tested in main(). Rendering history: smooth fills + bulk present + 1:1 dragging, ghost-free front-buffer cursor, edge-clamped 2× mouse, click-edge queue, then rounded restyle + wallpaper (below).

Desktop layout

 +-------------------------------------------------------------+
 | [PAINT]   [TERMINAL]   [FILES]   [RECYCLE BIN]  (icons left) |
 |                                                             |
 |      +---------------------------+                          |
 |      | nexOS v0.1             [X]|  main window 500x350      |
 |      +---------------------------+                          |
 +-------------------------------------------------------------+
 +----------+----------+--------------------------------+------+
 |  START   |  PAINT   |                    nexOS       | taskbar 40px
 +----------+----------+--------------------------------+------+

Alpine palette

The old brown/orange theme was replaced with Alpine Linux dark (commit “Alpine Linux theme”). All colors are 0x00RRGGBB:

ConstantValueUse
COL_BG / COL_TERMBG0x001E1E2EDesktop + terminal background
COL_TASKBAR0x00181825Taskbar (2px accent strip on top)
COL_TITLE / COL_WINBG0x00313244Title bars + window bodies
COL_BTN0x0045475AButtons
COL_ACCENT0x0089B4FASTART, icons, progress, paint default
COL_MUTED0x006C7086Secondary text
COL_WHITE / TEXT / BLACK0x00CDD6F4All mapped to light lavender (even BLACK)
COL_RED0x00F38BA8Close X, SHUTDOWN
COL_SCRN0x00000000Splash clear

Bitmap font

Hand-defined 8×8 glyphs, font_map[256], draw_char per-bit + draw_str x+=10. Lowercase remaps to uppercase; digits and punctuation now have real glyphs (the old build rendered 0–9 as the letter O); unknown = solid box. Shift/caps tracked from release codes; terminal input stays uppercase for command matching.

Windows & widgets

WidgetGeometryFlagNotes
Main windowwin_x,win_y 500×350win_open“nexOS v0.1”, draggable 1:1, rounded + shadow
Taskbartb_h=40—START + PAINT, “nexOS” label
START menu152×152menu_openTERMINAL / NOTEPAD / ABOUT / BROWSER / red SHUTDOWN
Terminal520×300terminal_openterm_buf[160], 6-line scrollback, “>” prompt
File manager430×280file_openReal FAT32 listing (was fake README/NOTES placeholders)
Paint430×300paint_openpaint_canvas[80*50], 6 Alpine colors, 5×5 cells
Browser400×300browser_openURL bar, HTML-lite view (see below)

Terminal commands

CommandEffect
HELPList commands
ABOUT / ECHO“nexOS offline terminal”
CLEARClear (message 0)
CREDITS / YAZEED / OMARI / SUDO / NEXOS / HELLO / SECRET / GODCanned replies (same as before)
LSFAT32 root listing via fat32_list_dir
CAT FILEfat32_read_file + paged view
PINGARP to gateway
FETCHHTTP GET → browser buffer + auto-open
BROWSERToggle browser window
TASKS / HEAP / DMSGTask list, allocator self-test, kernel log
SLEEP nSleep n ticks
LSPCI / USB / DISKINFO / CPUID / ACPIHardware inspection
CRASHFault on purpose (panic test)

Browser window

draw_browser_window(): title “nexOS Browser”, red X, accent rule, black content area. Empty → welcome text. With data → strip <...> tags, wrap at 44 cols, 8 rows, browser_buf[2048].

Main loop

while (1) {
  if (pit_ticks - last_poll >= 10) { last_poll = pit_ticks; if (net_poll()) redraw = 1; }
  if (sleep_req) task_sleep(sleep_req);   // SLEEP command
  text_updated -> redraw; mouse queue -> drain one press edge;
  hit-test (START/PAINT/icons/title-bars/X/canvas/palette/menu);
  dragging[win] -> 1:1 follow per window; redraw -> render_desktop();
}

Rounded style (no longer blocky)

Helpers fill_rounded / fill_vgrad / draw_shadow / mix_color / isqrt_int: every window, the menu, taskbar buttons and icons are rounded (radius 5–10), title bars fade light-to-dark, and windows cast dithered drop shadows. Repaint regions were widened past the shadow extent; every window erases at its old painted coordinates (a bug where four windows erased at the new rect left title-bar trails).

Wallpaper

wallpaper.jpg is converted at build time to 1024×768 raw RGB with a NEXOSW01 magic header and stored at disk LBA 256. At boot wall_init() loads it into a heap buffer (validated: magic + dimensions + current 1024×768 mode); the background paint and all five window-erase rects blit from it with per-pixel VESA packing. Any mismatch falls back to the flat theme, so boot can never break on it.