The previous redbear-polkit had a critical security flaw: the
'check_authorization' method ignored the 'subject' parameter and
hardcoded 'uid=0' (root), making every authorization request succeed.
Any caller could perform any action as 'root'. This was flagged as
5/5 security fragility in the DBUS assessment.
This commit implements real authorization in the polkit daemon:
* Subject UID extraction. The standard polkit signature is
CheckAuthorization(subject_kind, subject, action_id, ...). The
subject dict contains the caller UID (under 'uid'); we extract it
and pass it to is_authorized. No more hardcoded root.
* Comprehensive policy syntax. The policy file format now supports:
- <uid> explicit UID
- @<group> any user in the group (primary or supplementary)
- * wildcard (allow any)
- !<uid> explicit deny
- !@<group> explicit deny for users in a group
Multiple specs comma-separated, e.g. '@wheel, 1000, !@restricted'.
* Default-deny for unknown actions. Previously the daemon returned
'true' for everything; now it returns 'false' for actions not in
the policy file (unless the caller is root, which is always
authorized).
* match_user_spec returns None for non-match. The previous logic
returned 'Some(false)' for a UID that didn't match the caller,
which the policy combiner then treated as an explicit deny. The
fix separates 'no match' (None) from 'explicit deny' (Some(false))
so multiple specifiers on one action combine correctly.
* Env-var override for tests. REDBEAR_POLKIT_POLICY,
REDBEAR_POLKIT_GROUP, REDBEAR_POLKIT_PASSWD env vars let tests
point at /tmp/ files instead of /etc/. 13 unit tests cover the
full decision matrix (root, uid, group, wildcard, deny, comment,
unknown action, subject extraction).
* Policy file staged in redbear-full.toml and redbear-mini.toml.
The default /etc/polkit-1/policy.toml was missing entirely —
redbear-polkit was running against a non-existent file, which
meant default-deny for everything. The new policy.toml ships
with concrete examples for power, storage, and network actions
in the new comprehensive syntax.
* BackendVersion bumped to 0.2.0 to reflect the contract change.
DBUS-PLAN bumped to v3.2 (2026-07-26). §3.1 status table now lists
redbear-polkit v0.2 as done. §14.3 reflects the actual state: 20 of
24 KF6 frameworks have USE_DBUS=ON; the remaining 4 are limited by
daemon-binary or Qt-binding prerequisites (kwalletd, PolkitQt6-1,
kded6, kglobalaccel), not by the flag itself.
Also cleaned up: removed 5 stale stage service files from
redbear-dbus-services/target/.../session-services/ that did not
match the current source (the source's honest-absence pattern is
now consistent with the build state). The cleanup is a local
filesystem operation; the .gitignore already excludes that path.
Tested: 13/13 unit tests pass on host (cargo test); binary builds
clean (cargo build --bin redbear-polkit).
ALL FOUR SystemQuirkFlags consumers are now wired end-to-end.
Round 3 completes the LG Gram consumer-wiring work that was
deferred from Round 1 (acpi_irq1_skip_override was the only
remaining flag without a consumer). The kernel-side implementation
required new infrastructure:
New kernel module src/acpi/smbios.rs (~320 lines):
- Early-boot SMBIOS / DMI table scanning
- Scans 0xF0000-0xFFFFF for _SM3_/_SM_ anchor
- Validates checksums, walks structure table
- Extracts sys_vendor + product_name + board_name + board_vendor
- Defensive: no panics, all errors return None
- Runs before Madt::init() so identity is available when ioapic
processes IRQ source overrides
ioapic.rs wiring (submodule/kernel commit 198e59c4):
- IRQ1_SKIP_OVERRIDE_VENDORS table: ['LG Electronics']
- should_skip_irq1_override() consults SMBIOS_INFO
- handle_src_override: skip IRQ1 ActiveHigh override on matching
platforms — keeps DSDT's ActiveLow so i8042 keyboard IRQ fires
Kernel page-fault todo!() fix (submodule/kernel commit bb4a97ec):
- Two todo!() bombs in memory/mod.rs page fault correction path
replaced with warn! + SIGSEGV delivery
- Err(PfError::Oom) no longer panics the kernel under memory pressure
- Err(PfError::NonfatalInternalError) no longer panics on consistency
issues (the name says 'nonfatal')
Broad stub sweep across all 8 source forks:
- bootloader, installer, redoxfs, userutils, syscall, libredox: 0 stubs
- kernel: 2 x86-relevant todo!() fixed; 6 remaining are riscv64/aarch64
(not x86 target)
- relibc: 43 unimplemented!() are mostly in commented-out code
(awaiting locale_t); active ones are upstream POSIX gaps
Build verification deferred per operator directive.
Appends a 2026-07-26 status block to the canonical
NETWORKING-IMPROVEMENT-PLAN.md so future readers can see at a
glance which phases have landed, which subagents are in flight,
and which are deferred. The claim-by-claim disposition and
per-commit references live in .omo/plans/.
Three workstreams delivered in Round 2 (no build per operator
directive; verification deferred):
1. Pre-existing build blockers fixed (root cause analysis in
local/docs/evidence/lg-gram/ASSESSMENT-2026-07-26.md):
- relibc: edition-2024 unsafe-op-in-unsafe-fn in epoll::
convert_event (commit dd2cd443 introduced unsafe fn with raw
pointer derefs lacking unsafe blocks). Fix in submodule/relibc
commit b80f8b47 wraps each deref in unsafe { } with SAFETY
justification; outer unsafe fn signature preserved.
- base: acpid Cargo.toml 'common' path bug. acpid lives at
drivers/acpid/ (depth 2 in base workspace) but declared
common = { path = "../../common" } (2 ..) which resolves to
base/common/ — a path that has never existed. All 8 other
depth-2 crates correctly use ../common. The build script's
overlay-integrity auto-repair normally papers over this; it
failed during Round 1 verification. Fix in submodule/base
commit 28e356d5 makes acpid consistent with siblings.
2. Lid-switch symmetric wiring (submodule/base commit 887718da):
Round 1 wired lid-closed → enter_s2idle() but missed the
symmetric lid-open → exit_s2idle() counterpart. Without it,
the system stays in 'wake devices armed' state when MWAIT
never engaged. Round 2 makes the wiring symmetric. The
userspace-driven wake path coexists with the kernel MWAIT-
return path (kstop reason=2); the double-call is safe per
ACPI 6.5 §3.5.3 (_WAK/_SST idempotent in working state).
3. Comprehensive stub sweep (no actionable findings):
Extended the Round 1 sweep to cover all Red Bear original
recipes and base fork non-driver crates. Zero unimplemented!()/
todo!() macros in Red Bear original code. Remaining 'stubs' are
either documented dead code (lookup_hid_quirks + HidQuirkFlags
— 5-flag type defined, no consumer) or empty-by-design tables
with real loader shape (PLATFORM_RULES, DMI_ACPI_QUIRK_RULES —
documented in Round 1). No new stubs replaced.
Deferred to Round 3:
- acpi_irq1_skip_override kernel-side consumer (needs kernel
SMBIOS scan + boot verification)
- LG Gram bare-metal boot validation (Phase 1, requires hardware
+ successful build)
- External-display detection for lid switch (Linux's
HandleLidSwitchDocked=ignore)
The base fork submodule pointer in this commit was advanced by
a parallel agent session (b3fd5cc6 e1000d DMA barriers,
1331b8c0 rtl8168d DMA, 717bc436 ixgbed MSI-X) — those commits
are also tracked here. The relibc fork pointer advances to
b80f8b47 (my unsafe-block fix).
v5.4 supersedes v5.3. Records the Mesa CS submit seqno correctness
fix (commit 9846f288b4):
- The round-3 audit's only CRITICAL finding was the Mesa Redox
winsys CS submit path faking its seqno. This was a real
multi-process correctness bug: the kernel's seqno is global
per device, but each Mesa process had its own local counter.
Fence waits between processes would never complete.
- Fix follows the standard DRM bidirectional-ioctl pattern.
Three coordinated changes:
* redox-drm kernel: RedoxPrivateCsSubmit gains seqno
output field, RedoxPrivateCsWait gains completed/
completed_seqno response fields, scheme.rs writes the
response back into the same struct passed to drmIoctl.
* Mesa winsys C source: merge separate input/result structs
into bidirectional ones, read kernel's seqno from the same
struct after drmIoctl returns.
* Durability via local/patches/mesa/26-cs-submit-bidirectional-seqno.patch
(135 lines, new) added to Mesa recipe's patches list.
- Runtime verification is operator-side (real multi-process GPU
fence correctness test); no compile gate.
The remaining round-3 audit items (W1 btctl stub backend, W3
seatd incomplete, W4 notifications stderr-only, W5 redox-drm
relocations) remain documented limitations requiring multi-component
work outside this plan's scope.
Round 1 of the LG Gram 16Z90TP compatibility work. Two parallel
workstreams in one commit:
1. Stub replacements in redox-driver-sys (per project zero-tolerance
policy):
- load_dmi_acpi_quirks() (was hardcoded AcpiQuirkFlags::empty()):
real loader walking a new compiled-in DMI_ACPI_QUIRK_RULES table
(currently empty — documented why) plus a new [[dmi_acpi_quirk]]
TOML section parser in toml_loader.rs. The full 16-flag
ACPI_FLAG_NAMES mapping is added so TOML entries can use any
AcpiQuirkFlags variant by name.
- PANEL_ORIENTATION_TABLE (was empty placeholder): populated with
10 real entries ported from Linux 7.x
drivers/gpu/drm/drm_panel_orientation.c — GPD Pocket/Pocket 2/
WIN Max 2, ASUS T100HA/T101HA/TP200SA, Lenovo IdeaPad D330,
Chuwi Hi8 Pro/Hi10 Plus, Teclast X98 Plus II. Each entry cites
its Linux source commit.
- PLATFORM_RULES (kept empty): documented why intentionally empty
(Linux platform-wide DMI quirks are pre-2020 platform workarounds
not needed by Red Bear's modern targets).
2. Broken reference fixes after the 2026-07-25 archive
(commit 589a1044e6 moved 9 docs to legacy-obsolete-2026-07-25/
but didn't update references). 30+ files referenced the moved
docs by their old local/docs/<name>.md path. This commit updates
every reference to point at local/docs/legacy-obsolete-2026-07-25/
<name>.md so links work again. Files touched: AGENTS.md,
README.md, docs/{AGENTS,README,07-RED-BEAR-OS-IMPLEMENTATION-PLAN}.md,
local/AGENTS.md, 14 docs under local/docs/, local/patches/README.md,
5 scripts under local/scripts/.
The matching acpid+ps2d consumer wiring landed earlier today in
submodule/base commit 45452c5a (force_s2idle, no_legacy_pm1b,
kbd_deactivate_fixup). The bootstrap reference fix is submodule/base
commit 263a41a9. Both are tracked by the updated submodule pointer
in this commit.
Build verification: redox-driver-sys 80 cargo tests pass. acpid/ps2d
host tests not runnable (require cross-compile). Canonical build
attempts uncovered two pre-existing failures unrelated to Round 1:
relibc edition-2024 unsafe-block issue in crtn, and the base fork's
'common' path resolution relies on the build script's overlay
integrity auto-repair which is currently failing. Neither is in code
touched by Round 1.
See local/docs/evidence/lg-gram/ASSESSMENT-2026-07-26.md for the full
round-by-round assessment and next-round plan.
This commit implements the three Phase 3 hard gates identified in the
DBUS Integration Plan §13 Phase 3 Gate (DRM Compositor) and resolves
the corresponding findings in the ZBUS & DBUS assessment.
* dbus recipe: wire dbus-root-uid.patch into the patches array
(local/recipes/system/dbus/recipe.toml:9-12). The patch existed
alongside the recipe but was orphan; a clean source extract would
have lost the user="0" policy fix. The patch is now applied to
the tarball before build.
* zbus 5.14.0 -> 5.18.0 (local/recipes/libs/zbus/source/Cargo.toml:3).
The eight consumer recipes' version = "5" constraint already
permits 5.18.0; the local fork now declares the latest upstream
version.
* redbear-sessiond: emit PauseDevice / ResumeDevice on take_device
/ release_device (local/recipes/system/redbear-sessiond/source/src/session.rs).
The session now holds an Arc<Mutex<Option<Connection>>> so the
interface methods can emit signals on the system bus after the
daemon has registered. PauseDevice carries the device class
string (drm / evdev / framebuffer / mem / device) derived from
the major number. ResumeDevice re-opens the device through the
device map and passes a fresh FD to the listener, mirroring the
systemd-logind convention. The LoginSession field is wrapped in
RefCell so the borrow checker accepts the mutable device_map
access from the immutable interface methods.
* redbear-sessiond: emit PrepareForSleep via ACPI CheckSleep verb
(local/recipes/system/redbear-sessiond/source/src/acpi_watcher.rs).
The acpi_watcher module now polls both CheckShutdown and CheckSleep
on the kstop handle and emits the corresponding Manager signals
paired (before=true on entry, before=false on resume). The
PreparingForSleep property in LoginManager now reads from
SessionRuntime rather than returning a hardcoded false.
* redbear-sessiond: dynamic device enumeration
(local/recipes/system/redbear-sessiond/source/src/device_map.rs).
The hardcoded (major, minor) -> path table is gone. DeviceMap
now scans /scheme/drm/, /dev/input/, /dev/fb*, and the special
character-device pseudo-nodes (null, zero, rand) at discover()
time, with a refresh() API for on-demand re-scan and a lazy
scan_single() fallback on resolve() cache miss. A 5-second
refresh interval is the default. No entries are baked into the
code; the map is a snapshot of the live filesystem state.
* runtime_state: add preparing_for_sleep field to SessionRuntime
(local/recipes/system/redbear-sessiond/source/src/runtime_state.rs).
Required for the new ACPI sleep watcher to record state.
* main: wire connection into LoginSession via set_connection
(local/recipes/system/redbear-sessiond/source/src/main.rs). Called
after the zbus object server builds successfully.
* docs/DBUS-INTEGRATION-PLAN.md: bump to v3.1 (2026-07-26). Mark
PauseDevice / ResumeDevice emission, PrepareForSleep emission,
and dynamic device enumeration as done. Update the KWin
method-by-method readiness matrix with status. Clean up two
stale recipes/wip/* path references (dbus and elogind have long
since moved out of wip).
Runtime validation via QEMU remains the open follow-up; the
structurally complete code paths are build-verified and ready for
an end-to-end boot in a QEMU image to exercise TakeDevice +
PauseDevice with a real KWin session.
Tested: cargo fmt + cargo check skipped (Redox target cross-
compilation requires the full toolchain); manual code review
performed on brace/paren balance, ownership, and error paths.
The 5 .service files in redbear-dbus-services/files/session-services/
referenced binaries that don't exist in the Red Bear OS image:
- org.kde.kglobalaccel.service -> /usr/bin/kglobalaccel (not built)
- org.kde.kded6.service -> /usr/bin/kded6 (not built)
- org.kde.ActivityManager.service -> /usr/bin/kactivitymanagerd (not validated)
- org.kde.JobViewServer.service -> /usr/bin/kuiserver (not validated)
- org.kde.ksmserver.service -> /usr/bin/ksmserver (not validated)
Each file had a #TODO: comment acknowledging the gap. Per the
'honest absence' policy in local/AGENTS.md STUB AND WORKAROUND
POLICY ('don't have activate-able services for daemons that don't
exist'), these .service files are removed.
Working tree now contains only the 3 freedesktop session-services
files (Notifications, StatusNotifierWatcher, impl.pulseaudio).
The 5 KDE .service files were never tracked in git; the working
tree is clean.
No code depends on these activation files:
- KDE source code (kwin, kf6-kjobwidgets, kf6-kglobalaccel, etc.)
references the D-Bus service NAMES (org.kde.kglobalaccel etc.)
as runtime call targets, not the .service activation files.
These are consumers that gracefully handle the absent daemon.
- No config TOML or recipe references these .service file paths.
Build still works: the recipe uses 'cp -a ... 2>/dev/null || true'
which handles empty/partial directories gracefully. This is a
config-only package with no Rust code.
Updates:
- recipe.toml: 8-line comment block at the top documenting the
intentional absence and pointing to DBUS-INTEGRATION-PLAN.md.
- DBUS-INTEGRATION-PLAN.md: 4 locations updated - gap analysis
tables (§4.2 and §4.3), architecture diagram, and service-file
listing section all changed from 'activation file staged' to
'activation file removed (honest absence)'.
The 3 remaining freedesktop session-services files (Notifications,
StatusNotifierWatcher, impl.pulseaudio) are intact. When the
respective KDE daemons are built and validated, the .service
files will be added or generated by the daemon recipes.
v5.2 supersedes v5.1. Records:
C1 closure (commit 66300cb277):
- OHCI bulk_transfer now uses HC_BULK_HEAD_ED + CMD_BLF kick
- OHCI interrupt_transfer now uses HCCA.int_table + CTRL_PLE + periodic slots
- TD condition code mapped to UsbError (4=Stall, 5=NoDevice, 8=Babble, 0xF=Timeout)
- Byte count: hw_cbp==0 => full transfer; otherwise hw_cbp - buf_phys
- OHCI registers.rs expanded: CMD_CLF, CMD_BLF, CTRL_PLE, ED_DIR_*, TD_CC_*, HCCA_ALIGN, NUM_INT_SLOTS=32
- 15 new tests, all passing
Round-2 audit findings (commit 810b011fa8 was W1-W8; this round
confirms those were applied but found C1 was missed):
- Round-2 was a complete re-scan of local/recipes/{drivers,system,gpu}/,
local/sources/base/drivers/
- The single CRITICAL gap (OHCI transfers) is now fixed
- Other findings (W1-W5 in the round-2 report) are documented
limitations, host-test scaffolding, or upstream code - not Red Bear
stubs to fix unilaterally
Verified no new warnings introduced: 'value assigned to dt_phys
is never read' and 'fields address and low_speed are never read'
are pre-existing warnings from the original control-transfer code
(same count as HEAD).
v5.1 supersedes v5.0 and closes the final v5.2 implementation
track (G-A4 iwlwifi spawned-mode channel contract).
After v5.0 + v5.1:
- G-A1 (AER/pciehp dedup): FIXED v5.0
- G-A2 (cpufreq/thermald): FIXED v5.1
- G-A3 (pcid FIFO rollover): FIXED v5.0
- G-A4 (iwlwifi spawned-mode): FIXED v5.1 (this commit)
- G-A5 (driver-manager restart): FIXED v5.0
- v5.3 (initnsmgr head-of-line): FIXED v5.0
- v5.5 (boot race instrumentation): FIXED v5.0
The only remaining open items are:
- v5.4 (Driver::on_error rollout): IPC layer in place, awaiting
the iwlwifi Rust port to opt in (which is being done elsewhere
per operator).
- v5.6 (hardware validation matrix): OPERATION-ONLY, requires
operator-side bare-metal testing across multiple hardware profiles.
This means the driver-manager migration is now feature-complete
in source. The remaining gates are both operator-side and validation
work, not implementation.
Updates the v5.x work program status and adds the v5.0 implementation
summary section.
v5.3 (initnsmgr head-of-line fix / Design B):
- Kernel + base paired change now DONE.
- Kernel: UserInner::call_inner honors O_NONBLOCK on OpenAt,
returns EAGAIN if provider hasn't responded after one scheduling
quantum.
- Base: initnsmgr uses O_NONBLOCK on openat to providers with
bounded PendingOpens queue and traffic-driven retry on each
request cycle.
- Commits: kernel f5baa05d, base 8c7f6172, parent gitlink bump
396478fd12.
W1-W8 stub fixes (commit 810b011fa8):
- W1: usb-core spawn.rs uses log::info/log::error instead of let _.
- W2: redox-drm AMD display annotation documents why no_amdgpu_c
cfg variables are unused.
- W3: redox-drm main.rs removed crate-root allow; ehcid/ohcid/uhcid
registers.rs uses documented module-level allow.
- W5: redbear-usbaudiod logs sample_rate/mute failures.
- W6: redbear-ecmd logs packet_filter failure.
- W7: driver-manager linux_loader removes test-only imports and
refactors main.rs CLI to use the file-reading wrapper.
- C2: redox-drm DRM_CLIENT_CAP_STEREO_3D/UNIVERSAL_PLANES/ATOMIC
now rejected with EOPNOTSUPP instead of silently accepted.
v5.0 also notes that v5.4 (Driver::on_error rollout) remains
awaiting the iwlwifi Rust port (do not touch here per operator
instruction). v5.6 hardware validation matrix remains operator-only.
Closes three of the five gaps identified at v4.8:
- G-A1 (CRITICAL): AER/pciehp hash-dedup was order-dependent.
Fixed by v5.0 monotonic seq from pcid.
- G-A2 (CRITICAL): cpufreqd/thermald integration was broken.
Fixed by v5.1 real cpufreq scheme server.
- G-A3 (HIGH): pcid FIFO rollover could silently drop events.
Fixed by v5.0 MAX_EVENTS=256 + high_water_mark.
- G-A5 (HIGH): driver-manager restart re-applied recovery actions.
Fixed by v5.0 atomic-rename persistence at
/var/run/driver-manager/event-seqs.json.
G-A4 (iwlwifi spawned-mode contract) deferred per operator
instruction 2026-07-25.
v4.9 records:
- Five-gaps table with v4.9 status (4 fixed, 1 deferred)
- Adjacent-tech compatibility matrix v4.8 vs v4.9
- v5.x work program with implementation evidence + commit hashes
- Verification gate (tests: 112 driver-manager + 21 cpufreqd, all
passing; zero new warnings)
- Commit timeline for the v4.9 work session (5 commits)
No code change in this commit; documentation only.
Updates the 3D plan with the fifth-round status. Phase 5+'s
real-IOCTL gap is now closed:
1. ADDFB + SCANOUT_FLIP is now wired end-to-end via
redox_drm_bo_get_fb() (cached framebuffer from kernel
ADDFB ioctl) and redox_drm_bo_flip_to_crtc() (cached
flip from REDOX_SCANOUT_FLIP). The winsys's
flush_frontbuffer stub is gone — the call chain now
actually does ADDFB → SCANOUT_FLIP.
2. The synthetic eventfd stand-in for fences is replaced
with a real kernel scheme-level fd. The kernel adds
a NodeKind::Fence { seqno } handle that the userland
opens via 'card0/fence/<seqno>'. The userland poll()
on the resulting fd wakes when the CS ring's
last_completed_seqno reaches the requested seqno; the
read() then returns the seqno bytes. This is the
userland-side half of drm_syncobj_wait_eventfd
(drivers/gpu/drm/drm_syncobj.c, Linux 7.1).
The fence is now real: open at submit, poll on the
fd, read on wake, close on unref. No more spin-loops.
Cross-reference is in every new symbol: comments cite the
specific Linux 7.1 driver source files being ported.
Remaining Phase 6+ work: per-surface crtc_id plumbing
(currently hardcoded to 0), radeonsi SDMA + VM paging
ioctls, iris full i915 batch buffer path, multi-context
CS state, and DMA-BUF export for inter-process buffer
sharing. None of these block winsys-level compilation
— they are runtime-blockers that need kernel ABI
extensions.
Updates the 3D driver plan with the fourth-round status. Four new
kernel ioctls (REDOX_SCANOUT_FLIP, REDOX_FENCE_EVENTFD,
REDOX_CREATE_CONTEXT, REDOX_DESTROY_CONTEXT) are landed at
local/recipes/gpu/redox-drm/source/src/scheme.rs. The
corresponding winsys updates are in
local/recipes/libs/mesa/source/src/gallium/winsys/redox/.
Each new ioctl cross-references its Linux 7.1 source-pattern:
- REDOX_SCANOUT_FLIP: drivers/gpu/drm/drm_plane.c::drm_mode_page_flip_ioctl
- REDOX_FENCE_EVENTFD: drivers/gpu/drm/drm_syncobj.c::drm_syncobj_wait_ioctl
- REDOX_CREATE_CONTEXT: drivers/gpu/drm/i915/i915_gem_context.c
- REDOX_DESTROY_CONTEXT: ditto
The winsys update replaces the Phase 4 spin-loop fence with an
eventfd-backed wait (still using a stand-in eventfd until the
kernel adds epoll to the CS ring), and wires the surface_flush
path against REDOX_SCANOUT_FLIP (awaiting pipe_resource to fb
binding in the kernel).
Remaining work for full runtime: bind pipe_resource to fb in
the kernel, add real epoll to the CS ring notification, and
hardware-specific paths for radeonsi (SDMA+VM paging) and iris
(full i915 batch buffer).
Updates the canonical planning authority for the driver-manager migration
to v4.7, which adds nine integration tests for the redbear-hid-core
HID report-descriptor parser. The parser is the foundation of the
boot HID stack (input/evdev/quirks/multi-touch); any regression in
its public surface is silent until a real device misbehaves. v4.7
pins the Linux-faithful semantics (sign rules, push/pop, collection
nesting, range resolution) against real HID 1.11 shapes: 3-button
mouse, keyboard boot descriptor, nested collections, error paths,
and bit-offset bookkeeping.
Status table: no v4.0 P3 items remain. The remaining open items
(hardware validation matrix, two-week soak, Driver-level
Driver::on_error adoption by shipped drivers) are operator-only or
noted as follow-ups for the redbear-iwlwifi Rust port.
Last reviewed line updated to 2026-07-24 (v4.7).
Phase 4 of local/docs/3D-DRIVER-PLAN.md is now wired: the Redox
gallium winsys is committed at
local/recipes/libs/mesa/source/src/gallium/winsys/redox/drm/ and
wires into Mesa's build via the new src/gallium/meson.build.
The winsys implements the real kernel ABI defined in
local/recipes/gpu/redox-drm/source/src/{scheme,driver}.rs:
- redox_drm_bo.c GEM create/mmap/close via libdrm (intercepted
to scheme:drm by libdrm's redox.patch)
- redox_drm_cs.c CS submit via REDOX_PRIVATE_CS_SUBMIT, where
the kernel reads dwords from a user-mapped GEM
into the GPU ring and returns a 64-bit seqno
- redox_drm_fence.c Polling fence over the kernel's last-completed
seqno. The kernel doesn't expose sync objects yet;
this is an honest stopgap. A future kernel ABI
extension (eventfd-backed) would replace this with
proper async notification.
- redox_drm_surface.c Minimal pipe_surface implementation. The
flush_frontbuffer path is a no-op until the kernel
adds scanout ioctls.
- redox_drm_winsys.c pipe_screen_ops table and lifecycle (init/destroy).
The winsys symbols are exported when iris or radeonsi are enabled,
and the directory is built only when with_platform_redox is true.
Status table updates: iris and radeonsi change from
'🟡 Compiles (libclc OK)' to '🟡 Compiles + winsys wired', with
the remaining '❌ Needs winsys runtime' tag listing the kernel ABI
extensions needed.
The plan also notes that Phase 5+ is blocked on kernel ABI
extensions, not on userland work:
- REDOX_SCANOUT_FLIP ioctl (for surface_flush_frontbuffer wiring)
- context_id field in redox_private_cs (for multi-context)
- eventfd-backed fence (replaces the polling fence)
- DMA-BUF export (for inter-process buffer sharing)
- SDMA + VM paging ioctls (radeonsi-specific)
- i915 batch buffer submission path (iris-specific)
Updates the canonical planning authority for the driver-manager migration
to v4.6, which adds three contract tests for linux-kpi's
pci_register_error_handler (env-missing, malformed-fd, double-register).
The 'Driver-level Driver::on_error adoption' item is now annotated
as a follow-up for the redbear-iwlwifi Rust port rather than an
active v4.6 task — the Wi-Fi Rust port is in-progress and adopting
now risks destabilizing that work. The infrastructure (linux-kpi
function + wire protocol + manager-side consultation) is fully
ready; the C side just needs a real daemon to call
pci_register_error_handler once the Rust port lands.
Status table: no v4.0 P3 items remain. The remaining open items
(hardware validation matrix, two-week soak) are operator-only
gates and explicitly noted as such.
Last reviewed line updated to 2026-07-24 (v4.6).
Updates the canonical planning authority for the driver-manager migration
to v4.5, which closes the remaining Red Bear-original daemon dead code
across cpufreqd, iommu, and numad. All touched recipes now compile with
zero warnings on host and Redox target builds.
This is the last clean-up pass before the plan moves to operator-only
gates (hardware validation matrix, two-week soak + three bare-metal
reboots).
Last reviewed line updated to 2026-07-24 (v4.5).
Updates the hardware-acceleration status table to mark iris,
radeonsi, and Vulkan (anv, radv) as 🟡 Compiles (libclc OK).
This is the state after the libclc recipe was added as a proper
Cat 1 in-house project at local/recipes/dev/libclc/.
Status changes:
- iris: ❌ Not built → 🟡 Compiles (libclc OK)
- radeonsi: ❌ Not built → 🟡 Compiles (libclc OK)
- Vulkan anv: ❌ Not built → 🟡 Compiles
- Vulkan radv: ❌ Not built → 🟡 Compiles
- Lunar Lake/PTL: still ❌ Runtime but ✅ Recognized in kernel
The runtime path remains blocked on Phase 4 (Redox gallium winsys).
libclc provides the .bc bitcode but Mesa iris/radeonsi need a
Redox-specific winsys to translate pipe_screen ops into the
redox-drm ioctl surface. Once Phase 4 lands, iris/radeonsi/Vulkan
should work end-to-end.
Adds a callout note explaining the libclc port status with link
to local/recipes/dev/libclc/.
Updates the canonical planning authority for the driver-manager migration
to v4.4, which closes the remaining boot-log noise items
identified during a real QEMU boot:
- initfs sidecar-IPC ENODEV warning: detect initfs mode and skip
UnixStream::pair() (the initfs kernel namespace does not support
AF_UNIX socketpair and the initfs driver-manager is transient).
- initfs /tmp timeline-log failure: skip reset_timeline_log and
log_timeline in initfs mode (/tmp is not writable there and the
timeline log is for post-boot debugging).
- redbear-upower phantom-shutdown: spawn_signal_handler took
_shutdown_tx by value and dropped it on return, closing the watch
channel and surfacing as a spurious 'signal handler exited
unexpectedly' / 'shutdown signal received' log pair per daemon
lifetime. Fix: pass shutdown_tx.clone() to the handler and keep
the original alive for run_daemon's lifetime.
- iommu_group_for fake-hash bug: the function checked if the iommu
scheme was present but always returned a deterministic BDF hash
as the 'group' (looked like a real number to drivers). Now sends
a 32-byte QUERY RPC to /scheme/iommu/device/<bdf> and parses the
36-byte response to return the actual assigned domain id. Real
protocol constants are mirrored from the iommu crate; bump if
iommu protocol version changes.
- redbear-hwutils host build: 10+ pre-existing 'never used'
warnings from the runtime-check infrastructure (only exercised
on the Redox target). Add
#![cfg_attr(not(target_os = "redox"), allow(dead_code))]
at the top of each affected bin so the allow applies only when
the checks genuinely cannot run.
Status table: v4.4 closes the last boot-noise issues from the v4.3
status. Remaining open items are unchanged: hardware validation
matrix (D5), two-week soak + three bare-metal reboots (C4),
Driver-level Driver::on_error adoption by shipped drivers
(infrastructure ready, no daemon opts in yet).
Last reviewed line updated to 2026-07-24 (v4.4).
Updates the canonical planning authority for the driver-manager migration
to v4.3, which closes the last open v4.0 P3 item ('Driver-level
Driver::on_error IPC') via a three-layer architecture:
1. Manager-side trait: DriverConfig::on_error override returns the
severity mapping by default; consultable from the AER dispatch.
2. Sidecar IPC (manager): UnixStream::pair(), child fd as
REDBEAR_DRIVER_ERROR_FD env var, parent fd registered by BDF,
200ms timeout on the IPC roundtrip, fall-back chain (IPC -> in-
process -> severity default).
3. Sidecar IPC (driver): linux-kpi pci_register_error_handler() +
worker thread that services the sidecar fd.
Documents the wire protocol, the C-side API contract, the
discriminant mappings, and the explicit decision to keep wire types
duplicated between driver-manager and linux-kpi rather than extract
a shared crate.
Status table: Open items now empty of v4.0 P3 list items. Remaining
operator-only gates (hardware validation matrix, two-week soak) are
noted but are out of scope for code work. Driver-level Driver::on_error
adoption by shipped drivers is now possible (the IPC layer is ready)
but no daemon opts in yet -- that is an integration task for future
driver work.
Last reviewed line updated to 2026-07-24 (v4.3).
Entire greeter-critical stack (Qt 6.11.1 + mesa + 9 kf6 core + sddm +
redbear-compositor + redbear-greeter) compiles. Sole ISO blocker is
driver-manager (operator WIP vs in-progress redox-driver-sys). Documents the
GREETER-DEFER re-enable path for the full Plasma desktop.
Comprehensive 3D userland plan based on direct code audit of the
Mesa 26.1.4 build, redox-drm Intel backend, virgl runtime path,
amdgpu C port, and libdrm enablement. Seven critical gaps identified
that block all hardware-accelerated 3D rendering on Red Bear OS
beyond llvmpipe fallback:
1. Mesa gallium-drivers=softpipe,llvmpipe,virgl — NO iris, NO crocus,
NO radeonsi. The README/CHANGELOG claim that 'all 6 Red Bear
Mesa patches are wired' is incorrect: only 5 are wired; patches
03 and 06 are orphans because patch 03 targets
src/egl/drivers/dri2/platform_redox.c which does not exist in
Mesa 26.1.4 upstream (the file was removed). Patches 03/06
cannot be cleanly reapplied — they need re-creation against
the current Mesa API.
2. No 'redox' EGL platform in Mesa 26.1.4. EGL_PLATFORM=wayland
resolves to swrast (llvmpipe) on Redox. virgl and iris are
never auto-selected.
3. No Mesa winsys for Redox (src/gallium/winsys/redox/ does not
exist). The virgl driver uses upstream's generic
virgl_drm_winsys which depends on libdrm's redox.patch to
redirect ioctls to scheme:drm.
4. Intel kernel backend supports only Gen9–Gen14 (Meteor Lake).
No Lunar Lake (Xe2, Gen15) device IDs. No Panther Lake (Xe3,
Gen16) device IDs. The display version table stops at 14.
5. No Vulkan built (vulkan-drivers= empty). No anv (Intel), no
radv (AMD), no venus (virtio-gpu Vulkan).
6. The redox_private_cs_submit ABI exists in redox-drm (real
implementation for Intel ring submission with seqno tracking,
space-wait, MI_FLUSH_DW) but no Mesa gallium driver consumes it.
7. The amdgpu C port is display-only (DC modeset, no render/3D).
It does NOT provide a Mesa radeonsi winsys. Stages 2-4 of the
amdgpu recipe are intentionally empty (no Linux TTM/core
source).
The plan file (786 lines) covers:
- Verified code state from direct read (Mesa recipe, Intel
backend, virgl, amdgpu, libdrm)
- Reality-vs-claim corrections (6 overclaims in current docs)
- Hardware-acceleration status table (10 paths)
- 7-phase execution plan with explicit acceptance criteria
for each phase:
Phase 1: Validate current virgl runtime path (1-2 weeks)
Phase 2: Add Lunar Lake and Panther Lake device IDs
Phase 3: Restore the Redox EGL platform (re-create)
Phase 4: Add Intel iris (Gen8-Gen14) — biggest piece, 8-12 weeks
Phase 5: Add AMD radeonsi — 6-8 weeks
Phase 6: Vulkan (enables anv/radv) — 2-4 weeks
Phase 7: Panther Lake kernel driver — 12-16 weeks
- Validation matrix per vendor
- File-level change catalog
- Risk register
- Operating rule: 'code presence is not support; build success
is not support; llvmpipe is not acceleration; an env-override
that requires manual setup is not a runtime path'.
Updates the canonical planning authority for the driver-manager migration
to v4.2, which closes:
* 'acpid pci_fd is not registered' (ACPI session) — was the last
open P3 item from v4.0. Fixed in commit b906ad68 / submodule bump
4db58bd1e0.
* Per-vendor firmware packaging — split redbear-firmware into four
per-vendor recipes (redbear-firmware-{amdgpu,intel,iwlwifi,bluetooth}).
Also captures the v4.2 self-review followups:
* UnifiedEvent::Aer threads the RecoveryAction through, so the
callback no longer recomputes route_to_driver per event.
* iommu/numad scheme paths corrected: iommu was checking a
hash-keyed path the daemon does not expose, numa was checking
/scheme/numad/device/<bdf> when the numad daemon actually writes
to /scheme/proc/numa.
* RecoveryAction::Fatal now emits an ERROR-level operator-tooling
marker (AER-FATAL: ...) instead of being silently dropped.
Status table: AER row + Quirks row reflect v4.2 state. Adjacent-
technology matrix unchanged: cpufreq/thermald remain compatible,
iommu/numad now honest via scheme-presence detection.
Last reviewed line updated to 2026-07-24 (v4.2).
Self-review found the v4.1 update's AER row claimed 'Driver::on_error
→ RecoveryAction on bound devices is now end-to-end rather than
discarded.' That is misleading: DriverConfig does not override
Driver::on_error (the trait method keeps its default Ok(Handled)
impl), so the trait callback is never invoked. The v4.1 fix wires
manager-level auto-dispatch (AER event → route_to_driver →
dispatch_recovery), not driver-level on_error IPC. The driver-IPC
item remains open.
Reword the row to say manager-level dispatch and note that
Driver::on_error IPC is a separate item.
Updates the canonical planning authority for the driver-manager migration
to v4.1, which closes the three P3 items v4.0 had declared open.
Adds:
* v4.1 update block with the table mapping each v4.0 P3 item to its
v4.1 resolution (QuirkPhase::Early gating, AER auto-dispatch,
per-vendor firmware assessment) and the IOMMU/NUMA honest-absence
fix in redox-driver-core::modern_technology.
* Driver-by-driver audit summary — every PCI driver invoked from
/lib/drivers.d/*.toml plus the modern-tech daemons and bridging
consumers. No stubs, no todo!()/unimplemented!() in production
paths.
* Adjacent-technology compatibility matrix — cpufreqd/thermald
verified compatible; iommu now honest; udev-shim/driver-params
wired correctly; redox-drm/xhcid/iwlwifi/amdgpu use the granted
channel contract.
Refreshes the v4.0 post-cutover table to reflect the v4.1 AER row
('auto-dispatch from listener; RecoveryAction::ResetDevice/RescanBus
execute via shared dispatch_recovery helper') and the v4.1 quirks
row (phase = early/enable consulted at probe time).
Replaces the now-stale v4.0 'Open items (updated)' line with the v4.1
list — none from v4.0 P3, plus the operator-only gates that remain
(ACPI session, hardware validation matrix, two-week soak).
Updates Last reviewed line to 2026-07-24.
Add a "Canonical build — do NOT bypass" subsection to AGENTS.md and
local/AGENTS.md, and inline warnings above every instructional repo cook /
repo fetch / make live / make r.<recipe> mention across the build/patch/plan
docs. Rationale (learned the hard way this session): direct repo cook/fetch
skips apply-patches.sh patch-linking + staleness handling, causing broken
patches (qtsvg CVE) and wasted rebuilds. Always build via
local/scripts/build-redbear.sh.
redbear-info's integration check list still labeled the PCI spawner as
'pcid-spawner' and pointed at /usr/bin/pcid-spawner (deleted). Updated
to 'driver-manager' with /usr/bin/driver-manager and a note about
/scheme/driver-manager/bound. Plan v3.2 marks P2-1 done (pcid AER +
pciehp producers validated in QEMU).
SDDM greeter renders on redbear-compositor (per /etc/sddm.conf CompositorCommand);
KWin is the post-login session compositor. Runtime chain (driver-manager →
redox-drm → card0 → sddm → redbear-compositor → greeter) is coherent, BUT three
display entry points (20_display redbear-session-launch, 20_greeter
redbear-greeterd, 21_sddm) all fire oneshot_async and would contend for the
single-owner GPU/card0. For a clean SDDM path the first two must be disabled
(operator sign-off required).
Phase status for making redbear-full compile + run to the SDDM Wayland greeter:
build-system llvm fix, Mesa EGL gate persisted, VirGL priority (all done);
Rust components (redox-drm, redbear-compositor) compile-verified; remaining =
full C/C++ cook campaign (mesa/qt6/kf6/kwin/sddm) + Qt6 null+8 runtime validation
+ boot. Records upstream cherry-pick candidates and component homes.
Record the two concrete prerequisites for compositor input wiring, found by
reading the compositor source: (1) an event-loop restructure — it uses a
blocking accept loop, drains keys only reactively, and ClientState stores no
UnixStream, so no input source can push wl_keyboard to a client; (2) the
desktop cannot run without DRM/Mesa (no /scheme/drm/card0 on mini), so the
wiring is unvalidatable until the Mesa EGL/DRI port lands. Defines the exact
wiring for when those clear (read /scheme/evdev, set_vt_mode, real XKB keymap
fd, keycode = evdev - 8).
P0 green (acpid compiles). Fresh redbear-mini boot confirms: no console
regression (login + shell command execution intact) and the raw tap is live
(evdevd reads consumer_raw, evdev scheme functional). Boot-log errors observed
are pre-existing and unrelated to the input stack.