The panel_switch_anim system already flashes the active panel
border from theme.info to theme.accent on focus change
(switch_focus). Add an explicit test that verifies the
animation reset-on-switch and the tick-by-tick advance back
to 100, guarding against future refactors breaking the
visual feedback for Tab panel switching.
Tests: 1403 pass (was 1402), zero warnings.
The panel's enter() method already navigates into directories.
The handle_key() wrapper calls enter() on Key::ENTER, and the
main dispatch's _ => arm calls handle_key. Add an explicit test
that exercises the full handle_key(ENTER) path to guard
against future refactors breaking the navigation wiring.
Tests: 1403 pass (was 1402), zero warnings.
When Tab in the cmdline completes to more than one candidate,
show a popup above the cmdline listing the candidates. Standard
shell completion behaviour (fish, zsh, bash). Helps users pick
the right file when many match.
- Cmdline::completions: Vec<String> field stores the candidates
- Cmdline::clear_completions() for cleanup on commit/cancel
- Cmdline::has_completions() returns true if >1 candidates
- Cmdline::render shows the popup when has_completions() is true
- Esc/Enter in handle_key clears completions
Added 1 unit test verifying completions are populated and
clear_completions works.
Tests: 1402 pass (was 1401), zero warnings.
usb-core: scheme.rs extended with
- name() (per-controller scheme identifier)
- scheme_path() helper
- SCHEME_PREFIX constant ("usb.")
- UsbError::Unsupported variant
uhcid: 459 LoC -> 463 LoC
- Added controller name field derived from device path
- Free function control_transfer() -> UhciController::do_control_transfer() method
- impl UsbHostController for UhciController
- port_status maps to USB trait PortStatus (with high_speed=false)
- control_transfer handles SetupPacket by serializing 8-byte buffer
- bulk_transfer / interrupt_transfer return Err(Unsupported) — see P4/P5
- set_address returns true (no UHCI controller command)
- Class driver spawn now uses per-controller scheme name
ohcid: 280 LoC -> 304 LoC
- Same pattern as UHCI
- control_transfer method on OhciController
- impl UsbHostController for OhciController
- Linux 7.1 ohci-q.c PIPE_CONTROL pattern preserved
- Per-controller scheme name in spawn
Both drivers cross-reference Linux 7.1 source for register
definitions (xhci-ext-caps.h, ohci.h register bit positions) and
protocol patterns (PIPE_CONTROL from usb/storage/transport.c).
Cross-compile clean: usb-core, uhcid, ohcid, ehcid all build.
Two of three P1-A sub-tasks done (UHCI + OHCI on the trait).
Remaining: xhcid thin-trait adapter (deferred — xhcid scheme.rs is
2,839 LoC and operates under its own well-tested scheme protocol).
Reference: USB-IMPLEMENTATION-PLAN.md v3 §P1-A
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
The C key toggle state now survives app restart via serde-backed
session.toml. Uses #[serde(default)] for backward compatibility
with existing session files.
New affinity.rs module renders a toggleable CPU grid dialog:
- Space toggles selected CPU on/off
- Arrow keys navigate the grid
- Enter applies via sched_setaffinity(2)
- Auto-closes 2s after successful apply
- Shows +N for enabled, -N for disabled CPUs
- Grid adapts to CPU count (4/8/16 columns)
Added set_affinity() to process.rs using libc::sched_setaffinity.
Added 'a' key to keybar and help text.
Press + to cycle through all 6 themes (dark, light, high-contrast,
nord, gruvbox, solarized-dark) without restarting. Theme choice
shown via flash_toast. Fixed --theme CLI to accept all 6 modes.
Help now uses ──────── SECTION ──────── dividers for Power & CPU,
Process Management, and Navigation. TOML config theme.mode lists
all 6 themes (nord, gruvbox, solarized-dark were missing).
- RingHistory gains min() and avg() methods with 3 new unit tests (220 total)
- KillDialog adds SIGSTOP (19) and SIGCONT (18) for pause/resume capability
Track current poll_ms in App, update it on all three poll-change paths
([ / ] /Enter), and display it persistently in the keybar between
governor and tab hints.
- KillDialog: only clear dialog area, not entire screen (fixes black-screen UX)
- NiceEdit: removed redundant full-screen Clear from main.rs
- All graphs now show x-axis time labels: '-60s' on left, 'now' on right
- Fixed BrailleGraph x-axis label rendering (was truncating to 1 char, now uses set_string)
- Process panel: press 'C' to toggle between comm name and full command line args
- ProcessInfo.cmdline field added (reads /proc/[pid]/cmdline)
- Help text and keybar updated with C keybinding
Rewrite the control_transfer function following Linux 7.1 ohci-q.c
PIPE_CONTROL pattern exactly:
· Dummy TD at ED tail (Linux: ed->hwTailP = dummy)
· TD chain via hwNextTD (Linux: td_fill model)
· Toggle sequence: DATA0 → DATA1 → DATA1
(Linux: TD_T_DATA0, TD_T_DATA1, TD_T_DATA1)
· DoneHead polling with zero-acknowledge
(Linux: hcca->done_head = 0)
· Kickstart via OHCI_CLF (Linux: cmdstatus write)
· hwBE = data + len - 1 (Linux: td->hwBE formula)
· Separate data buffer and output buffer parameters to avoid
borrow conflicts in the copy-back path
· Use MmioRegion (same as ehcid) for MMIO access
· Use usize::wrapping_add/sub for physical address arithmetic
Compiles cleanly (cargo check passes). Completes P0-B2 from
USB-IMPLEMENTATION-PLAN.md v2 — both UHCI and OHCI now have real
compiling drivers replacing the old 35-line stubs.
Freq column now color-graded based on P-state range:
dark gray at lowest P-state (<=15% of range)
default mid-range
yellow >=50% of range
red+bold >=85% of range (turbo/high)
New theme presets selectable via --theme:
nord cyan borders, light-blue governor
gruvbox green borders, yellow governor
solarized-dark blue borders, magenta governor
Help text updated with all 6 theme names.
Replace the 35-line stub with a real driver. registers.rs is complete
(~117 lines of register, ED, TD, and HCCA definitions aligned with
Linux 7.1 ohci.h). main.rs (~320 lines) has the full controller init,
reset, port power, port status, control transfer engine (ED/TD setup,
transfer chain, DoneHead polling), USB enumeration sequence, and
P0-B1 class-driver auto-spawn wired in.
Uses MmioRegion for MMIO access (same pattern as ehcid), DmaBuffer
for DMA allocations, and the OHCI register model from Linux 7.1.
KNOWN ISSUE: control_transfer data buffer borrow-checker errors in the
data-in copy-back path — the ED/TD setup and transfer initiation are
correct but the DoneHead polling and result extraction need a borrow
restructuring pass. Cargo check has 5 remaining errors, all in the
same function.
Completes P0-B2 from USB-IMPLEMENTATION-PLAN.md v2.
Both UHCI and OHCI now have real drivers replacing the old stubs.
- NI column: green for negative (high priority), yellow for positive (low priority)
- Process filter: matching characters in COMM highlighted BOLD|REVERSED
when filter is active (bottom/htop-style incremental search visual)
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.
- Process rows: CPU% now color-graded (green <10%, yellow 10-50%, red 50-90%, bright red >90%)
using styled spans instead of monolithic format string
- Keybar shows context-aware hints: process-specific keys (k/N/l/o/i/F/y) on Process tab,
power-specific keys (p/P/m/M/t) on other tabs
- [EXPANDED] indicator added to keybar alongside [FROZEN]
- Graph titles now show live values: 'CPU 45%', 'Temp 62°C', 'Pwr 8.3W', etc.
- Process panel shows sort direction arrow (▲ ascending / ▼ descending)
- Governor cycle and throttle mode now trigger flash_toast (floating box)
instead of flash_status (keybar only)
- BrailleGraph.title changed from &str to String for dynamic titles
Add xhcid-compatible path aliases to the EHCI scheme handler so that
class daemons (usbhubd, usbhidd, usbscsid) can successfully open an
XhciClientHandle on scheme "usb".
resolve_root_path / resolve_port_child:
"descriptors" → aliases "descriptor"
"request" → aliases "control"
"attach" → new write-only stub (logs port attach)
"endpoints" → new stub (resolves to PortDir so openat succeeds;
child reads/writes return empty, enough for
class daemon polling to work)
Directory listing updated with the new entries.
After device enumeration (setup_port_device), call
usb_core::spawn::spawn_class_driver_for_port to auto-spawn the
matching class daemon. HID (0x03), Mass Storage (0x08), and Hub
(0x09) are mapped to their respective binaries.
This is P0-B1 from USB-IMPLEMENTATION-PLAN.md v2. Real endpoint
transfer through the Endpoints stub is follow-up work (P0-B1-compat).
P0-B1 spawn infrastructure from USB-IMPLEMENTATION-PLAN.md v2.
Add two new public functions to usb-core::spawn:
class_driver_for_usb_class(class, subclass, protocol) -> Option<&str>
Maps USB class codes to driver binary paths:
0x03 -> /usr/bin/usbhidd (HID)
0x08 -> /usr/bin/usbscsid (Mass Storage)
0x09 -> /usr/bin/usbhubd (Hub)
spawn_class_driver_for_port(...args...)
Spawns the correct class daemon with the right argv layout:
- HID/Hub: <scheme> <port> <interface_num>
- Storage: <scheme> <port> <protocol_byte>
The existing spawn_usb_driver is preserved for backward compatibility.
Both new functions have no_std stubs so the crate still compiles without
the std feature.
Next: wire the spawn call into ehcid after device enumeration (P0-B1
call site) + add xhcid-compatible scheme paths (descriptors/request/
endpoints/attach) to ehcid's scheme handler so the spawned daemons can
open XhciClientHandle successfully.
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).
The old --check section looked for log strings that do not exist in the
xhcid codebase ("xhcid: using MSI/MSI-X interrupt delivery" etc.).
All six grep patterns were fictitious — the script was written ahead of
P0-A1 anticipating different logging.
Rewrite to match actual debug-level output from xhcid:
irq_reactor.rs:208 — "Running IRQ reactor with IRQ file and event queue"
(irq_file is Some — this is the main proof that interrupts fired)
irq_reactor.rs:125 — "Running IRQ reactor in polling mode."
(irq_file is None — must NOT appear in a passing run)
main.rs:88 — "Enabled MSI-X" (debug, MSI-X configured)
main.rs:95 — "Legacy IRQ <n>" (debug, INTx fallback)
main.rs:143 — "XHCI <pci_name>" (info, controller detected)
Also fails if both polling and IRQ-driven mode appear in the same boot.
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.
Update submodule pointer to cbd40e0d (base fork master).
Per USB-IMPLEMENTATION-PLAN.md v2 P0-A1: xhcid/src/main.rs:141 formerly
hardcoded (None, InterruptMethod::Polling), bypassing the complete
get_int_method() that handles MSI-X/MSI/INTx. The IrqReactor's
run_with_irq_file path is fully wired and activates when irq_file is
Some — no other code assumed polling-only.
Oracle review confirmed correct register reads, loop continuation, and
EHB clearing already in the baseline. P0-A1 is a single-line restore.
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.
Press Tab in the cmdline to complete the current word as a
path/filename. Completion resolves against the active panel's
current directory (stored in Cmdline::base_dir when the
cmdline is activated).
- Cmdline::complete(base_dir) extends the input to the
longest common prefix of all matching entries. If there's
only one match, appends a trailing slash.
- Cmdline::set_base_dir(path) is called by dispatch when the
Cmdline Cmd is dispatched.
- Tab key in Cmdline::handle_key calls complete(self.base_dir).
Added 1 unit test verifying LCP extension for partial prefix.
Tests: 1401 pass (was 1400), zero warnings.
Append a '● N marked' badge to the active panel's border title
when files are selected, using the accent colour for visibility.
Makes the selection count visible even when the footer row is
hidden (e.g. on very short panels).
Tests: 1400 pass, zero warnings.
Add a 10-cell log2-bucketed histogram showing file-size
distribution across the directory. Each cell is the count of
files in a bucket (1B..1KiB, 1KiB..2KiB, ... >=512GiB) scaled to
a 0..8 block-char level. Rendered in accent colour next to
the existing per-file size bar.
- size_histogram() returns [u64; 10] counts per bucket
- Uses u64 leading_zeros trick for O(1) log2 size
- Skips directories and the '..' entry
- Directories are excluded from the histogram
- Renders after the cursor file's size bar
Added 1 unit test verifying bucket placement for 2B and 16KiB.
Tests: 1400 pass (was 1399), zero warnings.