RegCube — kernel hives and Strategy A (deskgui)¶
RegCube is the kernel-owned configuration store (string hives/keys). Ring-3 reads and writes through dedicated syscalls; persistence is optional and path-driven.
1. Kernel API¶
Implemented in src/sys/regcube.rs and exposed via src/kernel/syscalls.rs (numbers in syscalls-reference.md):
Get — NUL-terminated hive/key, fills user buffer, returns length or error token.
Set — hive/key/value NUL-terminated strings; updates in-memory hive.
Flush — serializes to a path (FAT / VFS write).
Load — reads file and merges into hives.
Invariant: kernel is authoritative; userland caches are advisory and must follow cache rules below.
2. Strategy A (single façade in deskgui)¶
Problem it solves: split-brain — some UI code talking to sys_regcube_* directly while other code used a local mock registry, causing inconsistent theme/settings/mixer state.
Rule: under apps/deskgui/src/, all RegCube access for compositor features goes through RegCubeClient (apps/deskgui/src/regcube_client.rs).
CI / hygiene: scripts/check_no_os_registry_deskgui.ps1 fails if os_registry / OSLocalRegistry strings reappear under apps/deskgui/src/.
3. RegCubeClient contract¶
3.2 Invalidation¶
invalidate_hive(hive)— removes all cached keys for that hive without calling the kernel (used after bulk external changes or editor loads).
3.3 Flush / load helpers¶
The client exposes flush, load, snapshot_for_editor, and small helpers (e.g. mixer launch pulse) — each maps to explicit syscall sequences; read the impl for exact hive names.
4. Ecosystem settings pattern (required)¶
For control domains (time/display/network/game runtime), RegCube is the persisted state plane in the standard model:
p1-<domain>svcdaemon owns transitions and background policy<domain>ctlCLI and Settings GUI are user/operator frontendsBoth frontend paths converge on the same RegCube keys and service behavior
Rule: no domain should keep a hidden second source of truth outside RegCube for persisted policy.
5. Edge cases¶
Case |
Policy |
|---|---|
Get failure |
Returns default string / |
Concurrent writers |
Last writer wins at kernel; cache must be write-through on set to stay aligned. |
Very large values |
Buffer sizes are fixed in client ( |
6. Operational keys in active use¶
Hive |
Key |
Used by |
|---|---|---|
|
|
Init + networking stack mode selection |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Last successful SNTP epoch |
|
|
Local time display policy ( |
|
|
Signed UTC offset minutes for local display |
|
|
Region profile selection ( |
|
|
Language preference key for future i18n consumers |
|
|
Date/time formatting preference key |
|
|
|
7. See also¶
system-architecture.md — where RegCube sits in the stack
time-and-clock.md — wall-clock service and key semantics
settings-control-pattern.md — canonical daemon/CLI/GUI settings model
ecosystem-philosophy.md — platform system-of-record rules
Legacy debt narrative (historical):
docs/foundation-debt.md§4.x