Commit Graph

1981 Commits

Author SHA1 Message Date
vasilito 8060a9640b lg-gram-16z90tp: Phase 0 — collision fixes, quirks pipeline, firmware tables
Host: LG Gram 16Z90TP-G.AL89C (Arrow Lake-H, Core Ultra 7 255H).
Plan: local/docs/LG-GRAM-16Z90TP-COMPATIBILITY-PLAN.md

- drivers.d: scope e1000d + rtl8168d matches to subclass 0 (Ethernet);
  the vendor+class wildcard also claimed Intel/Realtek Wi-Fi (subclass
  0x80) and collided with redbear-iwlwifi (e.g. BE201 8086:7740)
- xhci_table: add universal SPURIOUS_SUCCESS rule for hci_version > 0x96
  (Linux xhci.c:5477); LG Gram 8086:7ec0/777d now get exactly Linux's
  flag set (0x200009810); flag-parity test added
- quirks: repair system-quirk pipeline — dmi_system_quirk entries with
  flags like force_s2idle silently parsed to empty sets. Add
  SystemQuirkFlags (4 flags), DmiSystemQuirkRule, dual-namespace TOML
  parsing, quirks::system_quirks() consumer API, and the LG 16Z90TP
  DMI anchor (board_name match)
- firmware: iwlwifi candidate tables prefer the c-prefixed iwlmld
  series (c106..c101) for BE201/CNVi; gf-a0 capped at 100 per
  host/linux-firmware evidence; fallback chains updated
- firmware-loader: map flat iwlwifi-* requests into the post-2026
  linux-firmware intel/iwlwifi/ layout (builtins + TOML fallbacks)

Tests: redox-driver-sys 72, firmware-loader 11, redbear-iwlwifi 8,
redbear-wifictl 21 all pass; all four components cook for
x86_64-unknown-redox; make lint-config clean.
2026-07-20 23:41:18 +09:00
vasilito c89898f1f4 docs: drop resolved SYSCALL-MIGRATION-PLAN, fix stale reference, refresh README
- Delete local/docs/SYSCALL-MIGRATION-PLAN.md — migration complete
  (syscall fork at 0.9.0+rb0.3.1 with SETNS and data/flag updates);
  its resolution is already recorded in archived/IMPLEMENTATION-MASTER-PLAN.md
- local/AGENTS.md: remove reference to non-existent
  DESKTOP-STACK-CURRENT-STATUS.md (superseded by CONSOLE-TO-KDE plan)
- README: status table — shared-IRQ re-arm sweep (11 drivers), USB 2.0
  HW LPM implemented, endpoint-indexing bug class fixed, hub-child
  enumeration proven; correct frozen versions to Mesa 26.1.4 +
  wayland-protocols 1.49 (was: Mesa 24.0.8)
2026-07-20 21:23:55 +09:00
vasilito 233ccc41f4 docs: record P6-A completion + endpoint-indexing bug-class audit (2026-07-20)
acmd global-index fix + serial-state/SEND_BREAK (f505d18a89), ecmd/usbaudiod
address-vs-index fix (08097d5a2d), usbhidd per-config reset (94a99f02).
bot.rs assigned to UAS workstream. Multi-port IAD remains open.
2026-07-20 21:10:19 +09:00
vasilito 5bde1cd716 submodules: bump base — usbhidd multi-config endpoint indexing fix 2026-07-20 21:09:06 +09:00
vasilito 08097d5a2d redbear-ecmd, redbear-usbaudiod: fix endpoint numbering to xhcid global index
Same latent bug class as the acmd fix (f505d18a89): both drivers used
the USB endpoint ADDRESS number (ep.address & 0x0F) as the endpoint key,
but xhcid keys endpoints by global enumeration index across all
interfaces of the selected configuration. The two coincide only when
the device's endpoint addresses are sequential in enumeration order —
devices with non-sequential addresses (some modems/audio gear) would
open the wrong endpoint or fail to open.

Both now count endpoints in configuration order per selected
configuration, matching xhcid's PortState::get_endp_desc indexing.

Verified: cargo check -Z build-std --target x86_64-unknown-redox clean
for both crates.
2026-07-20 21:05:26 +09:00
vasilito f505d18a89 redbear-acmd: fix global endpoint indexing; add serial-state monitor + SEND_BREAK (P6-A)
Bug fix: endpoint numbers were computed as per-interface positions, but
xhcid keys endpoints by GLOBAL index across all interfaces of the
configuration. On two-interface ACM devices (comm interrupt-IN first),
the driver opened (interrupt-IN, bulk-IN) as (bulk_in, bulk_out) — read
from the interrupt endpoint and wrote to the IN endpoint. Endpoints are
now counted across all interfaces in configuration order, exactly as
xhcid's PortState::get_endp_desc does.

P6-A expansion (Linux 7.1 cdc-acm.c reference):
- SEND_BREAK (0x23) control request
- SERIAL_STATE monitoring: poll the comm interface's interrupt-IN
  endpoint on a dedicated thread, parse the 8-byte header + 2-byte UART
  state bitmap (CDC 1.1 6.3.5): DCD/DSR/break/RI/framing/parity/overrun,
  log transitions
- scheme gains a read-only 'state' file reporting the current line
  state (dcd=.. dsr=.. ...) for getty/terminal consumers

Verified: cargo check -Z build-std --target x86_64-unknown-redox clean,
no new warnings. Runtime validation needs an ACM device (QEMU has no
CDC ACM emulation; FTDI/Arduino on bare metal or passed through).
2026-07-20 20:59:16 +09:00
vasilito cd9b225e39 docs: scope USB P7-B — real work is SEL/PEL timeout computation, not register writes
Upstream xhci_calculate_lpm_timeout needs SuperSpeed endpoint companion
SEL/PEL parsing across the hub tree + tier policy + XHCI_LPM_SUPPORT
vendor quirk. Defaults-only timeout writes would be speculative and can
break device links. P7-B assigned a dedicated workstream.
2026-07-20 19:27:00 +09:00
vasilito 1aae92524f docs: re-scope USB P7-A EHCI task — no generic EHCI HW LPM exists in Linux 7.1
Audit: set_usb2_hw_lpm is xHCI-only upstream; EHCI PM is vendor-specific
TDI PHY LPM only. Correct EHCI power path is legacy L2 port suspend
(host-agnostic); deferred until a concrete device need arises.
2026-07-20 19:24:32 +09:00
vasilito a83be41585 usb: bump base fork — P7-A USB 2.0 HW LPM implemented in xhcid
base -> 2a3b0d4e: per-device USB 2.0 hardware LPM (L1) enablement at
attach in xhcid (full Linux xhci.c:4650 gate chain, BESL/HIRD params,
MEL Evaluate Context, PORTHLPMC/PORTPMSC sequence). Plan P7-A updated:
xhcid side done; ehcid USBCMD.HIRD and hardware L1 validation remain.
2026-07-20 19:22:18 +09:00
vasilito 9245ad426a irq: shared-IRQ re-arm bug-class sweep across base drivers + plan update
Bump base fork to 28afc1fe:
- ad40fffd ahcid: always re-arm the IRQ line, even for foreign interrupts
  (from the UAS workstream)
- 92924224 e1000d/ihdad/vboxd/xhcid: unconditional ack
- 28afc1fe sb16d/ac97d/rtl8139d/rtl8168d/ixgbed/ihdgd: unconditional ack
- 54e89a33 fbcond: perform the display handoff open off the console loop
  (concurrent session's root-cause fix for the '-vga std' boot freeze)

Bug class: kernel masks the IRQ line on delivery and only re-arms on the
userspace write-back; conditional acks wedged shared INTx lines forever.
Explains a class of 'works in QEMU, wedges on real hardware' failures.
Full audit + unaffected-driver rationale recorded in the IRQ plan P3
section.
2026-07-20 18:52:34 +09:00
vasilito 5c6cd18599 tests: fix UHCI proof marker for interpolated controller name
The UHCI runtime proof grepped for the literal
  'uhcid: controller initialized, polling ports'
but uhcid main.rs:535 emits it with ctrl.name interpolated mid-string:
  info!("uhcid: {} controller initialized, polling ports", ctrl.name);
producing e.g. 'uhcid: 0000:00:01.2_uhci controller initialized, polling
ports'. The literal grep never matched and the proof would fail 100% of the
time at runtime.

Fix: grep with a regex anchored on the stable suffix:
  grep -Eq 'uhcid: .* controller initialized, polling ports'

The ohcid, ehcid, usbhidd, and usbscsid markers were re-audited against
driver source and are all correct (ohcid main.rs:341 has no interpolation;
ehcid main.rs:294 interpolates after the matched comma prefix; all others
interpolate at line ends matched by prefix). Only the UHCI init-done marker
was broken.

Comment header and error echo updated to document the interpolated form and
point at main.rs:535 so the regex is not 'simplified' back to a literal.

No QEMU runs. bash -n passes. Verified the regex matches the real emitted
format and does not cross-match ohcid's identical suffix (the 'uhcid:' prefix
anchor disambiguates).
2026-07-20 11:23:33 +09:00
vasilito ee1da17617 tests: add USB UHCI/OHCI/EHCI-autospawn/error-recovery QEMU proofs
Create the four USB validation scripts that local/docs/USB-VALIDATION-RUNBOOK.md
references but which did not exist on disk, closing the P8-B runtime-proof gap
for the legacy host controllers and the P8-C error-injection gap for xHCI:

- test-uhci-runtime-qemu.sh  (P1-B): -machine pc + piix3-usb-uhci, serial-log
  proof that uhcid binds the controller and detects the attached usb-kbd.
- test-ohci-runtime-qemu.sh  (P1-B): -machine pc + pci-ohci, serial-log proof
  that ohcid binds the controller and detects the attached usb-kbd.
- test-ehci-class-autospawn-qemu.sh (P1-A): -machine q35 + usb-ehci + usb-kbd,
  serial-log proof that ehcid enumerates the keyboard and usbhidd auto-spawns
  via the unified UsbHostController trait. The existing test-ehci-qemu.sh is a
  coarse usb-tablet smoke test and does NOT cover this path, so this is a full
  script rather than an alias.
- test-usb-error-recovery-qemu.sh (P8-C): hot-unplug usb-storage mid-transfer
  via the QEMU monitor device_del (chardev stdio mux, Ctrl-A c toggle — the
  same pattern as test-xhci-device-lifecycle-qemu.sh, since qemu-login-expect.py
  drives only serial and cannot reach the monitor). Proves graceful detach +
  usbscsid IO-error handling with no panic.

test-xhci-device-lifecycle-qemu.sh already existed and is unchanged.
test-usb-uas-qemu.sh is intentionally NOT created: UAS is in flight in a
separate workstream and its test belongs to that change.

Proof style and harness fidelity:
- UHCI/OHCI/EHCI proofs follow the test-xhci-irq-qemu.sh serial-log grep
  pattern (dual --check + interactive mode, ISO-preferred boot_args, 180s
  timeout, no panic fail-marker). No guest-side checker exists that validates
  legacy-controller enumeration specifically, so per the runbook's
  serial-log-evidence rule they grep driver log lines instead of inventing a
  guest binary.
- The error-recovery proof follows the test-xhci-device-lifecycle-qemu.sh
  expect/Tcl monitor-mux pattern and reuses the existing redbear-usb-storage-check
  guest binary (redbear-hwutils) to drive an active transfer — no new guest
  binary is invented.

All proof markers are sourced directly from the real driver trees:
  uhcid  main.rs:487/535/545  (UHCI USB 1.1 at / controller initialized / connect)
  ohcid  main.rs:305/341/348  (OHCI USB 1.1 at / controller initialized / connect)
  ehcid  main.rs:154/294/560  (EHCI USB 2.0 at / controller initialized / port device)
  usbhidd main.rs:221         (USB HID driver spawned with scheme)
  usbscsid main.rs:190/200/163/156 (READ/WRITE IO ERROR / scheme tick / event error)

No existing scripts, qemu-login-expect.py, config/*.toml, recipes, or the
runbook were modified. The runbook's script names and --check invocations
already matched exactly, so no runbook edits were required.

Validation: bash -n passes on all four scripts. shellcheck is not installed on
this host. NO QEMU runs were performed — the host is contended by another
workload that kills QEMU processes, so validation is syntax check + pattern
fidelity review only. Runtime pass/fail is unverified.
2026-07-20 10:04:56 +09:00
vasilito e4c4cb59e4 docs: Qt6 Wayland null+8 static diagnosis — patch verdict + instrumented runbook
Phases A-C static diagnosis of the wl_proxy_add_listener null+8 crash.
Evidence-backed root cause, candidate patch verdict, ruled-out hypothesis
cross-check, and a copy-pasteable instrumented-rebuild runbook for the
orchestrator.

Verdict: candidate patch qtwaylandscanner-null-guard-listeners.patch guards
the CORRECT site (every generated init_listener). Necessary but not
sufficient alone — complementary to libwayland redox.patch hunk 1.
v5.5 'verified FIXED' claim overstated: never tested in isolation,
kded6 workaround masked it, stale-sysroot risk documented.
2026-07-20 09:52:08 +09:00
vasilito 865beb82d5 docs: reconcile USB plan P6 preamble with P1-D driver reality
P6 claimed acmd/ecmd/usbaudiod were 32-line stubs; P1-D (2026-07-08)
resolved that they are real implementations. Verified 2026-07-20:
redbear-acmd 186 LoC (line coding, DTR/RTS, scheme), redbear-ecmd 314,
redbear-usbaudiod 367. P6-A remaining scope is CTS/DSR flow control,
break signaling, and multi-port modem support; NCM/audio/serial-chip
families remain missing entirely.
2026-07-20 09:42:24 +09:00
vasilito 376fe3a05c docs: record 2026-07-20 A2 re-confirmation state in validation matrix
Log-grep legs (MSI-X, xHCI IRQ) re-confirmed again this morning; login-based
legs still blocked by the concurrent .claude QEMU workload (SIGKILL of
competing guests); retry loop armed; IOMMU leg needs a redbear-full image.
2026-07-20 09:26:25 +09:00
vasilito 582aaa530c prefix: refresh tracked toolchain tarballs after rebuild
Rebuilt cross-toolchain (clang/gcc/rust installs) following the relibc,
kernel, and base fork changes — stale prefix artifacts are the primary
cause of 'undefined reference' link errors after fork work. Tracked for
disaster recovery per 96e4a29592.
2026-07-20 09:07:11 +09:00
vasilito 923697887c docs: record python harness migration; drop superseded policy docs
- 06-BUILD-SYSTEM-SETUP: note which QEMU proof scripts use
  qemu-login-expect.py vs host expect
- 01-REDOX-ARCHITECTURE, LOCAL-FORK-SUPREMACY-POLICY,
  SYSTEM-STABILITY-AND-UPSTREAM-SYNC-PLAN, UPSTREAM-SYNC-PROCEDURE:
  sync with current fork-model and sync-procedure state
- Delete archived/SOURCE-ARCHIVAL-POLICY.md and
  fork-push-status/2026-07-12-Round-5-phase-4.1.md — superseded by the
  current local-fork model docs and newer fork-push-status rounds
- config/redbear-mini.toml: trailing newline
2026-07-20 09:06:25 +09:00
vasilito cb94e82502 mesa: enable GBM; narrow gallium drivers to softpipe,llvmpipe,virgl
Enable GBM (required by the EGL/GBM/GLES2 surface used by Qt6/KWin).
Drop crocus/iris from the gallium driver set for the 26.1.4 build —
the Intel hardware drivers require DRM uapi surfaces that are not
available in the Redox sysroot yet. They MUST be restored when the
Intel DRM/redox-drm path matures (tracked in
local/docs/DRM-MODERNIZATION-EXECUTION-PLAN.md Stage 5); this is a
build-surface constraint, not a feature removal.

Also widen the -Wno-error set for the 26.1.4 cross-compile
(missing-prototypes, return-type, empty-body, incompatible-pointer-types,
int-conversion, format) — upstream Mesa enables -Werror by default and
the Redox sysroot headers trip these classes; the underlying warnings
remain visible in the build log.
2026-07-20 09:06:06 +09:00
vasilito 37c2ecece4 brush: route rb_dbg diagnostics to /scheme/debug instead of stderr
Writing startup diagnostics to stderr interleaves with the interactive
console on the live image; /scheme/debug reaches the serial log without
disturbing the shell's tty.
2026-07-20 09:05:44 +09:00
vasilito 299a86f6e3 bash: avoid subprocess spawns during interactive shell startup
On the live image, a fork/exec during login-shell startup can stall the
shell before its first prompt. Replace command substitutions with pure
builtins in the startup path:

- bash.bashrc: read /etc/redox_chroot with the 'read' builtin instead of
  $(cat ...)
- profile: derive the root prompt from EUID/USER/LOGNAME (set by
  login(1)) instead of $(id -u)
- skel/.bashrc: disable lesspipe and dircolors eval (both spawn
  subprocesses); keep the ls --color=auto alias
2026-07-20 09:05:32 +09:00
vasilito fb3812b176 submodules: bump base and userutils fork pointers
base -> fb421083:
- fbcond: retry handoff while display driver is not ready (bounded
  250x10ms; fixes the 2026-07-20 '-vga std' boot freeze at 'Performing
  handoff' where a transient not-ready driver left the framebuffer VT
  permanently blank)
- xhcid/virtio-netd: info-level IRQ/MSI-X delivery and reactor startup
  milestones for runtime-proof observability
- usb: demote diagnostic ATTACH/HUBFLOW traces to debug!
- usbhubd: gate port-indicator SetPortFeature on hub capability

userutils -> 3b02e0b9:
- getty: harden the console<->PTY bridge against transient
  read/write/event errors (log-and-continue instead of panic; a panic
  here killed the live shell's I/O)
2026-07-20 09:05:16 +09:00
vasilito 1baf1a17fb kernel: use fork Makefile install target in recipe; bump fork pointer
The kernel fork (submodule/kernel bd1b251f) now provides a proper
'install' target honoring DESTDIR, so the recipe no longer hand-rolls
the staging copy. Fork also gains post-merge compile fixes (import
dedup + UnmapVec).
2026-07-20 09:05:00 +09:00
vasilito 68a8164a3e wayland-protocols: sync tracked source tree to 1.49
Sync the tracked source tree to the wayland-protocols 1.49 release
tarball already pinned in recipe.toml (blake3-verified). Upstream 1.49
drops the pkg-config .pc.in files, switches scanner discovery to a
native wayland-scanner dependency with fallback, and adds the new
stable/staging protocol XMLs (ext-image-*, xdg-toplevel-icon,
cursor-shape, content-type, alpha-modifier, ...).
2026-07-20 09:02:21 +09:00
vasilito 6dab9b2953 tests: migrate remaining QEMU runtime proofs to qemu-login-expect.py
Convert the remaining expect-based test scripts (phase1-6 runtime, usb,
wifi, bluetooth, dbus, greeter, live-iso, posix) to the stdlib python
harness, completing the migration started in 9ec00d4c81. Each script now
prefers booting the live ISO when present (falling back to harddrive.img
with snapshot=on), and retries up to 5 times when QEMU exits early or is
killed (rc 3 / 137) — the host-contention failure mode recorded in the
2026-07-20 runtime-proof status.

qemu-login-expect.py: treat an incomplete step sequence as a failure even
when a pass marker was seen partway through — partial sequences must not
count as a pass.
2026-07-20 09:01:14 +09:00
vasilito cf6f363da9 tests: fix qemu-login-expect fail-marker guard, docstring flags, retry count
Post-review fixes:
- Phase 2 no longer breaks early when only --fail_marker is set: the
  'if not args.pass_marker: break' guard skipped all output reads, so a
  fail marker was never detected (exit 0 instead of 1). Now breaks only
  when neither pass nor fail markers are configured.
- docstring referenced --pass/--fail; argparse registers
  --pass_marker/--fail_marker. Align the docstring.
- retry echo said 'attempt N/3' but the loop limit is 5 attempts; say /5.
- warn and skip malformed steps (missing expect:/send: prefix) instead of
  spinning in select until timeout.
2026-07-20 07:08:28 +09:00
vasilito 8801805031 docs: record expect-to-python harness migration and 2026-07-20 runtime-proof status
IRQ plan + validation matrix: the login-based QEMU proofs (PS/2 + serio,
monotonic timer, IOMMU first-use, USB storage BOT) now run through
local/scripts/qemu-login-expect.py (stdlib python) instead of the host expect
tool. MSI-X (virtio-net) and xHCI interrupt-driven mode were re-confirmed on
the current redbear-mini ISO. Re-confirmation of the login-based legs with the
new harness is pending an uncontended host (parallel QEMU workload kills QEMU
processes and stalls guest boots). Also record the fbcond Performing-handoff
boot freeze observed with -vga std (separate graphics-path issue).
2026-07-20 05:56:39 +09:00
vasilito 9ec00d4c81 tests: replace expect with stdlib python helper for QEMU login proofs
Drop the host expect dependency from the PS/2, timer, IOMMU, and USB
storage (BOT) runtime proofs. local/scripts/qemu-login-expect.py drives
the guest over serial-on-stdio with ordered expect/send steps, per-step
timeouts (matching expect's per-pattern semantics), and pass/fail markers.
It distinguishes premature QEMU death (exit 3) from genuine check failure
(exit 1) so the scripts retry external interruptions without retrying real
failures. Scripts use headless -display none -vga none (fbcond serial
mirror), a 3600s per-step timeout, and a retry loop (max 5 attempts).
2026-07-20 05:38:44 +09:00
vasilito 569f05debc tests: boot low-level + storage proofs from live ISO, not stale harddrive.img
All six validation scripts (xhci-irq, msix, ps2, timer, iommu,
usb-storage) booted build/<arch>/<config>/harddrive.img, which is only
produced by older make-all flows and goes stale (the Jul-17 image).
Running them against it measured the wrong tree — the same trap that
produced the false '+rb0.3.0' bootloader reading and the first hub-test
failure. Each now prefers build/<arch>/<config>.iso via -cdrom and only
falls back to harddrive.img when no ISO exists. extra.img and
usb-storage.img remain as data drives in both modes.
2026-07-20 00:14:30 +09:00
vasilito 49d356ad6e config: consolidate PCI driver spawning on pcid-spawner (drop driver-manager stub)
Root cause of the duplication: a stalled migration. driver-manager (new
Red Bear framework) was written and packaged, but never wired in — its
00_driver-manager.service ran cmd="pcid-spawner" (the legacy binary),
and redbear-mini.toml already notes it is 'not yet ready'. Meanwhile the
base recipe's 00_pcid-spawner.service (oneshot_async) is the live
spawner. Both services ran pcid-spawner async, so pcid-spawner launched
TWICE in mini/full, racing to spawn the same drivers.

Consolidation (user directive: consolidate on pcid-spawner for now,
revisit driver-manager later):
- drop the unused driver-manager = {} package (source recipe kept for
  the future migration),
- remove the duplicate 00_driver-manager.service,
- point 13_driver-params.service requires_weak at the real
  00_pcid-spawner.service,
- base recipe's oneshot_async pcid-spawner is now the sole PCI driver
  spawner — no more double launch.
driver-manager is intentionally left out of configs until its driver
config migration is completed (documented in the file).
2026-07-20 00:03:42 +09:00
vasilito 6afa2efa8b config: strip redbear-legacy-base.toml to the one needed override
Per-entry assessment (file was never deleted — no D commits in history;
continuously present, last touched Jul 16 by d5561184f0 which fixed
00_base.service zsh->mkdir and unblocked boot):

- KEEP 00_base.service (mkdir /tmp): base provides no 00_base.service;
  the Jul-16 fix is the sole source and is required.
- REMOVE 20_audiod.service: redundant with base's identical oneshot_async.
- REMOVE zsh = {}: redundant with minimal.toml.
- REMOVE 00_pcid-spawner.service (type=oneshot): HARMFUL — the blocking
  oneshot overrode the base recipe's fixed oneshot_async pcid-spawner,
  re-introducing the boot-wedge the base recipe explicitly fixed. Base's
  oneshot_async now wins (config /etc/init.d no longer shadows it).
  Resolves the pcid-spawner service conflict (task T-7fdcd5e5).
2026-07-19 23:42:42 +09:00
vasilito a6c7d1d9c6 docs: 'reactor startup race' root cause = startup latency under load
Correct the P3-A runtime-validation note and matrix row: the
intermittent apparent boot freeze is startup latency under load (guest
clock ~10-15x slower than wall), not a deadlock or an xhcid bug. A short
50-60s test timeout occasionally cuts the spawn+enumerate sequence,
producing a 'frozen' log while the guest is still running — proven by
18 boots (one apparent short-timeout loss), a 12s log-quiet 'freeze'
the guest resumed from, and every >=180s run enumerating fully. No fix
required beyond adequate test timeouts; no speculative kernel-deadlock
fix was implemented.
2026-07-19 23:13:46 +09:00
vasilito 6446d440bf usb: hub-child enumeration proven end-to-end in QEMU + tighten hub test
The usb-kbd behind the QEMU usb-hub now enumerates fully: debounce ->
port reset -> enable -> second debounce -> pre-attach -> attach ->
ATTACH 5.2 -> slot 3 -> addressed -> descriptors read -> HID class match
-> 'Loading subdriver "USB HID" for port 5.2' (class 3.1 proto 1,
keyboard boot protocol).

Root cause of the final stall: an unconditional SetPortFeature
(PORT_INDICATOR) for every connected+enabled port NAK-hung on QEMU's
indicator-less hub (no control-transfer timeout), blocking the flow
before the post-enable debounce. Now gated on
wHubCharacteristics.HUB_CHAR_PORTIND like Linux has_indicators.

test-usb-hub-qemu.sh: check #5 now requires the hub-child subdriver
line ('Loading subdriver "USB HID" for port <root>.<child>') so a
root-port HID (tablet) can no longer satisfy it — closes a false-
positive hole. Timeout raised to 360s for slow TT-path driver bring-up.

Docs (plan P3-A runtime validation + matrix): full hub + hub-child
chain recorded as QEMU-proven; remaining items (intermittent reactor
startup race, slow TT-path Evaluate Context) noted.
2026-07-19 19:55:27 +09:00
vasilito 5fcb03c99b test-usb-hub-qemu: extend check timeout 180s -> 360s
Hub enumeration is quick, but a hub-child's class driver then performs
its own descriptor/control transfers on the slow emulated TT path, and
the guest clock runs several times slower than wall time under load.
180s cut the boot before a hub-child HID driver could finish
registering after being spawned.
2026-07-19 19:43:51 +09:00
vasilito 1cde9f2fb6 chore: track base pointer — ipcd SO_PEERCRED double-borrow, ptyd runtime-error hardening, inputd producer-write UB fixes 2026-07-19 12:29:41 +09:00
vasilito e55e0f186b docs: P3-A runtime validation — hub chain proven, hub-child gap recorded
USB-IMPLEMENTATION-PLAN.md P3-A: record the 2026-07-19 QEMU runtime
validation (test-usb-hub-qemu.sh) — full usbhubd chain proven
(descriptor, EP1 change detection, initial scan, debounce, reset to
port-enable), the five latent bugs it surfaced and that were fixed
(scheme attach bootstrap, bitmap off-by-one, missing initial scan,
unbounded EP1 wait, debounce clear deadlock), QEMU's ClearPortFeature
stall handled gracefully by P2-C recovery, and the remaining gap:
hub-child device enumeration (usb-kbd to HID driver) blocked on
xhcid's hub-child attach path (debug-level; TT/route investigation)
plus an intermittent xhcid IRQ-reactor startup race.

HARDWARE-VALIDATION-MATRIX.md: hub row to QEMU-validated for the
enumeration chain, with the hub-child gap noted.
2026-07-19 11:17:21 +09:00
vasilito a8ca01d84b test-usb-hub-qemu: interleaving-robust grep fragments
Serial output from dozens of concurrent daemons interleaves mid-line,
so full-sentence matches like 'usbhubd: 8 port(s) detected' fail even
when the content is present (observed mangled as 'usbhubd: 548: port(s)
detected'). Match short fragments ('port(s) detected', 'change
detection', 'registered producer') that survive interleaving.
2026-07-19 10:20:05 +09:00
vasilito f543407710 redbear-usb-hotplugd: drop other-OS attribution from startup log
Runtime log output is user-visible system surface; cross-references to
other operating systems belong in code comments and commit messages
(per project convention), not in runtime logs. The debounce parameters
and the comment-level references stay unchanged.
2026-07-19 10:11:43 +09:00
vasilito f87481ca6d test-usb-hub-qemu: spawn proof via descriptor-read line
The 'USB HUB driver spawned' log line is emitted before setup_logging
and never reaches the serial console, so check #2 could never pass.
Use the hub-descriptor read line (emitted only after XhciClientHandle
open + 8-port descriptor fetch succeed) as the spawn proof, and fold
the old duplicate descriptor check into it.
2026-07-19 09:46:11 +09:00
vasilito 36f1cd6193 sync-versions: exclude git-fetched upstream sources from Cat 1 sync
Cat 1 discovery treated every local/recipes/*\/source/Cargo.toml as an
in-house crate, including git-fetched upstream sources like brush
(git = github.com/reubeno/brush). Rewriting upstream crate versions to
the branch version broke upstream-internal version requirements
(brush-shell was forced to 0.3.1 while brush required ^0.4.0 —
'failed to select a version for the requirement brush-shell = ^0.4.0').

Guard: skip any crate whose Cargo.toml is not tracked by the parent
repo. In-house crates are tracked trees (no independent .git); fetched
sources are gitignored and untracked. Restores correct classification:
75 crates checked (12 fetched-source crates now excluded), drift 0,
brush cooks successfully again.
2026-07-19 09:33:07 +09:00
vasilito 02d9986d3b versions: sync brush Cat 1 crates to 0.3.1 + hub test boots ISO
- sync-versions.sh: 11 brush workspace crates 0.x -> 0.3.1 (Cat 1
  in-house version policy).
- test-usb-hub-qemu.sh: boot the live ISO (canonical build-redbear.sh
  artifact) instead of harddrive.img, which is only produced by older
  make-all flows and goes stale — a stale Jul-17 image with a
  pre-version-sync bootloader (+rb0.3.0) masked the current build and
  crashed the first proof attempt. Falls back to harddrive.img only
  when no ISO exists.
2026-07-19 09:15:41 +09:00
vasilito 2959c91706 kernel + relibc fork syncs — all 9 forks pass the function gate
kernel (660e3e00): merged upstream/master (10 commits — context
timer-separation, dtb translation + tests, event read_with_timeout,
proc wakeup paths, dup2 rewrite with rollback, futex Weak
context_lock). 5 conflicts resolved by hand (futex/event/proc/fs/
aarch64-start); repo cook kernel --force-rebuild successful.

relibc (27397a8c): merged upstream/master (50 commits — socket rework,
ld_so lifecycle with mark_ready/run_fini, dynamically-linked init,
start.rs allocator-model rewrite). 4 conflicts resolved by hand
(start/exec/sys/Cargo.lock); repo cook relibc --force-rebuild
successful.

verify-fork-functions.sh --no-fetch: ALL 9 FORKS PASS.
The image build gate is fully unblocked — redbear-mini builds again.
2026-07-19 07:13:27 +09:00
vasilito ba46a4c715 base fork sync (upstream 59cf8189) + P3-B/C doc closure + hub proof script
Base fork:
- Merged upstream/main 59cf8189 (13 upstream commits) into submodule/base
  as 9bbdc2ca; 3 conflicts resolved by hand (irq_reactor.rs process_one_event
  refactor + SPURIOUS_REBOOT reapply; randd simplification + fcntl reapply;
  Makefile /dev symlink block). verify-fork-functions gate now passes for
  base. kernel (11 fns) and relibc (2 fns) remain behind upstream — tracked
  as T-7d82cf6f / T-a5699340 / T-f5b7a0ea for dedicated sessions.
- Also landed earlier: upgrade-forks.sh cd-back bug fix (7e7ef73a).

Docs:
- P3-B marked COMPLETE (premise was stale: usbhubd is interrupt-driven
  with polling fallback today).
- P3-C marked hub-side COMPLETE (PortIndicator set in event loop);
  keyboard LED sync remains P5-C scope.
- README USB/Bluetooth row upgraded from red/in-progress to reflect
  P2-A/B/C + P3-A/B/C reality.

Validation:
- New test-usb-hub-qemu.sh (P8-B): boots QEMU with usb-hub + usb-kbd
  behind it, validates usbhubd spawn, 8-port descriptor read, change-
  detection mode, HID registration behind the hub, no panics. Cannot
  run until kernel+relibc syncs unblock the image build.
2026-07-19 05:48:45 +09:00
vasilito 7e7ef73a8c upgrade-forks: fix relative fork_dir after cd into fork (cd-back bug)
The script cd's into the fork dir for the clean-tree check (line ~202)
and never returns to PROJECT_ROOT. Every subsequent relative
'cd "$fork_dir"' subshell then fails with 'No such file or directory',
making single-fork and multi-fork runs always FAIL at the upstream-ref
resolution step. Make fork_dir absolute at assignment so all subshell
cd/git calls work regardless of current directory.

Found while attempting the base fork sync (verify-fork-functions gate).
2026-07-19 05:38:30 +09:00
vasilito bfd56bac7e usb: P3-A complete — Linux hub.c enumeration state machine in usbhubd
Track base pointer to bd379e07 (usbhubd debounce/reset-wait/U0-wait/
wHubDelay + SET_ISOCH_DELAY, HubDescriptorV3 device_removable fix).

USB-IMPLEMENTATION-PLAN.md: P3-A marked CORE COMPLETE with the full
Linux equivalence inventory and documented follow-ups (USB 2.0 bitmaps,
SS.Inactive warm-reset loop, multi-TT, hub LPM). Hub gap-table row
updated (249 -> ~700 LoC with Linux state machine).

HARDWARE-VALIDATION-MATRIX.md: hub row updated — enumeration core
complete with 14 unit tests; runtime hub proof tracked under P8-B.
2026-07-19 00:28:29 +09:00
vasilito efd745c073 docs: USB/quirks/low-level doc consolidation + P2-C recovery completion
Documentation pass (staleness audit across 5 docs):

USB-IMPLEMENTATION-PLAN.md:
- P2-A marked COMPLETE (canonical 51-flag table in redox-driver-sys,
  ~85 entries, real HCIVERSION reads, BROKEN_MSI pre-gate)
- P2-C marked CORE COMPLETE: full 36-code recovery matrix documented
  (maybe_recover_transfer_error scheme.rs:559-925) with Linux xhci-ring.c
  equivalences, restart_endpoint bug fixes, known simplifications, and
  remaining P8-C injection-test scope
- Gap table corrected (quirks done, error recovery core done, PM substrate)
- P7-A corrected: HLC lives in Supported Protocol capability port_info
  DWORD, NOT HCCPARAMS1 (driver bug fixed in P2-B)
- §12 rewritten: runbook is live v3, not archived; lineage consolidated

IRQ-AND-LOWLEVEL-CONTROLLERS-ENHANCEMENT-PLAN.md:
- xHCI section rewritten: 'restored' -> hardened/gated (BROKEN_MSI
  pre-gate, quirk convergence, real HCIVERSION, handle/method agreement)
- Priority 6 refocused from 'keep path healthy' to runtime validation
  (BROKEN_MSI controller proof, event-ring under sustained load)
- 26 stale recipes/core/*/source paths -> local/sources/* fork paths
- duplicate ACPI-IMPROVEMENT-PLAN.md reference removed
- xhcid evidence class upgraded to quirk-hardened
- USB plan cross-reference added (feature ownership boundary)

QUIRKS-AUDIT.md:
- xHCI tombstone removed: lookup_xhci_controller_quirks_full is now a
  real implementation over XHCI_QUIRK_TABLE (was stub returning empty())
- 'broken TOML mappings' section marked RESOLVED (all 4 flag names now
  in PCI_FLAG_NAMES)
- Implementation-status section re-assessed: xhcid consumes 51-flag
  XhciControllerQuirkFlags in ~40 paths (was: only PciQuirkFlags)
- test inventory +38 xhci_table.rs tests

QUIRKS-SYSTEM.md:
- xhci_table.rs added to compiled-in tables inventory and file layout
- implementation status: canonical xHCI table row added (P2-A)
- driver consumption: xhcid xHCI-controller-path flag list documented

QUIRKS-IMPROVEMENT-PLAN.md:
- Task 3.1 (USB device quirks in xhcid) marked DONE (13 flags consumed)
- exit criteria 3/4/5/7 marked met; deliverables 1/3/4 completed
- reassessment summary updated for XhciControllerQuirkFlags consumption

Also: chmod +x test-xhci-irq-qemu.sh, test-msix-qemu.sh,
test-usb-storage-qemu.sh (were non-executable).

Track base pointer to 26000333 (P2-C restart_endpoint fixes).
2026-07-18 23:15:00 +09:00
vasilito 1c15425e7e chore: clean diagnostics; brush login+shell fix (validated cwd) 2026-07-18 23:08:02 +09:00
vasilito d3e5fc0a82 usb: P2-B complete — HCCPARAMS2 capability gating in xhcid
Track base pointer to d20557f7 (xHCI 1.1+ feature gating: LEC/U3C/CIC
gates, HW LPM substrate with protocol-caps HLC detection, PORTPMSC
register-target fix, bogus HCCPARAMS1-HLC accessor removed).

Mark P2-B COMPLETE in USB-IMPLEMENTATION-PLAN.md with the full gating
inventory and Linux 7.1 cross-references. Per-device L1 enablement
(BESL, MEL Evaluate Context) explicitly deferred to P3 hub work.
2026-07-18 22:34:28 +09:00
vasilito 980fb994ae redox-driver-sys: canonical xHCI quirk table (Linux 7.1 port, 51 flags)
Expand XhciControllerQuirkFlags from 7 to all 51 flags defined in
Linux 7.1 xhci.h:1587-1649, each using 1u64 << N matching the kernel
bit positions. Add XhciQuirkEntry struct with vendor/device/revision
matching and a WILDCARD constant for catch-all rules.

Create xhci_table.rs — the canonical controller quirk table ported
from Linux 7.1 xhci-pci.c:xhci_pci_quirks() (lines 251-517). Covers
~85 entries across all vendors (Fresco Logic, NEC, AMD, ATI, Intel,
ETRON, Renesas, VIA, CDNS, Phytium, ASMedia, TI, Broadcom, Cavium,
Zhaoxin). 38 unit tests verify flag assignment for every vendor family.

Update lookup_xhci_controller_quirks_full() signature to accept
revision: u8 and hci_version: u16, enabling the two table entries
that depend on hci_version (AMD_0x96_HOST, >= 0x120 spec rule).

Bugs fixed vs xhcid's prior self-contained table:
- Intel 0x9c31 duplicate removed; WildcatPoint corrected to 0x9cb1
- Panther Point corrected to 0x1e31
- VIA VL805 corrected to LPM_SUPPORT + TRB_OVERFETCH
- Phytium corrected to RESET_ON_RESUME
- ASMedia 0x1142 corrected to NO_64BIT_SUPPORT + ASMEDIA_MODIFY_FLOWCONTROL
- Intel 0x9a13 moved off RESET_TO_DEFAULT list

xhcid now consumes this canonical path via a thin re-export shim
(base submodule pointer bumped to 9fc1947d).

Reference: local/reference/linux-7.1/drivers/usb/host/xhci-pci.c
           local/reference/linux-7.1/drivers/usb/host/xhci.h
2026-07-18 21:54:12 +09:00
vasilito a927437d55 chore: track userutils pointer (shell cwd fix - brush now spawns) 2026-07-18 21:26:30 +09:00
vasilito 367e02d3f6 chore: track relibc pointer (execve ENOENT diag) 2026-07-18 20:45:22 +09:00