Graphics & UI
Draw into a shadow, publish by damage.
The display path is intentionally simple: drawing lands in a RAM shadow buffer, damage rectangles describe what changed, and a budgeted flush copies those rectangles to VRAM. Windows add a compositor and a mapped-canvas ABI on top; a small immediate-mode toolkit supplies the widgets.
Framebuffer
The boot path writes a struct vga_boot_fb_info to
0x600: LFB base, pitch, width, height, bits per pixel
and an RGBX flag for GOP's byte order. The legacy VESA stage chooses
a mode with at least 16 bpp, a linear framebuffer, it must fit the
card's VRAM, at most 1920 pixels wide, and its shadow (pitch ×
height) must fit the 8 MB reserve. 1920×1080 is the practical
maximum: its 8.29 MB shadow fits, and its 4.15 MB RGB565 canvas
fits the 4 MB window slot; 1920×1200 is rejected because its
canvas would need 4.6 MB. The UEFI loader applies the same GOP
limits.
vga.c owns the visible surface. On a
normal boot the render target is a RAM shadow buffer at
0x100000, not the LFB; the 8 MB reserve holds a
1920×1080×32 frame (8.29 MB) with about 94 KB to spare. A surface
carries width, height, pitch, format and a
pixel-pointer, so the same drawing code can target a window layer or
a canvas.
Shadow buffer & damage
Drawing never writes VRAM directly. Each operation records a damage
rectangle; overlapping or touching rectangles merge, so a keystroke's
cells collapse into one small rect while unrelated damage stays
apart. The main loop calls vga_present_shadow() on every
iteration with a byte budget of VGA_FLUSH_BUDGET_BYTES
(1 MiB by default).
- Small rects copy whole. A window repaint within the budget never tears.
- Large rects are chunked. A full-screen redraw continues across loop iterations; newer damage is queued behind it.
- No fixed frame rate. The loop flushes whenever there is pending damage, so a cursor move reaches the screen within one loop.
- Re-entry guard.
vga_present_shadow()refuses to run while another process is mid-flush; a full-screen copy is long enough to be preempted. - Window drags flush immediately.
wm_drag_shadowcopies each drag step as one consistent frame.
When the target is not the screen — a window layer or an app canvas —
vga_target_damage() is a no-op. The render target
override is stored in the PCB, so a preempted draw cannot leak into
another process's window.
Blit backends
blit.c is the pixel-operation vtable: fill, copy, blend, canvas, present and flip. Software is the only backend today, but the WM calls the vtable rather than a fixed function, so an accelerator can replace individual operations without touching window logic.
The software fill uses an SSE2 row store when the CPU supports it.
Rows that do not fit the cache use streaming stores
(movntdq, one sfence per fill), which
avoids read-for-ownership traffic that makes large fills DRAM-bound
on the Atom. SSE/SSE2 are never assumed: the kernel is built with
-mno-sse, and cpu_has_sse2() probes CPUID,
sets CR4.OSFXSR/OSXMMEXCPT and is re-run on every AP.
gfxbench times fill, copy, cell, canvas and flush paths
and reports the bytes actually copied by the presenter.
Window manager
The WM is a process that owns the desktop and a fixed array of eight
windows. It draws a system bar with the NebOS start button, the
clock, the temperature, and, on ThinkPads and Chromebooks, an
AC/battery status icon at the far right (the Adwaita
ac-adapter symbol on AC, and the battery
outline with our own level fill inside on battery), plus
draggable
terminal and canvas windows with a title bar and close button.
A normal window has no visible frame; an invisible resize band
(1 px inside, 3 px outside its outer edge) is the resize grab
area, and the active title bar uses the toolkit's highlight
colour.
Click-to-focus, drag-by-title-bar and close are routed through the
same pointer path. To the left of the rightmost AC/battery status
icon, a network status icon shows the Adwaita
network-wired symbol for wired Ethernet, a
network-wireless-signal-* symbol for a connected WiFi
link, the phone symbol for RNDIS tethering, and
network-wired-disconnected in red when no NIC is
active (network-wireless-offline when a WiFi card is
present but not associated).
The whole right status cluster — temperature, date/time,
network and AC/battery items plus the gaps between them — is
one button with a single rounded hover pill; the empty bar
between the start button and the cluster is not clickable. Both
bar buttons use the same height and rounded style, stopping just
above the rainbow separator, and turn selection-blue while their
panel is open. It opens the anchored bin/netmenu
control panel (a second click closes it).
It opens collapsed: the battery/clock summary and Quick settings
pills are visible, while the network, power-mode and date/time
settings stay hidden until their pill is clicked. Present NICs
can then be selected (DHCP runs), and scanned WiFi networks can be
joined, asking for the WPA2 passphrase first when the AP requires
one.
The NebOS banner in the top-left is the start button. Clicking it
opens a Windows-like start menu drawn by the WM as a flat overlay,
not a window, so it floats above every canvas without consuming a
window slot. The panel uses the control panel's theme: a flat
theme.bg surface with no rim, a dim
Applications caption as its first row, rounded hover
rows and a rounded Power tile. Every self-contained GUI
application in the pack gets a row with a coloured letter tile —
Terminal, Files, Web, Gallery, Chat, Clock, Text editor, Colors,
Mines, Cards, Disks, Tasks, Settings and Date & Time — the
pointer highlights the hovered row, and an outside press dismisses
the panel. Row height shrinks to keep the whole list inside the
work area on short panels. The last row, Power, opens a submenu
with Reboot and Power off; both run the privileged kernel command
through SYS_SPAWN_KCMD. The bar notice and the
right-aligned status never draw left of
WM_BAR_LEFT_END.
A popover is a chromeless canvas window created with
u_win_create_popover() (WIN_F_POPOVER).
The WM anchors it flush under the top bar at the right screen
edge, treats it as always topmost in painting and hit-testing,
and draws no chrome at all:
the canvas fills the whole window rectangle, with no title bar,
shadow, rim or rounded outer corners, so it reads as a flat menu
panel. The kernel uses the window origin for content-relative
pointer and scroll coordinates. An outside press dismisses the
popover and the click then continues normally; a second click on
the status cluster toggles it. The panel itself is drawn with the
ngui components: a battery/AC and clock summary, a brightness
slider when the panel PWM is present, and Quick settings tiles for
Network, the CPU power mode (SYS_CPUFREQ) and Date
& Time. Clicking a tile expands that section in place — the
network devices/Wi-Fi/connection lists, the three power modes, or
an inline date/time editor with Set, Now and Sync NTP (no separate
window). SYS_WIN_RESIZE_SELF grows or shrinks the
popover to the section, clamped to SYS_SCREEN_INFO's
framebuffer; the section scrolls with the wheel, touchpad or page
keys when it is taller than the screen, and its overlay scrollbar
slides in while the pointer is over the panel.
The WM is the ring-3 process loaded from
/ramfs/bin/wm; there is no kernel WM fallback. The
kernel window server in wm.c owns the
shadow mapping, the per-window canvases, input routing, the cursor,
kexec detection and the boot-console handoff. It starts the first
terminal after the storage mount
(wm_server_boot_ready) and leaves the boot console
visible until the WM attaches. The console uses the same 8×16 face
and top-left origin as the terminal, so the first frame replaces it
without a size or position jump.
PRESENT.
- Terminal windows are canvas clients: ucmd_term.c renders its rows into the RGB565 window canvas; keys arrive through the generic
SYS_KEY_POLLorSYS_WIN_KEY_WAIT. The WM no longer has a text-cell path. - Canvas windows are generic: the app gets a back buffer, pointer position/buttons/focus and queued press/release edges with capture.
- Focus and z-order are explicit; closing a window kills its session and frees its canvas.
Compositing cost
The WM keeps a front-to-back order: the focused window first, then the remaining windows in descending slot order. For each damage rectangle it fills the desktop once and walks that order, subtracting every window in front from the region still uncovered. A window is drawn only in its exposed pieces, so a fully occluded window costs nothing and the stack is never repainted back-to-front. The kernel pointer hit-test uses the same order. A focused-window drag copies its shadow block to the new position and repaints only the old strips the new rectangle does not cover, instead of compositing the window at both positions. If either rectangle is partly off-screen the shadow has no valid pixels for the hidden part, so that step repaints the window rect instead of copying desktop background into it.
SYS_WIN_PRESENT carries a content-relative damage
rectangle. The terminal tracks its dirty rows, so a keystroke copies
and composites one 8×16 row block instead of the whole 512×512
canvas. The kernel unions the rectangles between WM polls and
SYS_WM_INFO returns that union; a present with
w == 0 or h == 0 still means the whole
canvas. The WM overwrites /share/wmstats every two
seconds with the interval's frame count, compositing time, worst
frame and pixels drawn (usurf_pixels), which is the
on-target compositor measurement.
Canvas ABI
SYS_WIN_CREATE maps the calling command's window canvas
read/write at 0x50000000. The process draws RGB565
pixels and publishes a finished frame with
SYS_WIN_PRESENT, optionally passing a content-relative
rectangle (struct wm_win_present) for the changed
region. Present copies that region from the back buffer into the
composited front canvas with interrupts off, so a half-drawn frame
can never reach the screen. Frames carry monotonic sequence
counters, so the WM cannot lose one. content_gen comes
from a global counter and is unique per window creation, so a new
window that reuses a just-closed slot forces the WM to remap its
front canvas instead of reusing a stale mapping.
SYS_WIN_CREATE creates a generic canvas window.
struct win_create.flags can request
WIN_F_POPOVER, a chromeless overlay: the canvas fills
the window and the WM supplies only the topmost placement.
SYS_WIN_RESIZE_SELF (115) resizes the caller's canvas
and SYS_SCREEN_INFO (116) reports the framebuffer
size, so a popover can collapse or grow. Input is exposed through
SYS_WIN_POINTER
(content-relative position, button mask, focus),
SYS_WIN_EVENT, which
queues press/release edges and a capture window, and
SYS_WIN_SCROLL, which returns wheel/touchpad scroll
accumulated for the window under the pointer in pixels
(+dy is later content). A click that starts
in a window still receives its release after the pointer leaves.
The ngui helper ngui_scroll_wheel() applies the delta
to a pane when the pointer is over it. A pane's scrollbar is an
overlay: an 8 px rounded pill at its right edge that stays hidden
while the pointer is outside, slides in over about 100 ms on
hover, and never reduces the content rectangle or reflows a row.
hide_bar suppresses it entirely.
The WM process itself is special: it maps the screen shadow at
0x58000000 and each front canvas at
0x59000000 + index × 4 MB, which is how it composites
without reading another process's memory. The 4 MB slot covers a
full-screen 1920×1080 RGB565 canvas (4.15 MB) minus the chrome;
the old 2 MB slot capped a full-height window at roughly 1050 px
wide.
SYS_WM_RESIZE (WM side) and
SYS_WIN_ACK_RESIZE (client side) swap in a resized
canvas; the content size is bounded by the framebuffer, so a
window can grow to the edge of the screen.
Double-clicking a title bar maximizes the window to the work area
below the system bar (0, WM_BAR_H, fbw, fbh - WM_BAR_H);
the next double-click restores the saved geometry. Dropping a
title-bar drag with the pointer on the left or right screen edge
(WM_SNAP_EDGE, 2 px) snaps the window to that half of
the work area at full height, and the top edge maximizes it. The
restore geometry is saved only when a window leaves the normal state,
so snapping and then maximizing still restores the original size.
Dragging a maximized or snapped window restores it first, with the
grab point kept at the same fraction of the title bar, and a manual
resize clears the state. While a window is dragged, the screen edges
and the facing edges of other windows resist it: the window stays
flush until the pointer overshoots by WM_RESIST (24 px),
which makes side-by-side placement exact. Windows can be dragged past the left, right and
bottom edges; WM_DRAG_VISIBLE (48 px) of the title bar
always stays on-screen for recovery, and the top bar is never
overlapped. An invisible resize band (1 px inside, 3 px outside)
runs along every edge and corner: the grabbed edges follow the
pointer while the opposite edges stay put, clamped to the work
area. While a drag or resize is active the WM owns the pointer,
so the window content does not see the held button.
Buttons fire on the release edge. The toolkit keeps
a button active until ui->released;
inferring release from the sampled button mask races the WM event
queue and drops clicks.
When a process exits or crashes, the reaper releases its window
mappings and the window server frees the canvas. Closing a window
kills its owner. Keys go through the window key queue
(SYS_WIN_KEY_WAIT) or the generic
SYS_KEY_POLL; Ctrl+C still reaches the terminal.
ngui toolkit
ngui.c/ngui.h is an
immediate-mode GUI toolkit shared by the ring-3 apps. It provides
clipped RGB565 primitives, buttons, menu items, text fields, the
Adwaita symbolic icons (see UI icons), a theme palette, layout cut helpers and scrolling
panes. It is linked into files, mines,
solitaire, process, chat,
the control panel and the real gallery.elf.
- Text fields support drag-selection, double-click select-all, Ctrl+Left/Right word jumps, Ctrl+Delete/Backspace word deletion and Ctrl+A. They use the proportional face with measured caret, selection and horizontal scrolling; a field marked
disabledignores pointer and keyboard input, drops the focus and paints its value dimmed in the same proportional face. A field markedsecretis measured and painted from a*mask (caret, selection and click positions follow the mask, Ctrl+Left/Right jump to the ends), and Tab returnsNGUI_INPUT_NEXTtogether withNGUI_INPUT_CANCELso forms can move the focus. Fields hold up to 511 characters (NGUI_INPUT_MAX512). The terminal and editor keep the 8×16 cell grid. - Popover components give a menu panel its surface:
ngui_popover_begin()fills the canvas and returns the body and footer rectangles (no title bar or close button);ngui_section()draws a captioned section header with an optional right-aligned action button;ngui_list_row()is a two-line hover/selected row with optional signal bars and trailing text;ngui_tile()is a rounded quick-settings tile andngui_slider()a draggable horizontal slider. The WM draws no outer chrome, so the app paints the whole window. - Scroll panes keep the wheel and page keys, and draw a Firefox-style overlay pill instead of a permanent track. It is hidden by default, animates in from the pane's right edge while the pointer is over the pane, brightens over the hit strip and turns accent-coloured while dragged. Presses in the strip start a drag (or jump the thumb) and do not reach the rows or buttons beneath it; content uses the full pane width in every app.
- Clip stack keeps nested panes and popups inside their parents.
- Layout cuts split a rectangle into rows, columns and fixed margins without a constraint solver.
- No retained widget tree. Apps redraw from state every frame, which keeps the toolkit small and predictable.
Proportional text comes from ufont.c: a
fixed-point, integer-only TrueType parser and antialiased rasterizer.
The pack carries Latin-1 Arimo regular/bold/italic/bold-italic,
Liberation Mono and a curated monochrome Noto Emoji subset under
/ramfs/fonts. The browser, ngui apps and the WM chrome
use real pixel sizes from 8 to 48 px; the browser maps CSS
font-size, font-weight,
font-style and font-family: monospace to
the faces. Pages may bring their own faces with
@font-face: TrueType/OpenType (TrueType outlines) or
WOFF 1.0, which ufont_woff.c
unwraps by inflating each table; per family the browser keeps one
face per weight/style and picks the nearest one at layout. Its
arena is 3 MB instead of the default 512 KB so web fonts
fit beside the built-in set. Missing fonts fall back to the 8×16 bitmap. The browser
detaches the font arena before heap_reset() and
reattaches after heap_start(); terminal content and
the editor keep the bitmap cells.
UTF-8 text is available through ngui_text_utf8* and
ngui_menu_item_utf8(). Per codepoint, the selected
primary face is tried first, then the lazily loaded emoji face;
cmap format 12 covers codepoints above the BMP. The emoji set is
deliberately limited to common single-codepoint glyphs that fit the
rasterizer's 256-point/16-contour limits. ZWJ sequences, flags,
skin tones and color glyphs fall back to a tofu or
?; the browser keeps its Latin-1 byte path.
Applications
files
File browser on the VFS: opens text in edit, images in view and HTML in browser. The first ngui user.
process
Graphical task manager (the start menu's Tasks entry or process, the ngui counterpart of top): 60 s CPU, physical-memory and NIC-throughput graphs fed by one sample per second, and a sortable process table (PID, state, CPU%, memory, CPU time, name). A selected row shows its details and End task terminates it after a second confirming click; kernel threads and the monitor itself are protected. Headers sort, PgUp/PgDn and the wheel scroll, Esc closes.
gallery
Live showcase of every ngui control and primitive. Ships in the pack as bin/gallery.app; a launcher prefers /share/GALLERY for development.
chat
Cloudron Chat client: native OIDC login, channel/DM sidebar with unread badges and presence dots, a wrapped timeline with avatars, day headers, reply snippets and link-preview cards (site, title, description and an optional thumbnail; clicking one opens the link in the browser), a composer and browse/new-DM pickers. Media downloads use a warm curl __serve helper; message images are also decoded there (480×320 bounds), while avatars decode at 32×32 on the chat thread, so the window keeps drawing. Saved sessions resume from /data. The start menu's Chat entry launches it.
disks
Storage manager: devices, MBR partitions and mounts, per-volume mount name, read-only and automount, and Format / Install NebOS dialogs that show the kernel command's output. The start menu's Disks entry and the Disks button in files launch it.
solitaire
Klondike with drag-and-drop, draw-one/three, scoring, animation and pixel-art cards on the canvas service.
view
Image viewer with fit, 1:1, zoom, pan, EXIF orientation and animated GIF playback.
clock / colors / settime
Small canvas demos: an analog clock, a colour test window, and the standalone Date & Time editor (settime). The control panel's Date & Time tile reveals its own inline editor, which reads and writes the CMOS RTC and can fetch UTC from an SNTP server.
browser
HTML/CSS renderer with flex rows, auto-fit and repeat(N, 1fr) card grids, aspect-ratio frames, inline-block runs, inline SVG icons, basic tables and inline SVG diagrams. It decodes inline images at their laid-out bounds (a JPEG gets a reduced IDCT) in the fetch helper, caches a display-size bitmap per image so repaints are 1:1, and fetches through the same helper; image repaints are coalesced and /share/IMGSTAT reports where a load spent its time. Inline and external scripts run on the vendored QuickJS engine (ES2025), and forms render and submit natively. The largest ring-3 application in the tree.
Image library
The codecs are independent of the OS and the toolkit: each takes an
input buffer plus a caller-provided struct img_mem arena
and returns an RGB565 image with an optional 8-bit alpha plane. The
browser and the chat client link the same objects and decode HTTP
bodies in memory.
- Formats. PNG, baseline and progressive JPEG, animated GIF, BMP, TGA, PNM, ICO/CUR and PAM. The browser also takes SVG files (
<img src="logo.svg">, CSS backgrounds): the markup is parsed into a detached subtree and drawn by its inline-SVG renderer into an RGB565 + alpha bitmap. - Drawing.
img_draw()is a clipped, scaled RGB565 blit: box-filter downscale, bilinear upscale, alpha over a checkerboard or over the destination. A 1:1 opaque source takes a row copy, and a 1:1 alpha source blends in RGB565 without the 8-bit round trip. - Display-size decode.
struct img_optionscarries optionalmax_w/max_hbounds. JPEG honours them with a scaled IDCT (1/2 4x4, 1/4 2x2, 1/8 1x1, Loeffler/IGJ), so a 1200x800 photo painted at 400×267 is decoded at roughly 600×400 instead of full size and then box-filtered. PNG/GIF/other codecs ignore the bounds and the caller scales them withimg_draw(). The browser'scurl __servehelper runs this decode for remote<img>and publishes the finished RGB565+alpha bitmap, so the UI thread only copies it. - Orientation. EXIF orientation is applied; arithmetic JPEG and CMYK are rejected.
- Cost. Downscaling runs on the CPU. The browser decodes at the CSS/attribute box and caches one display-size bitmap per image, so a repaint is a 1:1 blit; the viewer caches one image; the chat client caches 480×320 message images and 32×32 circular avatars.
/share/IMGSTATrecords the browser's net, io, decode, scale, paint and reflow times.
UI icons
ngui's icons (ngui_icon(), ngui_icon_button():
back/forward, reload and home in the browser toolbar, folder/file/drive
in files) and the WM's top-bar network/battery
indicators are GNOME Adwaita symbolic icons
(adwaita-icon-theme 51, LGPL-3 or CC-BY-SA-3.0). The unchanged
*-symbolic.svg files live in
assets/icons/adwaita/; the host tool
tools/mkicons.c rasterizes each one with the
browser's svg_raster.c into a 16×16
8-bit coverage mask and writes one NBICO1 bundle,
/ramfs/icons/adwaita16.icn (layout in
include/icon_abi.h): a 16-byte header and
24 masks, ~6.2 KB raw and ~1.3 KB gzip, so both the USB
and the floppy pack carry it.
- Icon list.
ICON_LISTis an X-macro of enum suffix, short name and theme file. Its order is the icon id and the bundle order (append only); it generatesenum ngui_iconandngui_icon_name(), and the gallery shows every entry.uwm_lib.happlies the same list toenum uwm_icon, so the ring-3 WM can use ids without linking ngui. - Tinting. Symbolic icons are one colour, so only coverage is stored.
ngui_icon()blends the mask in the caller's colour (the theme text colour on buttons,icon_folder/icon_disk/icon_fileinfiles), centred and clipped.usurf_icon()does the same over the WM's 16/24/32 bpp shadow. The bar's battery clears the stripedbatterymask's interior to a quarter-brightness shade and draws its level fill over the lower part, so the gauge reads at 16 px. - Loading. Each process (every ngui app and the WM) reads the bundle once into a BSS buffer, so the browser's
heap_reset()cannot free it. The read is capped at the ids the process was built with, so an older app still works with a newer bundle. Without the bundle the icon is left blank; there is no line-drawn fallback, because it cost ~2 KB of code in each app. - Strict converter. mkicons reads only what symbolic icons use (
<svg viewBox>,<g>,<path>,<rect>,<circle>,<ellipse>, fill, fill-rule, opacity) and fails the build on transforms, strokes,styleor unknown elements instead of drawing a wrong icon../mkicons assets/icons/adwaita 16 out.icn -vprints an ASCII preview of every mask.
Mouse cursors
The cursor set is the GNOME Adwaita theme (adwaita-cursors 51,
LGPL-3 or CC-BY-SA-3.0). Its 24 px Xcursor images are copied
into assets/cursors/adwaita/ (trimmed by
tools/xcursor_trim.py), and the host tool
tools/mkcursors.c turns them into one
NBCUR1 bundle, /ramfs/cursors/adwaita24.cur
(layout in include/cursor_abi.h):
35 shapes named after the CSS cursor keywords, each
with its size, hotspot, frame count and premultiplied ARGB8888
frames. The animated wait/progress
spinners keep every fourth of Adwaita's 60 frames (15 frames at
64 ms, the same speed). The bundle is ~146 KB raw,
~18 KB gzip, and only in the full pack: the floppy lite pack
has no room, so a floppy boot keeps the built-in 16×16 arrow.
- Loading. cursor.c copies the bundle out of the ramfs into its own pages after
ramfs_init()and after everyramfs_replace()(the old pack is freed), then tells mouse.c to re-fetch its image. - Selection. On every
SYS_WM_POLLthe window server resolves the shape: the WM's override (SYS_WM_SET_CURSOR: resize arrows on the resize band and while resizing, the move cross during a title-bar drag, a hand over the start button, the start menu and the status cluster), else the cursor of the window holding the pointer capture, else the content cursor (SYS_WIN_SET_CURSOR) of the window under the pointer, else the arrow. - Clients. ngui resets the cursor to the arrow for each redrawn frame, a hovered text field asks for the I-beam,
ngui_cursor_rect()/ngui_set_cursor()serve apps, andngui_end_ex()sends it when it changed. The terminal uses the I-beam; the browser maps the inherited CSScursorproperty and, forauto, a hand over links, an I-beam over text fields and the progress arrow while a page loads. The gallery's Cursors section shows every shape. - Drawing.
cur_x/cur_ystay the hotspot; the image's top-left is the hotspot minus the image's hotspot and may be off-screen. The software cursor saves up to 32×32 pixels under it and blends the premultiplied pixels over them. Intel Ironlake and Radeon copy the ARGB image into their 64×64 planes (Intel uses CURPOS sign bits for negative positions and follows the matching primary plane's gamma enable, because the display palette is after the plane blender and a cursor-only gamma pass brightens its antialiased edges on a VBE mode whose primary bypasses the palette; Radeon usesHORZ_VERT_OFFplus a shiftedCUR_OFFSET); Cirrus reduces it to its two colours and clamps the position at 0. Animated frames advance frommouse_poll_update().
GPU quirks
- ATI Mach64. A CRTC fixup is applied after mode set. The legacy CRTC is skipped under UEFI.
- NVIDIA. VBE/GOP only; the kernel never touches the legacy VGA CRTC. On the ION, the framebuffer is stolen DRAM behind a BAR3 aperture; nvidia.c finds the stolen range and writes through a cached alias once a WC MTRR covers it. The nv50 display-engine probe is gated to the ION/nv50 chipsets so Maxwell parts (the GM206 GTX 960) are not poked through nv50 registers. On AMD family 15h the WC MTRR path uses only a free variable entry, leaves
MTRRdefTypeuntouched and writes a zero high mask (the LFB is below 4 GB); this is validated on the 970A-DS3P. - Intel. The Ironlake-era path supports a hardware cursor where available; the software cursor is the common fallback. Cherryview/Braswell also exposes the panel backlight (below).
- UEFI.
vga.chonours the RGBX flag and skips the VBE-only ATI CRTC reset and NVIDIA stolen-VRAM alias. mouse.c forces the software cursor.
Panel backlight
The HP Chromebook 11 G5 (google/setzer, Braswell)
drives its internal panel PWM from the display engine, not from
the Chrome EC. The board VBT (data.vbt, block 43)
declares PWM controller 0 at 200 Hz, active high. Linux uses the
same Valleyview/Cherryview registers through
intel_backlight.
- Registers.
BLC_PWM_CTL2at GPU BAR0 +0x1E1250(pipe A; pipe B is+0x100): bit 31 enables, bit 28 is polarity.BLC_PWM_CTLat0x1E1254: period in bits 31:16, duty in bits 15:0. The Cherryview PWM clock is 19.2 MHz with a fixed /16 increment, so 200 Hz is a period of 6000. - Probe. backlight.c matches Intel
8086:22b0/22b1, maps the graphics MMIO BAR, reads both pipes, follows the one the firmware enabled and falls back to controller 0. It logs the chosen pipe, period, duty and raw registers to COM1. - Use. The
backlightcommand prints the percentage and PWM state;backlight up|downsteps by 10%,backlight 0-100sets a level (clamped to 5..100), andbacklight probedumps both pipes' registers.SYS_BACKLIGHTgives ring 3 the same get/set/step, which drives the control panel's brightness slider. F6/F7 (the ChromeOS EC action-row brightness keys) and the standardE0 14/E0 15brightness scancodes adjust it; the keys are consumed in io.c and never reach a window. - Overlay.
SYS_WM_POLLalso reports the backlight percentage and a change counter. After each change the ring-3 WM (ucmd_wm.c) draws a centered Brightness bubble with a sun icon, the percentage and a level bar, keeps it up for 3 s, and composits it above the windows on every pass while it is visible. - Limits. Only the Cherryview/Braswell native PWM (
8086:22b0/22b1) is driven. The level is not persisted; a cold boot returns to the firmware's duty.
Source map
kernel/vga.c,kernel/vga.h— framebuffer and damagekernel/bootcon.c— direct-to-LFB boot consolekernel/vga_copy.S— copy primitiveskernel/blit.c,kernel/blit.h— pixel vtablekernel/cpu.c— SSE2 probingkernel/wm.c,kernel/wm.h,include/wm_abi.h— kernel window server and shared ABIuser/apps/wm/ucmd_wm.c,user/lib/uwm/uwm_lib.c— ring-3 WMuser/apps/netmenu/ucmd_netmenu.c— top-bar control panel (network/WiFi, brightness, power mode, Date & Time)user/apps/settime/ucmd_settime.c,kernel/rtc.c,kernel/ntp.c— Date & Time editor, RTC access and SNTP synckernel/gfx.c,kernel/gfx.h— RGB565 window canvaseskernel/sys_wm.c,kernel/sys_wm.h— WM/window ABIuser/apps/browser/browser.c,user/apps/browser/browser_html.c— HTML/CSS renderer and inline SVGuser/lib/ngui/ngui.c,user/lib/ngui/ngui.h— toolkituser/lib/ufont/ufont.c,user/lib/ufont/ufont_ttf.c,user/lib/ufont/ufont_draw.c— fixed-point TrueType textuser/lib/ufont/ufont_woff.c— WOFF 1.0 to sfnt (browser only)fonts/*.ttf— Arimo / Liberation Mono / Noto Emoji subsets in the packuser/apps/files/ucmd_files.c,user/apps/process/ucmd_process.c,user/apps/gallery/gallery.c,user/apps/solitaire/ucmd_solitaire.c,user/apps/chat/ucmd_chat.cuser/lib/img/img*.c— image codecskernel/ati.c,kernel/nvidia.c,kernel/intel.c,kernel/nv50.ckernel/backlight.c,kernel/backlight.h— Cherryview/VLV panel PWMkernel/cursor.c,kernel/cursor.h,kernel/mouse.c,kernel/cursor_shape.h— cursor bundle loader, drawing and the built-in fallback arrow;kernel/cirrus.c,kernel/radeon.c— hardware cursorsinclude/icon_abi.h,tools/mkicons.c,assets/icons/adwaita/— UI icon list, the NBICO1 bundle and the Adwaita symbolic SVGsinclude/cursor_abi.h,tools/mkcursors.c,tools/xcursor_trim.py,tools/cursor_test.c,assets/cursors/adwaita/— cursor shapes, the NBCUR1 bundle and the Adwaita source images