Settings Overhaul + Real Recycle Bin: Design Plan
Status: DRAFT for review (2026-06-15). Tracks tasks #53–#62, #54. Constraint: frontend stays 100% userland (compositor + /APPS). Every change logged in the changelog.
Goal
Make every item in the Settings app fully functional (no placeholders) and make the Recycle Bin a real userland app. Settings runs as the userland app /APPS/settings; the kernel exposes capabilities via syscalls. Where a syscall is missing, add it.
Architecture
- Userland Settings UI (
userland/apps/settings): a left-hand category list + right-hand panel per category. Useswin_*drawing +win_get_event(mouse now delivered to apps as of build 53). Reads/writes system state only through syscalls. - Kernel syscalls: reuse existing where possible; add new ones for display, fonts, SMART, network config, and user enumeration/editing.
- No kernel GUI app is used (gui/settings.c stays as reference only).
Existing syscalls we can reuse
- Theme:
SYS_SET_THEME(133) /SYS_GET_THEME(134) - Cursor theme:
SYS_SET_CURSOR_THEME(148) /GET(149) - Volume:
SYS_SET_VOLUME(135) /GET_VOLUME(136) /SET_MUTE(137) - Mouse speed:
SYS_SET_MOUSE_SPEED(140) /GET(141) - Date/time:
SYS_GET_RTC_TIME/DATE(142/143),SYS_SET_RTC_TIME/DATE(144/145),SYS_NTP_SYNC(147) - Disk:
SYS_GET_DISK_TOTAL(138) /GET_DISK_FREE(139) - Network info (read):
SYS_GET_NET_INFO(146) -> net_info_t {ip,gateway,netmask,dns,mac,connected} - Users:
SYS_ADDUSER(132),SYS_PASSWD_CHANGE(130),SYS_SU(131); uid/gid getters 120-127
Follow-up, checked against the current syscall table: of the
syscalls proposed below, SYS_GET_DISK_INFO (199), SYS_LIST_USERS
(190), SYS_SET_WALLPAPER (204), and SYS_NET_SET_STATIC (217) were
built and are live under those names, though not the 215+ numbering this plan
guessed at. Display-mode enumeration/switching, a dedicated UI-font syscall,
SMART health, and DHCP toggling/DNS-resolve-as-syscall as named here were not
found under these exact names as of this audit; they may have shipped under
different names or may still be open. See the Syscall
Reference for the current, generated list rather than relying on this
plan's proposed numbers.
New kernel syscalls required (proposed numbers in the 215+ range; verify free)
- Display/resolution (#57):
SYS_GET_DISPLAY_MODES,SYS_GET_DISPLAY_MODE,SYS_SET_DISPLAY_MODE(w,h,bpp) - Backed by the Bochs VBE / framebuffer driver (video/framebuffer.c). Changing mode must re-init the FB, re-map the compositor's FB, and tell the compositor to re-query fb_info. This is the riskiest item (live FB re-init under a running compositor).
- Fonts (#58):
SYS_SET_UI_FONT(id),SYS_GET_UI_FONT,SYS_LIST_FONTS. Kernel currently has bitmap font (video/font.c) + TTF (ttf.c). Scope: choose among available fonts / sizes. - Storage/SMART (#61):
SYS_GET_DISK_INFO(buf)-> model, serial, size, sectors;SYS_GET_SMART(buf)via ATA IDENTIFY / SMART READ DATA (drivers/ata.c). Usage already via disk total/free. - Network config (#62):
SYS_NET_SET_STATIC(ip,netmask,gw,dns),SYS_NET_SET_DHCP(on),SYS_NET_RENEW_DHCP,SYS_GET_NET_STATS. Backed by net/dhcp.c + ip.c + the NIC driver. - Users (#60):
SYS_LIST_USERS(buf,max)(the compositor login already expects this, currently unimplemented; implement it),SYS_DELETE_USER(name),SYS_EDIT_USER(name,...). - DNS (shared with irc #51):
SYS_DNS_RESOLVE; note: dns_resolve is blocking with timer-based timeouts; from a userland syscall it needs either a poll-split (send/poll like TCP) or a bounded busy-resolve under a brief CR3 switch. Design separately.
Per-area plan
- Themes (#55): likely just wiring the existing SET/GET_THEME into the userland UI and ensuring the compositor re-reads the theme (THEMES/ definitions). Verify "was working".
- Backgrounds (#56): wallpaper picker; set wallpaper (needs a
SYS_SET_WALLPAPER(path)or write a config the compositor reads, e.g. /CONFIG/WALLPAPER). Compositor already has a wallpaper layer. - Display/resolution (#57): enumerate + set VBE modes; re-init FB + notify compositor.
- Fonts (#58): choose UI font/size; compositor + apps honor it.
- Date/time (#59): read/show, edit via SET_RTC_*, NTP sync button. Mostly exists.
- Users (#60): list/add/delete/edit + password; implement SYS_LIST_USERS first.
- Storage (#61): disk model/serial/size (ATA IDENTIFY), SMART health, usage bars.
- Network (#62): show IP/mask/gw/dns/mac; toggle DHCP/static; apply; renew.
Recycle Bin (#54)
- Userland
/APPS/recycle. Trash dir on the FAT volume, e.g./RECYCLE/. - Delete-to-trash: move file to /RECYCLE/ + a metadata sidecar (original path, timestamp).
- Restore: move back to original path. Empty: delete from /RECYCLE/.
- Needs working FAT move/create/delete (done as of builds 47-51) + a way to enumerate /RECYCLE.
- Integrate with Files app "Delete" -> move to /RECYCLE instead of unlink.
Phasing (suggested, low-risk first)
- Phase A: Date/time, Themes, Backgrounds, Users(list/add/passwd): mostly existing syscalls.
- Phase B: Storage/SMART, Network read + DHCP renew: new read syscalls (low risk).
- Phase C: Network static config, Fonts: new write syscalls.
- Phase D: Display/resolution: highest risk (live FB re-init); do last, with backups.
- Phase E: Recycle Bin (depends on FAT move/delete, already working).
Testing
- Per area: open Settings (compositor), exercise the control, verify the effect (screenshot plus serial output). For network/DNS, exercise against a dedicated test server rather than public services.
- Back up before each phase. Log every change in the changelog.