Commit Graph

467 Commits

Author SHA1 Message Date
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 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 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 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
vasilito a66db2c77b chore: track relibc pointer (spawn diag fd2) 2026-07-18 20:33:06 +09:00
vasilito 4a556f56e7 chore: track relibc pointer (spawn ENOENT diag) 2026-07-18 20:25:24 +09:00
vasilito 6ada6661be chore: track userutils pointer (explicit shell stdio fds) 2026-07-18 18:13:47 +09:00
vasilito e0533832af chore: track userutils pointer (FD_CLOEXEC stdio clear + diag) 2026-07-18 17:56:48 +09:00
vasilito c3755d687d chore: track kernel+base pointers (drop kernel diag, add ptyd diag) 2026-07-18 17:29:36 +09:00
vasilito 05f18e5f9b chore: track kernel pointer (dup2 refresh diag) 2026-07-18 17:21:59 +09:00
vasilito 0d5043f3fc chore: track relibc pointer (non-fatal filetable refresh) 2026-07-18 16:34:46 +09:00
vasilito 13cc6fb0c3 chore: track installer pointer (collision-tracker WIP) 2026-07-18 16:08:15 +09:00
vasilito 26cdbe4ac5 chore: track kernel pointer (conservative dup2 refresh) 2026-07-18 15:58:51 +09:00
vasilito c2ca67f7d0 chore: track kernel+relibc pointers (filetable-refresh fd fix); shell back to brush 2026-07-18 14:59:12 +09:00
vasilito 7b004272a3 chore: track userutils pointer (termios cast fix) 2026-07-18 14:35:26 +09:00
vasilito 27e97a1132 chore: track userutils pointer (canonical terminal reset before shell) 2026-07-18 14:33:41 +09:00
vasilito 59357561f9 chore: track userutils pointer (blocking console fds before shell) 2026-07-18 13:05:05 +09:00
vasilito 170cbe65fb chore: track userutils pointer (skip login ns restriction test) 2026-07-18 12:52:55 +09:00
vasilito e9f37fa2ab chore: track userutils pointer (getty fwd diag) 2026-07-18 12:42:08 +09:00
vasilito a92f698849 chore: track base pointer (fbcond keyboard CR->LF) 2026-07-18 12:02:48 +09:00
vasilito 246ebdfc4b chore: track userutils pointer (login chdir-before-mkns fix) 2026-07-18 11:01:26 +09:00
vasilito 4c610e6555 chore: track base+userutils pointers (init CWD fix) + clean brush patch 2026-07-18 10:43:18 +09:00
vasilito ab2ca5399a chore: track userutils pointer (spawn diag) 2026-07-18 10:26:53 +09:00
vasilito 74bea85fe7 chore: track userutils pointer (login CWD fix) 2026-07-18 10:17:13 +09:00
vasilito 302ae880da chore: track base submodule pointer (revert logger Warn) 2026-07-18 09:47:28 +09:00
vasilito c843db2682 chore: base gitlink (console log quiet) + durable brush redox patch
- Track base submodule pointer for output_level Warn console-quiet change.
- Capture brush entry.rs redox edits (tokio current-thread runtime, default
  minimal input backend) as patches/brush-redox-runtime-and-input.patch and
  apply it in the recipe, so a clean source re-fetch keeps the Redox port.
2026-07-18 08:55:55 +09:00
vasilito dc97454734 chore: track base submodule pointer for switch_root chdir restore 2026-07-18 08:24:20 +09:00
vasilito f8d269c4b6 chore: track userutils submodule pointer for spawn_shell diagnostics 2026-07-18 08:09:05 +09:00
vasilito 688645bf98 feat(serial): headless serial console for mini/bare via fbcond mirror
Track base e9342b78 (fbcond bidirectional serial mirror) + kernel 229046c6
(debug fevent readable). Disable the standalone 31_debug_console getty since
fbcond now owns the serial/debug console (avoids competing for the shared debug
input queue and duplicated output). Gives headless serial login on mini + bare.
2026-07-18 07:23:58 +09:00
vasilito 76d609a39e fix(timerfd): base ptr — compile sys_timerfd so timerfd_* link (unblocks Wayland) 2026-07-18 02:51:37 +09:00
vasilito ff49356d58 fix(full): unblock desktop stack build
- relibc ptr 3b40cc8e: sys/timerfd.h compiles in C (unblocks libwayland + glib)
- redbear-meta: add [package].version = 0.3.1 (cookbook couldn't guess it)
- pam-redbear: regenerate Cargo.lock (in-house crate version drift vs --locked)
- (glib corrupted partial source cleaned to force a fresh re-fetch)
2026-07-18 01:57:26 +09:00
vasilito 72351f2a6a fix(boot): base ptr (net warning cleanup + e1000e) + quieter sessiond dbus retry
Track base 01200174 (smolnetd empty-router/broadcast warnings silenced, e1000e
82574 NIC support). redbear-sessiond: suppress the harmless first dbus connect
retry so it does not print an alarming line on every boot.
2026-07-18 00:50:04 +09:00
vasilito 5b49b36724 fix(boot): base submodule ptr (bare/mini warning cleanup) + bare serial console
Track base 1769b083 (condition_path_exists for optional daemons, ahcid no-media,
netstack no-NIC idle, dhcpd fast-fail). Re-enable the serial debug console on
the bare target so it has a headless-visible login prompt (matching mini up to
login).
2026-07-18 00:30:00 +09:00
vasilito c415829a12 fix(relibc): F_DUPFD_CLOEXEC ABI translation -> tokio runtime works on Redox
Track relibc submodule pointer 733da068 (translate POSIX F_DUPFD_CLOEXEC 1030 to
Redox syscall value 5, so OwnedFd::try_clone and thus tokio Runtime::build stop
failing with EINVAL). Also revert the ineffective epoll_ctl retry.

Remove temporary tokio/sessiond EINVAL diagnostics now that the root cause is
fixed.
2026-07-17 23:00:23 +09:00
vasilito e0d62330ac kernel: track event kdup fix (tokio Runtime EINVAL root cause); build: only re-cook userspace when relibc/base change
The kernel event scheme now implements kdup, so dup() of an epoll fd works
and tokio's registry.try_clone() succeeds — fixing the tokio runtime EINVAL
that killed every zbus daemon and the brush login shell.

build-redbear.sh: gate the userspace build/sysroot clean on relibc/base
(the forks userspace links) instead of any low-level fork, so a kernel-only
change rebuilds the kernel + initfs + image without a full userspace re-cook.
2026-07-17 21:47:32 +09:00
vasilito ccccf94fb5 relibc: track epoll EINVAL/EBADF retry pointer; bare: brush login shell
Track relibc submodule at the epoll_ctl transient-retry fix (415fa3c8),
which lets tokio runtimes (the zbus daemons and the brush login shell)
build past the transient /scheme/event EINVAL/EBADF during early-boot
scheme churn.

redbear-bare.toml: switch [users.root]/[users.user] to /usr/bin/brush and
add the brush package, so bare and mini share an identical boot-to-login
shell (bare = minimal boot-test surface, mini = +app payload).
2026-07-17 00:32:09 +09:00
vasilito 81a1d7d565 track relibc pointer: waitid unsafe fix 2026-07-16 22:08:37 +09:00
vasilito 0c3b769b24 track submodule pointers: relibc waitid, fbcond scrollback, bootloader color 2026-07-16 22:04:37 +09:00
vasilito 4afefcd8e1 base: 00_tmp idempotent mkdir + audiod/pcid/smolnetd non-blocking (pointer c14a577d) 2026-07-16 20:05:55 +09:00
vasilito 1ebc92f51f base: 20_audiod.service oneshot_async (pointer f5f726ca) 2026-07-16 18:39:28 +09:00
vasilito 19470fb444 boot: make bare/base driver-manager + netstack non-blocking; changelog
Base submodule 1f826240: 00_pcid-spawner (/usr) and 10_smolnetd base-default
init units switched to oneshot_async so init never blocks the boot-to-login
path on PCI driver enumeration or a network adapter binding. Adds the
2026-07-16 CHANGELOG entry (mini login restored, kernel MSR #GP guard,
build-system staleness/lock/override fixes).
2026-07-16 12:48:57 +09:00
vasilito d5561184f0 boot: restore mini ISO to a working login prompt + build-system fixes
Mini now boots (q35/KVM) all the way to the getty "Red Bear login:" prompt
on VT2 with zero kernel panics. Root-cause fixes across submodules + config:

- config: 00_base.service zsh->mkdir (a full shell startup hangs an init
  oneshot; the earlier 'echo/mkdir also hang' result was a silent config
  override running zsh). 00_ptyd.service notify->{scheme=pty} (ptyd signals
  readiness via its scheme fd; notify made init block on a byte forever).
- kernel: wrmsr_safe/rdmsr_safe #GP recovery so /scheme/sys/msr can't panic
  the kernel (cpufreqd's P-state MSR write #GP'd on KVM, halting the boot
  before login). base: ptyd scheme type + hwd ACPI enum -> debug (noise).
  installer: warn on config [[files]] override. relibc/bootloader: prior
  getrlimit + warning-demotion pointers.
- build-redbear.sh: fix host-fstools staleness (installer/redoxfs never
  rebuilt on source change), prefix rebuild-every-build (touch libc.a), add
  concurrent-build flock.

Submodule pointers: base 8aa8616d, installer 460d9530, kernel 155d01b1,
relibc a7663b3a, bootloader 6e119641.
2026-07-16 12:20:14 +09:00