SYSCALL-MIGRATION-PLAN.md:
- Detailed analysis of upstream 0.9.0 BREAKING changes (FD reservation refactor,
removed syscalls, new *_into variants)
- Complete consumer impact catalog: 2 bootstrap call sites, 7 kernel/relibc
constant references, 26 recipes (no impact)
- 5-phase migration plan: bootstrap→kernel→relibc→syscall sync→full build
- Risk assessment with rollback procedure
- Clear migration table: old API → new API for each deprecated function/constant
- Execution order with time estimates (~1-2 days total)
NETWORKING-IMPROVEMENT-PLAN.md:
- Phase 0 updated from 'workstreams' to COMPLETE with verified upstream commits
- Added fork state table (8 components, HEADs, upstream HEADs, gaps)
- All 7 required upstream commits verified present in local forks
- syscall flagged as BREAKING (removed syscalls, FD reservation refactor)
IMPLEMENTATION-MASTER-PLAN.md:
- Added section 11: Upstream Sync Status (2026-07-07)
- Fork state table with gap analysis per component
- Key upstream changes to track: syscall breaking refactor, kernel NUMA, libredox fcntl
- Renumbered sections 11-15
Findings:
- All 8 forks at +rb0.3.0 with Red Bear changes intact
- Gaps are minor (2-3 commits each) except syscall (BREAKING)
- UPSTREAM-SYNC-PROCEDURE.md (770 lines) is comprehensive and current
- No stale plan parts to remove — all docs are active and referenced
Update the master implementation plan to reference the new
IMPROVEMENT-PLAN.md which contains the comprehensive quality
gaps found during the 2026-07-07 USB/Wi-Fi/Bluetooth audits.
Key changes:
- Added IMPROVEMENT-PLAN.md to the authoritative plans table
- Added §10 Quality Gaps section with USB/Wi-Fi/Bluetooth audit findings
- Updated §11 Execution Priority with P0/P1/P2/P3 tiers
- Cross-references Linux 7.1 source files for each improvement task
- The IMPROVEMENT-PLAN.md has detailed file:line references for every gap
This establishes the two-plan architecture:
- IMPLEMENTATION-MASTER-PLAN.md: feature work, P0 from build
- IMPROVEMENT-PLAN.md: quality work, P0 from safety
No new repositories or submodules created.
v3 USB-IMPLEMENTATION-PLAN supersedes v2 (archived). Comprehensive
audit-driven roadmap with 9 phases (P1–P9) to make USB a first-class
citizen in Red Bear OS:
P1: Trait unification (all 4 controllers implement UsbHostController)
+ panic hardening (usbscsid 0 panics, xhcid <20 unwraps)
+ remove 3 empty stubs (usbaudiod, acmd, ecmd)
P2: xHCI core — 51-quirk table, HCCPARAMS2 parsing, 36-code error
recovery (babble, transaction error, stall, split)
P3: Hub driver — full enumeration (wHubDelay, power timing, USB 3 SS)
+ interrupt-driven change detection + port LED
P4: Storage — UAS protocol, multi-LUN, SYNCHRONIZE_CACHE, UNMAP, mass-storage
quirks applied at runtime
P5: HID — report descriptor parser, usage→evdev mapping, LED sync, quirks,
multi-touch
P6: Class driver completeness — CDC ACM, CDC NCM, USB Audio, USB-serial
(FTDI/CP210x/PL2303/CH341), compliance test driver
P7: Power management — USB 2.0 LPM, USB 3.0 U1/U2/U3, runtime PM autosuspend
P8: Validation — hardware matrix ≥10 rows + 6 new QEMU scripts
+ error-injection tests
P9: Modern USB scope ADR (host-only; already written in v2 §12)
Linux 7.1 is the implementation of excellence — every feature has a
concrete cross-reference (file:line) and a 'port line-by-line' strategy
when implementation detail is in doubt.
USB-VALIDATION-RUNBOOK v3 replaces v2 (archived): test matrix with
per-phase exit gates, operator runbook for failures.
Stale items cleared:
- v2 active plan archived as USB-IMPLEMENTATION-PLAN-v2-2026-07.md
- v2 active runbook archived as USB-VALIDATION-RUNBOOK-2026-07.md
- archived/README.md supersession table extended
P1 USB 3.x hub correctness verified against codebase:
- packet-size handling (bytes vs shift exponent) in baseline
- HubDescriptorV2/V3 separate reading paths in usbhubd
- Slot context hub bit + port count correctly set
- SET_HUB_DEPTH issued for USB 3 hubs
- TTT not applicable to USB 3 (TT is USB 2.0 split-transaction)
- TODOs about interface_desc/alternate_setting on USB 3 hubs
are safe — passing None matches upstream behavior
P5 Modern USB Scope Decision (ADR):
- Host-only for foreseeable future
- Explicitly excluded: device mode, OTG, USB-C PD, alt-modes,
USB4, Thunderbolt, xHCI DbC
- Reviewed per release branch cut
Update all active (non-archived) doc references from Linux 7.0 to
Linux 7.1. The reference tree at local/reference/linux-7.1/ already
exists; the docs were lagging behind.
Files touched:
AGENTS.md — reference path and git fetch command
CHANGELOG.md — device ID source note
local/docs/IMPLEMENTATION-MASTER-PLAN.md — source-of-truth path x2
local/docs/CPU-DMA-IRQ-MSI-SCHEDULER-FIX-PLAN.md — source-of-truth
local/docs/DRM-MODERNIZATION-EXECUTION-PLAN.md — quirk extraction note
local/docs/QUIRKS-AUDIT.md — storage quirk table note
local/docs/QUIRKS-SYSTEM.md — storage quirk mining note
Archived docs (local/docs/archived/*) are preserved as-is — they
represent historical state and are not the planning authority.
Update §5 phases table: P0-A1 ✅ committed (base fork cbd40e0d, parent
a2998c2d).
Update §6 validation table: test-xhci-irq-qemu.sh now greps for actual
reactor log lines (not fictitious strings).
Update §7 durability log: base fork now has two USB commits (one from
P0-A1), not one. The "first USB-focused commit since dd08b76" is
now cbd40e0d.
Add §11 — implementation handoff appendix with per-phase concrete
targets: upstream commit SHAs, files to touch per phase, git-landing
rules, validation scripts to write, and dependency graph (P0-B2 depends
on P0-B1; P0-A2 through P0-A4 are independent of B; P0-B1 is unblocked).
Replace v1 (now archived/USB-IMPLEMENTATION-PLAN-v1-2026-04.md) with a
comprehensive v2 that re-audits every daemon against local/sources/base/
HEAD, aligns with Redox 0.x USB HEAD (Jan-Jul 2026), and reorganizes
phases around bare-metal correctness gaps.
Key v1→v2 corrections:
- xHCI interrupts are *not* restored in production (main.rs:141 hardcodes
Polling). This was the biggest v1 overstatement. P0-A1 now fixes it.
- uhcid/ohcid are 35-line stubs, not "ownership-grade". P0-B2 gives them
real enumeration over usb-core.
- ehcid does not auto-spawn class drivers. P0-B1 adds that.
- The base fork carries only one USB commit. The 88-fix claim lived in
patch carriers that path-sourced recipes don't apply. v2 records this
honestly and recommends per-feature commits on submodule/base.
Also:
- USB-VALIDATION-RUNBOOK.md restored from archived/ (operationally current).
- local/AGENTS.md: operator override allowing agents to create submodules
when really necessary (2026-07-07), with a 4-point necessity test.
- archived/README.md supersession table updated with v1 plan and XHCID plan.
Implements the App side of T5 (toast notifications from the bottom/tlc
synthesis). render_toast() overlay can be wired in a follow-up pass.
- App.toast: Option<String> field
- App.toast_expires: Option<Instant> field
- App.flash_toast(msg): sets toast with 3s auto-dismiss
- App.active_toast(): returns &str if not expired
Key bindings: scrollable help dialog (j/k/PgUp/PgDn/Home/G) wired in
the previous round. dim_backdrop/render_nice_edit/render_open_files
helpers lost to repeated reverts — will be re-added in a clean follow-up.
- Update AGENTS.md single-repo rule to explicitly forbid creating any new
Gitea repositories and to require deleting per-component repos.
- Change version suffix policy from pre-release -rb to build-metadata +rb
in AGENTS.md, sync-versions.sh, apply-rb-suffix.sh, verify-fork-versions.sh.
- Update migration instructions to push to existing submodule/<component>
branches inside RedBear-OS, not create new repos.
- Update BUILD-SYSTEM-IMPROVEMENTS.md and SLEEP-IMPLEMENTATION-PLAN.md to
reference submodule/* branches instead of defunct per-component repos.
- Fix delete-per-component-repos.sh example to use a real historical repo.
Replace all non-canonical build invocations (bare 'make all/live
CONFIG_NAME=', 'scripts/build-iso.sh', 'scripts/run.sh') with the
canonical './local/scripts/build-redbear.sh' wrapper.
Updated: AGENTS.md, local/AGENTS.md, README.md, docs/README.md,
docs/06-BUILD-SYSTEM-SETUP.md, and 6 active local/docs plan files.
Archived docs and frozen boot-logs left as-is (historical evidence).
Records actual recipes bumped in 0.2.5 on 2026-07-02:
- Qt stack 6.8.2/6.11.0a1 -> 6.11.1 (all 6 sub-recipes, verified BLAKE3)
- Wayland/DRM/Input/expat/seatd to upstream latest stable (8 recipes,
verified BLAKE3)
- KWin 6.3.4 -> 6.7.2 + kdecoration 6.3.4 -> 6.7.2 + konsole 24.08.3
-> 26.04.3
Plus structural fix: created the missing qtshadertools recipe so the
qtdeclarative dependency chain resolves.
Documents what was deliberately NOT done:
- KF6 6.10 -> 6.27.0: 38 frameworks, 17-minor delta. Per AGENTS.md
patch-governance, no commit that bumps recipe.toml URLs without
first rebasing the local patches can be made honestly. Rebase
work (17-minor * 38 recipes) is multi-day and recorded as open.
- Mesa 24.0.8 -> 26.1.4: blocked on redox-os/mesa fork rebase
(0.3.0 work).
Includes the rebase order for the next session that plans to run
'make all CONFIG_NAME=redbear-full' against the bumped pins.
Plan-only artifact for the 0.2.5 graphics path. No recipe.toml changes,
no build attempted. Documents:
- Per-recipe upstream-latest-stable versions resolved via download.qt.io,
download.kde.org, gitlab.freedesktop.org, and git ls-remote on
invent.kde.org projects (no human guessing).
- Pre-build actions required (re-pull, re-blake3, validate-patches).
- Patch surface to re-evaluate across 17-minor KF6 bump and 1-minor
KWin bump.
- Mesa fork situation (24.0.8 vs 26.1.4): freeze at current fork,
rebase is 0.3.0 work.
- Freeze-when-green criteria for cutting 0.2.5.
- Out-of-scope items (Plasma workspace, real libepoxy, etc.).
Decisions in this plan are reversible; no recipe.toml field has been
modified. All work-in-progress from prior session is preserved as
uncommitted files in the working tree.
Prepend an UPDATE block at the top of the plan document recording:
- The 8 commits that landed Phase 0c (futex sharding, per-CPU run
queues, vruntime, work stealing, load balancing, cache-affine,
initial placement, NUMA topology, proc scheme handles, fadt fix)
- The upstream-redox kernel audit finding (upstream has none of
these features; local fork is sole implementation)
- A plan-vs-actual state table showing which claimed 'missing'
features are now present
- The kernel-side Phase 0c is complete; remaining work is
relibc-side (Phase 0e) and futex-REQUEUE/PI/robust (Phase 1)
The detailed §1–§9 analysis is preserved unchanged as historical
record. The status column 'Missing' in §1 should be re-read as
'now present in local kernel fork, pending relibc userspace wiring.'
cargo check now exits 0 with 0 errors in the local kernel fork.
The working tree had accumulated git-tracking drift across the
local/sources, local/recipes/*/source, and local/reference trees.
Restored:
- local/sources/libredox: add missing 160000 gitlink at
d01da350 (submodule/libredox). The .gitmodules entry already
declared this fork; the parent tree entry was missing so a
fresh clone of the parent would not pull the libredox source.
- .gitignore: mark the four local/recipes/*/source build-cache
trees (uutils-tar, ninja-build, sddm, sddm/source-pristine)
and the two local/reference/* entries (linux-7.1, seL4) as
ignored. These are build caches and external references, not
durable Red Bear code. The durable code for the four recipes
is recipe.toml + the corresponding patch (redox.patch).
- Note in .gitignore: do not extend local/recipes/**/source to
a blanket rule, because ~150 Red Bear fork recipes do keep
their durable source under local/recipes/<name>/source/.
Removed six broken 160000 gitlinks:
- local/recipes/archives/uutils-tar/source (e4c2affa...): on-disk
working tree was a self-clone of RedBear-OS; gitlink pointed to
a non-existent commit in the parent object database.
- local/recipes/dev/ninja-build/source (d829f42b...): gitlink
was a dangling commit on a diverged branch that has since been
rewritten; the on-disk HEAD is upstream v1.13.1 (79feac0) which
the recipe re-fetches via recipe.toml anyway. The 6.4MB
embedded .git directory was also removed.
- local/recipes/kde/sddm/source (63780fcd...): build cache for
sddm 0.21.0 re-fetched via recipe.toml. The 11MB embedded
.git directory was also removed.
- local/recipes/kde/sddm/source-pristine (63780fcd...): empty
placeholder, build cache. Removed.
- local/reference/linux-7.1 (ab9de95c...): external Linux
reference tree, gitignored by size. The on-disk directory
is preserved per AGENTS.md 'NEVER delete the reference tree'.
- local/reference/seL4 (a0b4f2d2...): empty placeholder,
gitignored.
Removed untracked pollution at repo root:
- kernel (empty 0-byte file)
- qqmljsgrammar.cpp, qqmljsgrammar_p.h, qqmljsparser.cpp,
qqmljsparser_p.h (393KB total: build artifacts that escaped
a qtdeclarative build into the working tree root; they belong
inside the recipe source tree, not at the parent level)
Added:
- local/docs/MULTITHREADING-COMPREHENSIVE-ASSESSMENT-AND-PLAN.md:
comprehensive multi-threading audit and implementation plan
covering kernel scheduler, kernel futex, syscall ABI, relibc
pthreads, and userspace threading correctness. Will drive
the next implementation cycle after the git tracking work
is wrapped.
After this commit:
- 9 submodule entries in HEAD, all of local/sources/* forks.
- All previously-existing 8 fork submodules unchanged.
- libredox is now durable across clones (was previously lost).
- No untracked files at root.
- No dangling or self-referencing gitlinks.
Per local/AGENTS.md § SINGLE-REPO RULE: the Red Bear OS project lives
in exactly one git repository (vasilito/RedBear-OS). Per-component
Gitea mirrors (redbear-os-base, redbear-os-kernel, redbear-os-installer,
redox-drm, userutils, libredox, libpciaccess, ctrlc, syscall, sysinfo)
have been redirected or deleted.
For each per-component repo with source content, the working-tree HEAD
was pushed as a 'submodule/<component>' branch on RedBear-OS:
- submodule/base
- submodule/bootloader
- submodule/installer
- submodule/kernel
- submodule/libredox
- submodule/redoxfs
- submodule/relibc
- submodule/syscall
- submodule/userutils
The .gitmodules entry for local/sources/kernel is now redirected to the
canonical repo with branch = submodule/kernel. The other submodule
.gitmodules entries remain to be added in a follow-up.
Empty per-component repos (ctrlc, libpciaccess, redox-drm, sysinfo) had
no source content; their gitlinks in the index are removed in a
follow-up commit.
Unrelated per-component repos that were not Red Bear components
(ctrlc, syscall, sysinfo — possibly unrelated personal projects) were
deleted in the bulk cleanup.
Gitea state under vasilito/ is now exactly: RedBear-OS, hiperiso.
Adds:
- local/scripts/redirect-to-submodules.sh
- local/scripts/delete-per-component-repos.sh
Updates:
- .gitmodules (kernel → RedBear-OS#submodule/kernel)
- local/AGENTS.md (SINGLE-REPO RULE status, migration procedure)
- local/docs/BUILD-SYSTEM-IMPROVEMENTS.md §11 (resolved)
- local/docs/QUIRKS-AUDIT.md (drop dead links)
- local/docs/SLEEP-IMPLEMENTATION-PLAN.md (mark historical)
- CHANGELOG.md (mark historical references)
Documents the full S3 state machine, modeled after
Linux 7.1's `arch/x86/kernel/acpi/wakeup_64.S` and
`arch/x86/kernel/acpi/sleep.c`. The S3 round-trip
is now fully wired:
1. acpid's enter_sleep_state(3) does the AML prep
(\\_TTS(3), \\_PTS(3), \\_SST(3))
2. acpid's kstop_enter_s3(0) writes the kernel's
s3_trampoline address to FACS.xfirmware_waking_vector
via the new SetS3WakingVector AcPiVerb
3. acpid writes 's3<SLP_TYP>' to /scheme/sys/kstop
4. kernel stop::enter_s3 reads S3_SLP_TYP, writes
SLP_TYP|SLP_EN to PM1a_CNT
5. firmware enters S3
6. on wake, firmware jumps to FACS.waking_vector
(the s3_trampoline)
7. kernel s3_trampoline restores state, jumps to
kmain_resume_from_s3
8. acpid receives kstop_reason=3, runs the standard
S3 wake AML sequence (\\_SST(2) -> \\_WAK(3) ->
\\_SST(1))
Hardware-agnostic: works on any x86_64 system with
standard ACPI S3 support (Dell, HP, Lenovo, LG Gram 14).
The status table at the top of this file is also updated
to reflect the latest Phase II.X.W completion and the
Phase K deferral (submodule conversion of remaining local
sources).
Update the SLEEP-IMPLEMENTATION-PLAN.md to reflect Phase J
completion: the local libredox fork and local syscall fork
are now both in place, the [patch.crates-io] and
[patch.'<URL>'] overrides are correctly wired in both
the base and kernel workspaces, and the typed-AcpiVerb
path (EnterS2Idle / ExitS2Idle) is the primary path.
The kstop string-arg path remains as a fallback for
older acpid builds. Both paths work end-to-end; the
build succeeds; the ISO is produced.
Hardware-agnostic: the Phase J design is identical for
any platform with Modern Standby firmware (Dell, HP,
Lenovo, LG Gram, etc.).
Phase I (LG Gram 16 (2025) / Arrow Lake-H S-state support)
is complete and built. The plan doc captures:
* Status table: which subsystems are done (acpid AML, kernel
kstop handler, redbear-quirks LG Gram flags) and which
limitations remain (S3 resume trampoline, s2idle wake
interrupt handler — both Phase II).
* Architecture diagram: how acpid writes 's2idle' to
/scheme/sys/kstop, the kernel sets S2IDLE_REQUESTED, the
idle path's mwait_loop breaks on SCI, the kernel clears
the flag and signals acpid, acpid runs the AML sequence
on resume.
* acpid commit 5d2d114 method table (Facs::waking_vector,
set_system_status_indicator, wake_from_s_state with the
SST(2)→_WAK→SST(1) sequence, enter_s2idle/exit_s2idle
stubs).
* Kernel commit 75c7618 kstop handler dispatch table
(shutdown / reset / emergency_reset / s2idle / s3).
* Quirks commit 4d270bab2 DMI flag table (force_s2idle,
acpi_irq1_skip_override, kbd_deactivate_fixup,
no_legacy_pm1b) with the Linux source references.
* Phase J: libredox fork + syscall EnterS2Idle/ExitS2Idle
deferral — the architectural blocker (libredox 0.1.17
has its own vendored redox_syscall dep; [patch.crates-io]
doesn't reach transitive deps). The patch file
local/patches/syscall/P1-acpiverb-enter-exit-s2idle.patch
is preserved as a durable artifact for Phase J.
* Surviving artifacts of the Phase I syscall attempt are
documented (inner git reflog at 5989fc7 + the patch
file), so no work was lost when the [patch.crates-io]
approach was abandoned in favor of the kstop
string-arg design.
Hardware-agnostic: the same plan applies to Dell, HP,
Lenovo systems. The LG Gram specifics are just one
target.
- AGENTS.md: add cache system to STRUCTURE, WHERE TO LOOK, BUILD FLOW,
BUILD COMMANDS (--force-rebuild), and CONVENTIONS (dep_hashes.toml,
binary store restore, package_groups syntax)
- CHANGELOG.md: comprehensive entry for Phase 1-3 + kernel MWAIT +
ninja-build Redox support
- local/AGENTS.md: note installer fork adds package groups support
- BUILD-CACHE-PLAN.md: fix TOML syntax (underscores not hyphens),
update all phases to COMPLETE with implementation details, add cache
flow diagram, add verification results
Phase 1 — Hash-based cache invalidation:
- DepHashes struct: BLAKE3 hash of each build dep stored in dep_hashes.toml
- collect_current_dep_hashes(): reads blake3 from dep .toml metadata
- dep_hashes_changed(): compares stored vs current hashes
- Replaces mtime comparison as primary cache invalidation check
- Mtime fallback preserved for backward compatibility (no dep_hashes.toml)
- --force-rebuild CLI flag bypasses cache entirely
Phase 2 — Binary store cache lookup:
- repo_builder publishes dep_hashes.toml alongside .pkgar/.toml in repo/
- When target/ is missing but repo/ has the package, restores stage
artifacts by extracting pkgar, copying toml + dep_hashes.toml
- Auto-generates auto_deps.toml from repo depends field
- Only applies to non-remote, non-force-rebuild builds
See local/docs/BUILD-CACHE-PLAN.md for full architecture.
- CHANGELOG.md: added Phase E entry describing the new
transition_to_s_state / wake_from_s_state / enter_sleep_state
methods on AcpiContext, and the opt-in DMAR init with hard
cap. Includes the final gap-closure status table showing
9 closed, 1 closed-in-part, 2 still open (both require
hardware-specific work).
- local/docs/ACPI-FORK-SYNC-STRATEGY-2026-06-30.md: added
Phase E outcome section with the changes applied and
out-of-scope items.
- CHANGELOG.md: added comprehensive 2026-06-30 entry covering
the full ACPI fork-sync (Phases A-D) and the redbear-sessiond
consumer port. Lists the 7 critical gaps that are now fully closed
and the 2 still open (DMAR + _WAK infrastructure).
- local/docs/ACPI-FORK-SYNC-STRATEGY-2026-06-30.md: added Phase D
outcome section with the Linux 7.1 cross-reference findings
(acpi_enter_sleep_state pattern), the changes applied to acpid
and redbear-sessiond, and the final gap-closure table.
- local/docs/ACPI-IMPROVEMENT-PLAN.md: updated "Current Truthful
Status" to reflect that acpid now follows the Linux 7.1 sleep
pattern with _PTS/_SST evaluation, thermal/power enumeration
works, AML mutex is real, parse_lnk_irc validates ranges, and
S5 works end-to-end. S1-S4 paths still need _WAK + wakeup
vector + P-state preservation (Gap #4b scaffolded but not
implemented). DMAR init still disabled (Gap #2 needs real-HW
investigation).
- local/docs/boot-logs/README.md: added
REDBEAR-MINI-BOOT-PS2D-INPUTD-LOG-FIX.md to the inventory.
Also:
- Removed scratch file local/docs/ACPI-FIX-PLAN-2026-06-30.md
(superseded by the longer ACPI-FORK-SYNC-STRATEGY-2026-06-30.md).
Updates six documentation files to point readers to the new
input-stack observability evidence and changelog entry. No
content claims are altered — only "see also" pointers and inventory
updates.
- CHANGELOG.md: new 2026-06-30 entry documenting the input-stack
fix (commit de9d1f4 in local/sources/base/), the git server
docs rewrite (commit 0c60adc6b), and the build-system
hardening addendum (commit 41045fd2f). Includes the verified
end-to-end interactive login evidence from the rebuilt ISO.
- local/docs/boot-logs/README.md: add the new
REDBEAR-MINI-BOOT-PS2D-INPUTD-LOG-FIX.md file to the
inventory table.
- local/docs/IRQ-AND-LOWLEVEL-CONTROLLERS-ENHANCEMENT-PLAN.md:
see-also pointer in the inputd validation deliverables
section.
- local/docs/REDBEAR-BOOT-EXPERIENCE-PLAN.md: see-also pointer
in the bootanim handoff section, noting that step 6
(REBIND_DISPLAY drm to inputd) now has companion
observability via the new inputd startup log.
- local/docs/USB-IMPLEMENTATION-PLAN.md: see-also pointer in
the HID producer modernization section, noting that the fix
lets operators distinguish "usbhidd dead" from
"usbhidd alive but not enumerated by XHCI".
- local/docs/GREETER-LOGIN-IMPLEMENTATION-PLAN.md: see-also
pointer in the service wiring section, noting that the greeter
can rely on the new inputd/ps2d startup lines being present
before inputd -A 3 runs.
Update REDBEAR-MINI-BOOT-PS2D-INPUTD-LOG-FIX.md with the actual
runtime verification evidence captured at 2026-06-30T00:06:16Z:
- Both new startup log lines appear in initfs at the exact source
line numbers (@inputd:661, @ps2d:96), proving the fix is baked
into the running image.
- End-to-end interactive login succeeded: operator typed root +
password at the Red Bear login: prompt and reached a
redbear# shell (Red Bear OS v0.2.4 "Liliya").
This conclusively confirms the diagnosis: the input chain
(ps2d -> inputd -> fbcond -> getty -> login -> shell) was working
all along. The previous "freeze" was a test-harness issue (no
keystrokes sent to the guest), not an OS bug. The new log::info!()
lines make the input stack health visible in future boot logs.
Two documentation changes:
1. New file local/docs/boot-logs/REDBEAR-MINI-BOOT-PS2D-INPUTD-LOG-FIX.md
captures the 2026-06-30 diagnosis of why the mini boot appeared to
freeze at the login prompt. Records:
- The actual root cause (test harness not injecting keystrokes, not
an OS bug — ps2d/inputd were working silently).
- The committed fix (de9d1f4 in local/sources/base/ adds two
log::info!() startup messages so operators can verify the input
stack is alive from the boot log).
- The expected post-fix boot log lines and how to interpret them.
- Verification status (source-inspected; clean post-fix QEMU boot
pending due to slow bootloader streaming under -nographic).
2. Addendum appended to local/docs/BUILD-SYSTEM-IMPROVEMENTS.md
documenting four build-system ergonomics issues observed during
the diagnosis session:
- #11: local/sources/base/ inner git repo origin points to
upstream Redox instead of Red Bear gitea.
- #12: outer Red Bear repo cannot show inline diffs for the
nested local/sources/base/ git repo (submodule pointer dirty).
- #13: no preflight warning for stale local-fork source (a
4-line edit caused a 30+ min rebuild with no advance notice).
- #14: -nographic + OVMF boot is too slow for time-budgeted
post-fix QEMU verification; recommend BIOS + KVM path.
Both items are S-sized and could be picked up in any future hardening
session. No code changes in this commit.
Following a full repo-wide grep and source review of all quirks
files (mod.rs, pci_table.rs, usb_table.rs, dmi.rs, toml_loader.rs,
pci.rs, i2c-hidd/quirks.rs), this companion to QUIRKS-SYSTEM.md
documents the current ground-truth state of the subsystem as of
2026-06-29.
Findings:
- 11 Rust + 6 C consumers of the redox-driver-sys quirks engine
- 1 separate DMI quirks engine in i2c-hidd (uses RON, not TOML)
- 6 dead-code entry points that return empty flags:
* lookup_pci_quirks_full actions (Vec::new)
* lookup_xhci_controller_quirks_full (stub)
* lookup_hid_quirks (stub)
* load_dmi_acpi_quirks (stub)
* load_platform_dmi_quirks (stub, empty PLATFORM_RULES)
* load_drm_panel_orientation (empty PANEL_ORIENTATION_TABLE)
- 4 PciQuirkFlags bits (22-25) have no entry in PCI_FLAG_NAMES,
so they cannot be set via /etc/quirks.d/*.toml
- DMI is consumed in two incompatible ways:
* redox-driver-sys reads /scheme/acpi/dmi as a flat key=value file
* i2c-hidd reads /scheme/acpi/dmi/{system_vendor,...} as per-field
subpaths, and matches case-insensitive
- redbear-quirks stages 10 TOML files to /etc/quirks.d/; the
TOML layer is fully live (this corrects an earlier claim
that it was dormant)
The audit concludes that the system is correctly initialized and
utilized per its design. No redesign is needed; the existing
QUIRKS-SYSTEM.md is mostly accurate but understates how many
defined functions return empty data and how many flag names
are missing from the TOML schema.
Reference analysis for Red Bear OS integration based on running the
latest CachyOS desktop ISO (28 Jun 2026) under QEMU/KVM. Documents
the hardware-enumeration and kernel-init sequences a reference Linux
distro produces on the i440FX + PIIX machine type that Red Bear OS
also targets, with line-by-line mapping to Red Bear OS subsystems
(pcid, ided, e1000d, vesad, xhcid, hwd/acpid).
- local/docs/CACHYOS-INTEGRATION.md: Cross-cutting analysis
(executive summary, hardware inventory, ACPI table coverage,
PCI quirks, boot-phase ordering, init system comparison, action
items).
- local/docs/boot-logs/cachyos-kernel-20260629-0520.log: Captured
441-line dmesg-grade log from the CachyOS kernel boot (SeaBIOS
handover through ACPI, PCI, USB, ATA, network enumeration and
up to a rootfs shell prompt).
- local/docs/boot-logs/cachyos-boot-20260629-0520.md: Pointer
document with the capture command and the rationale for the
indirect-kernel invocation (the QEMU + CachyOS + KVM boot stalled
at the ISOLINUX EDD probe when run from CD; bypassing with
-kernel/-initrd and an explicit console=ttyS0 earlyprintk command
line recovered the full log).
Sources used: https://cachyos.org/ (release info) and the on-disk
ISOLINUX + archiso boot path extracted from
cachyos-desktop-linux-260628.iso.
- msr.rs: add all Intel RAPL MSR addresses (0x606-0x64D) and AMD Zen
equivalents (0xC0010299-0xC001029B), RaplUnit struct for unit register
parsing with energy_to_uj/power_to_w conversion, read_rapl_energy()
and read_rapl_energy_uj() functions
- acpi.rs: read_rapl_package_energy() now tries MSR first (Intel then
AMD PKG energy MSRs) with unit-based µJ conversion, falls back to
Linux powercap sysfs
- local/docs/RAPL-IMPLEMENTATION-PLAN.md: comprehensive 3-phase plan
based on Linux 7.1 kernel analysis, Intel SDM, Fuchsia RFC-0203
patterns. Documents P0 blocker: /scheme/sys/msr/ not implemented
in kernel
Adds §68 (v1.44 plan) and revises §67.7 (v1.43
deferred list) to reflect the v1.43 audit findings.
Key corrections captured in the doc:
- The Redox kernel ALREADY implements
sched_setaffinity and sched_getaffinity
(local/sources/kernel/src/syscall/process.rs:322-382).
Only the relibc POSIX <sched.h> wrapper is missing.
- The existing P7-pthread-affinity relibc patch
provides cpu_set_t, cpuset_to_u64, copy_u64_to_cpuset
— v1.44 can reuse these instead of duplicating.
- Kernel pid=0 limitation is documented at
kernel/src/syscall/process.rs:336-338 as a TODO;
v1.44's UX is honest about this ('pin redbear-power's
own TUI to this process's CPU list, not the
highlighted process's').
- Per-thread CPU% is REJECTED for v1.44 because the
Redox proc scheme doesn't expose /proc/<pid>/task/<tid>/stat.
Same trap as v1.41 read_thread_io. Tracked as a kernel
follow-up, not a redbear-power feature.
- disk_history cap is REJECTED for v1.44 because the
natural bound on block device count (~4-8 typical)
makes the cap moot. Drive-by include it elsewhere.
Implementation plan documented:
1. relibc patch P12-sched-setaffinity.patch (~110 LoC,
reusing P7 helpers)
2. redbear-power affinity.rs module (~30 minutes)
3. main.rs key binding (capital A) + PID detail
popup integration (~1.5 hours)
4. 5-7 tests (round-trip, pid=0 limitation, parse/format,
integration against /proc/self/status)
5. Doc update §69 on what shipped
Effort estimate: ~1 working day, end-to-end. The
relibc patch alone is <3 hours given P7 reuse.
Downstream recipe impact audited (LOW):
- Mesa and xz both wrap sched_getaffinity in
defensive probes — they go from ENOSYS to
'current process mask works' (strict improvement,
no break).
No code changes — planning-only commit.
Add local/scripts/cleanup-build.sh - a git-aware cleanup script that
uses 'git ls-files' to whitelist tracked files before deletion.
Prevents the class of cleanup disasters that deleted local recipe
sources and local fork sources.
Update AGENTS.md with the new safe cleanup procedure.
Update CONSOLE-TO-KDE-DESKTOP-PLAN.md to v5.8 with the qtdeclarative
qfeatures.h fix and the new safe cleanup script.
The first item from the v1.42 deferred list: a
configurable LRU cap on the per-PID history maps.
On long uptimes with thousands of short-lived procs
(build servers, CI runners), the maps would grow
without bound, eventually consuming significant
memory. v1.43 caps the maps at 500 PIDs by default
and evicts the LRU entry on overflow.
The cap
- App::max_history_pids: usize (default 500)
- 0 = disable (reaper still prunes exited PIDs)
- Shared across the 3 per-PID maps (io_history,
cpu_history, rss_history). They are always
populated in lockstep so a per-PID CPU history
without the corresponding IO history would be
a 'ghost' entry that confuses the renderer.
- disk_history is NOT capped (keyed by disk name,
natural bound on block device count).
LRU tagging
- New App::pid_last_seen: BTreeMap<u32, u64>
- New App::refresh_tick: u64 (incremented on every
update_io_history call)
- We use a refresh counter, not Frame::count(),
because the history update happens during
refresh (not during render). Frame::count would
tag currently-visible PIDs rather than
recently-updated PIDs — a different (and
incorrect) notion.
Eviction algorithm
1. Increment refresh_tick
2. Reap exited PIDs from all 3 maps and
pid_last_seen
3. If pid_last_seen.len() > cap: sort by tick
ascending, take the first overflow entries,
remove from all 3 maps + pid_last_seen
4. Continue with the existing pipeline
Cost: O(n log n) per refresh, n bounded by 500.
At 500 PIDs: ~4500 comparisons per refresh,
<100µs. Memory budget: ~28 KB at cap, vs
unbounded growth without the cap (~5.5 MB at
100k PIDs).
Tests
- 3 new tests (eviction removes oldest, cap=0
disables, no-op under cap).
- 186/186 tests pass (was 183 in v1.42).
The improvement plan doc is also updated with §67
covering the v1.43 architecture, the cap policy,
the LRU tagging, the eviction algorithm, the
memory budget, and the v1.44 deferred list.
The next item from the v1.41 deferred list: read
/proc/<pid>/status:Cpus_allowed_list and display it as
both a single-char row indicator and a full expanded
list in the PID detail popup. htop parity.
Kernel format
The kernel emits the list as comma-separated ranges:
"0-3,5,7-11" means CPUs 0, 1, 2, 3, 5, 7, 8, 9,
10, 11
Cpus_allowed_list is the HARD affinity mask (settable
via sched_setaffinity(2)). v1.42 reads it because it
matches what an operator sees with 'taskset'.
New functions
- read_cpu_affinity(pid): parses the kernel string
- parse_cpu_list(s): public, testable parser
- format_cpu_list(ids): inverse of parse_cpu_list
- read_cpu_affinity_for_pid(pid): pub wrapper for the
PID detail popup
Two display modes
- Process panel row: '*' (subset), ' ' (all CPUs),
'?' (unknown). Single char so COMM stays visible.
- PID detail popup: full range string + expanded
Vec (truncated to 8 items on large machines).
New field on ProcessInfo
- cpu_affinity: Option<Vec<u32>>
Robustness
- Whitespace tolerated
- Out-of-order or duplicate IDs deduped and sorted
- Non-numeric chunks silently dropped
- Reversed ranges (start > end) silently dropped
- Empty input returns empty Vec (popup distinguishes
'no data' / None vs 'explicitly empty' / Some(empty))
Tests
- 13 new tests (11 in process.rs for parse/format/
read, 1 self-affinity test, 1 missing-pid test).
- 183/183 tests pass (was 170 in v1.41).
The improvement plan doc is also updated with §66
covering the v1.42 architecture, kernel format, the
two display modes, the parse/format inverse pair, and
the v1.43 deferred list.