Commit Graph

3291 Commits

Author SHA1 Message Date
Red Bear OS bd379e0771 usbhubd: full Linux 7.1 hub enumeration state machine (P3-A)
Port the Linux 7.1 hub.c port state machine into usbhubd, replacing the
minimal connect/reset handling:

New module port_ops.rs (pure logic, side effects injected, 14 unit
tests):
- debounce_until_connected: hub_port_debounce_be_connected() port
  (hub.c:4696-4737) — 25ms polls, connection stable for 100ms, 2s
  budget, connection-change bit cleared in-loop.
- wait_for_reset: hub_port_wait_reset() port (hub.c:2953-3047) — 10ms
  polls until RESET clears with CONNECTION set, escalate to 200ms after
  two short waits, 800ms budget; then 50ms TRSTRCY recovery (hub.c:3159)
  and C_PORT_RESET clear. Replaces the previous bare sleep(10ms).
- wait_for_u0: USB 3.0 polling→U0 wait after port power-on — 36ms steps,
  400ms ceiling (tPollingLFPSTimeout = 360ms; Linux hub.c:1226 debounce
  path).
- accumulate_hub_delay_ns: wHubDelay chain rule (hub.c:1507-1519:
  wHubDelay + parent->hub_delay + 40ns, cap 65535ns).

main.rs wiring:
- Port status normalized to PortStatusSnapshot (decouples the state
  machine from the V2/V3 wire formats; V3 link state extracted from
  bits 8:5).
- Debounce on connection-change before attach; C_PORT_ENABLE cleared
  once handled (Linux port_event semantics).
- Reset path uses wait_for_reset instead of sleep(10ms).
- USB 3 power-on path waits for U0 before proceeding.
- wHubDelay: ancestor-chain walk fetching USB 3 ancestor hub
  descriptors, accumulated per Linux; delivered to newly attached
  SuperSpeed children via SET_ISOCH_DELAY (USB 3.0 9.4.11; Linux
  message.c:1142 — hubs and non-SS skipped, children inherit the hub's
  accumulated delay verbatim per hub.c:5128-5129).
- attach/detach failure logs now identify the port.

hub.rs (xhcid usb module):
- HubDescriptorV3 extended with device_removable: u16 — the SS hub
  descriptor is 12 bytes (spec Table 10-15); the old struct under-read
  by 2 bytes. Stale TODO corrected: SS descriptors have no
  PortPwrCtrlMask (that is USB 2.0-only, still unparsed).

Verified: cargo check clean (0 usbhubd warnings), 14/14 usbhubd tests,
xhcid unaffected (43/43 tests).
2026-07-19 00:27:49 +09:00
Red Bear OS 260003331e xhcid: fix restart_endpoint deadlock, doorbell ordering, NoOp priming (P2-C)
Three bugs in the xHCI endpoint-restart path used by all error recovery
(stall hard reset, transaction-error soft retry, resource retry,
split/babble hard reset):

1. Latent deadlock: restart_endpoint held the port_states write guard
   across set_tr_deque_ptr(), which internally re-acquires a read guard
   on the same key (std RwLock read-while-write on one thread).
   Unobserved because error injection is not yet exercised at runtime
   (P8-C). Fixed by scoping phase-1 ring priming so the guard drops
   before the async command.

2. Doorbell ordering violated xHCI spec 4.6.8/4.6.10: after Reset
   Endpoint the TR Dequeue Pointer is undefined, so Set TR Dequeue
   Pointer must complete BEFORE the doorbell transitions the endpoint
   Stopped->Running. The old order (doorbell first) ran the endpoint
   with an undefined dequeue pointer — undefined xHC behavior on real
   hardware. Linux rings the doorbell from the Set TR Dequeue command
   completion path (xhci_handle_cmd_set_deq, ring.c:1416-1554); xhcid
   now issues Set TR Dequeue, awaits completion, then rings.

3. Priming NoOp never executed: ring.register() was captured after
   ring.next() advanced the enqueue index, so the dequeue pointed past
   the NoOp (dead TRB). Now captured before next(), priming the
   hardware dequeue AT the NoOp so the xHC executes it on restart —
   same semantics as Linux xhci_move_dequeue_past_td pointing at the
   first valid TRB.

Verified: cargo check clean (138 warnings, unchanged), 43/43 tests pass.
2026-07-18 23:14:14 +09:00
Red Bear OS 75229a5789 ptyd: remove temporary line-discipline diagnostics 2026-07-18 23:07:59 +09:00
Red Bear OS d20557f726 xhcid: gate xHCI 1.1+ features on HCCPARAMS2 + protocol-caps bits (P2-B)
Gate xHCI 1.1+ features on their capability bits, cross-referenced with
Linux 7.1 xhci driver behavior:

LEC (HCC2_LEC, scheme.rs):
- lec now uses Linux xhci-mem.c:1350 exact condition:
  hci_version > 0x100 && hcc_params2 & HCC2_LEC (HCCPARAMS2 register
  space is reserved on 1.0 controllers).
- Max ESIT Payload Hi zeroed when LEC=0 (spec Table 6-8 RsvdZ).

U3C (HCC2_U3C, mod.rs suspend_port):
- Refuse SuperSpeed U3 entry with ENOSYS when hci_ver >= 0x110 and
  HCC2_U3C=0 (spec 4.15.1). USB2 suspend unaffected. Linux 7.1 defines
  but never gates this bit; xhcid follows the spec.

CIC (HCC2_CIC): CIE gate pre-existing (set_cie from cic()); added the
hci_ver > 0x100 version guard. HCC2 capability log block similarly
guarded.

HW LPM (extended.rs, mod.rs, port.rs):
- New SupportedProtoCap::{l1_capable,hw_lpm_capable,besl_lpm_capable}
  reading protocol-defined bits (Linux xhci-ext-caps.h:62-66 L1C/HLC/BLC).
- Xhci::hw_lpm_support computed per Linux xhci-mem.c:2137:
  hci_ver >= 0x100 && !HW_LPM_DISABLE && any USB2 protocol cap has HLC.
- attach_device(): defensive LPM clear on USB 2.0 protocol ports
  (rev_major() != 3) when hw_lpm_support is false — Linux xhci.c:4725
  disable path; USB3 excluded because PORTPMSC L1DS aliases U2 timeout.
- Port::enable_lpm/disable_lpm register targets fixed: HLE/HIRD/RWE/
  L1DS belong in PORTPMSC (offset 0x04), not PORTHLPMC (0x0C, bit 16
  RsvdZ) — spec Tables 5-21/5-23, Linux xhci-port.h:135-158. Helpers
  rewritten to Linux xhci.c:4686-4737 two-register sequence.
- Per-device L1 enablement (BESL, MEL Evaluate Context) defers to P3.

Bug fix: removed bogus CapabilityRegs::hlc() + HCC_PARAMS1_HLC_BIT —
they read xECP pointer bits 16-31 of HCCPARAMS1 (spec Table 5-13), not
HLC. HLC lives in the Supported Protocol capability port_info DWORD.

Verification: cargo check clean (138 warnings, -2 vs baseline: the new
disable_lpm call site also revived PORT_HLE/PORT_HIRD_MASK), 43/43
tests pass.
2026-07-18 22:33:38 +09:00
Red Bear OS 9fc1947d53 xhcid: converge xHCI quirks to canonical redox-driver-sys path
Replace xhcid's self-contained 294-line xhci/quirks.rs (7-flag bitflags
type + ~30-entry quirk table) with a thin re-export shim that delegates
to redox-driver-sys::quirks, which now carries all 51 Linux 7.1 quirk
flags and the full ~85-entry canonical controller table.

Changes:
- Cargo.toml: add redox-driver-sys path dependency
- xhci/quirks.rs: replace table with pub use XhciControllerQuirkFlags
  as XhciQuirks + delegating lookup_quirks(vendor, device, revision,
  hci_version)
- main.rs: read real HCIVERSION from MMIO offset 0x04 via
  cap.hci_ver.read() instead of hardcoded 0x100 — matches Linux 7.1
  xhci_gen_setup() at xhci.c:5455. Two table entries depend on the
  value: AMD_0x96_HOST (xhci-pci.c:308) and >= 0x120 spec rule
  (xhci-pci.c:511).
- main.rs: resolve quirks BEFORE get_int_method() so BROKEN_MSI skips
  MSI/MSI-X probing entirely (matching Linux xhci_try_enable_msi at
  xhci-pci.c:143-209). Previously the quirk only overrode the method
  label while irq_file still held the MSI handle — a mismatch causing
  silent interrupt-delivery failures on BROKEN_MSI controllers.
- get_int_method (both cfg variants): accept quirks parameter
2026-07-18 21:52:05 +09:00
Red Bear OS ad4bedd46d xhcid: expand xHCI completion-code error recovery to all 36 codes
maybe_recover_transfer_error previously handled only the first-tier
codes (UsbTransaction, Resource, Stall, BabbleDetected, DataBuffer,
Trb, SplitTransaction) and silently returned Ok(false) for every
other completion code via a catch-all arm.

Cross-referenced Linux 7.1 drivers/usb/host/xhci-ring.c
handle_tx_event() (line 2608+) and handle_transferless_tx_event()
(line 2561+) to add explicit recovery for the remaining ~29 codes:

- Stopped/StoppedLengthInvalid/StoppedShortPacket: restart endpoint
  + retry (up to MAX_SOFT_RETRY), then hard-reset
- InvalidStreamType/InvalidStreamId: soft reset + retry, then
  hard-reset
- IncompatibleDevice: disable slot (device must re-enumerate)
- MissedService/NoPingResponse: log informational, surface to caller
- ContextState/Parameter: hard-reset to resync driver/xHC state
- Bandwidth/BandwidthOverrun/SecondaryBandwidth: log, no transfer
  recovery (config must change)
- IsochBuffer: hard-reset endpoint
- MaxExitLatencyTooLarge: log, surface
- EventLost/Undefined: hard-reset (event ring may be corrupted)
- SlotNotEnabled/EndpointNotEnabled/NoSlotsAvailable: log driver
  state mismatch
- CommandRingStopped/CommandAborted: log xHC state confusion
- Reserved/vendor: default arm logs explicitly

Added completion_code_to_errno() mapping transfer completion codes
to POSIX errnos matching Linux 7.1 semantics:
  Stall -> EPIPE
  BabbleDetected -> EOVERFLOW
  UsbTransaction/SplitTransaction/IncompatibleDevice -> EPROTO
  Trb -> EILSEQ
  DataBuffer -> ENOSR
  SlotNotEnabled/EndpointNotEnabled/NoSlotsAvailable -> ENODEV
  default -> EIO

Rewrote handle_transfer_event_trb() to use the new errno mapping
instead of always returning EIO.

Added 14 unit tests covering all errno mappings and transfer
event handling paths. Full suite (41 tests) passes.
2026-07-18 20:55:41 +09:00
Red Bear OS 4fdb81fa30 DIAG(ptyd): log pty.input line-discipline (icanon/vmin -> cooked/mosi) + slave read mosi state 2026-07-18 17:29:33 +09:00
Red Bear OS 8b605179eb fbcond: translate CR to LF on keyboard input
The keyboard input path pushed the raw character bytes, so the Enter key
(a bare CR on the keymap) never produced an LF. Line-oriented readers on
the console (e.g. a shell's read_line) then never saw a completed line and
appeared to hang. Convert CR->LF here, matching the serial input path
(push_input_bytes).
2026-07-18 12:02:45 +09:00
Red Bear OS ebf0cad69d init: do not chdir into initfs prefix after switch_root
The restored switch_root chdir set init's CWD to /scheme/initfs on the
live image. login later restricts its namespace to DEFAULT_SCHEMES (no
'initfs' scheme) via mkns/setns; the inherited /scheme/initfs CWD fd then
becomes unresolvable. Because relibc resolves paths through the CWD fd
(AT_REDOX_CWD_FD), every subsequent file op in login hangs -- notably
Command::spawn() loading the login shell binary never returns, so the
shell never starts. Leaving the CWD inherited (as before the chdir was
added) keeps spawn working across the login namespace switch; getcwd() in
/usr binaries works without the chdir. Reverts the CWD half of 521c6ffe;
the init-diag cleanup from that commit is retained.
2026-07-18 10:43:05 +09:00
Red Bear OS 37289beee0 Revert 'common/logger: quiet console output to Warn'
The Warn console level correlated with a deterministic login-auth
regression in the mini image (login reads the username but never reaches
MOTD/spawn_shell; 0/3 boots authenticated vs 1/1 with Info). Restore
Info-level console output while the interaction is re-verified; console
spam will be reduced later via a safer mechanism (routing daemon output,
not lowering the shared log level).
2026-07-18 09:47:24 +09:00
Red Bear OS c739f32aa2 common/logger: quiet console output to Warn (keep Info in files)
Daemons log via OutputBuilder::stderr() at output_level, which shares the
interactive console/login VT. At Info they spam routine chatter (cpufreqd,
thermald, i2c-hidd, ...) over the login prompt as boot continues in
parallel with getty. Drop the console filter to Warn; full Info logs are
still written to per-daemon log files (file_level), and a bootloader env
var can raise it for debugging.
2026-07-18 08:54:57 +09:00
Red Bear OS 521c6ffe5b init: restore switch_root chdir + remove temporary spawn diagnostics
Commit 99e08650 temporarily removed the post-switch_root chdir (which
points init's working directory at a valid dir in the new root) to test a
spawn hang, and added init-diag SPAWNING/SPAWNED/WAITING eprintlns. The
chdir was never restored: init and every daemon/getty/login/shell it
spawns inherit an invalid CWD (AT_REDOX_CWD_FD), so getcwd() fails in
/usr binaries and interactive shells (zsh/brush) hang instead of reading
input. Restore the chdir and drop the diagnostic eprintlns (which also
spammed the login console).
2026-07-18 08:24:09 +09:00
Red Bear OS e9342b78e9 feat(fbcond): bidirectional serial console mirror for headless login
fbcond now mirrors all framebuffer-console output to the kernel debug (serial)
scheme AND feeds serial input back into the active VT's input queue. Previously,
once fbcond took over the console after display handoff the serial line went
silent (headless operators saw the boot stop at 'Performing handoff' and never
saw the getty login prompt, which draws only to the framebuffer VT). Now the
same console — boot log, login prompt, and shell — is fully usable over serial,
reusing the working framebuffer getty for both surfaces.
2026-07-18 07:23:22 +09:00
Red Bear OS 0120017484 fix(net): silence benign no-network warnings; add e1000e (82574) support
- smolnetd: an empty ip_router (DHCP-managed or deliberately network-less like
  the bare target) is a valid 'no default gateway' state, not a malformed config
  -> no warning.
- router: a limited/directed IPv4 broadcast (DHCP DISCOVER to 255.255.255.255
  before any lease/route exists) legitimately has no routing-table entry; don't
  warn 'No route found' for broadcast destinations.
- e1000d: add the 82574L (0x10d3, QEMU '-device e1000e') to the E1000 match
  list; it keeps the legacy descriptor/register interface this driver uses.
  I219 is intentionally excluded (integrated MDIO PHY, different init).
2026-07-18 00:49:44 +09:00
Red Bear OS 1769b083ab fix(boot): clean up bare/mini boot warnings and errors
- init: add condition_path_exists so optional-daemon units (dbus, seatd,
  thermald, evdevd) are silently skipped when their binary is absent in a
  minimal image, instead of emitting [FAILED] 'No such file or directory' on
  the bare target. Boot-critical units omit the field and still hard-fail.
- ahcid: an empty ATAPI/optical drive (QEMU's default DVD-ROM, most bare-metal
  optical bays) failed READ CAPACITY and logged 4 ERROR lines every boot;
  register it with a zero block count as a normal no-media state and drop the
  HBA register dump to debug level.
- netstack: a machine with no NIC (bare, or an unsupported NIC) logged an ERROR
  and exited non-zero; treat 'no network adapter' as a normal idle state
  (info + clean exit).
- dhcpd: cut the socket timeout 30s -> 8s so the network stage fails fast when
  no DHCP server answers instead of stalling boot.
2026-07-18 00:29:43 +09:00
Red Bear OS 324172abaf fbcond: restore console scrollback (lost P4-fbcond-scrollback)
Re-adds the archived-but-unapplied scrollback support: a 1000-line ring
buffer in TextScreen capturing all output (incl. pre-handoff boot log), a
Handle::Scrollback variant opened via /scheme/fbcon/<vt>/scrollback, and a
read path returning the retained buffer. Adapted to the current single-step
openat scheme protocol.
2026-07-16 21:59:18 +09:00
Red Bear OS c14a577dc8 init(00_tmp): idempotent mkdir -p, drop rm that failed on fresh boot 2026-07-16 18:57:53 +09:00
Red Bear OS f5f726ca1e init: 20_audiod.service oneshot_async to not block boot on missing audio hw 2026-07-16 12:59:40 +09:00
Red Bear OS 1f82624025 init: /usr driver-manager + netstack must not block boot-to-login 2026-07-16 12:46:46 +09:00
Red Bear OS 8aa8616d5e init(ptyd): 00_ptyd.service must be scheme=pty, not notify
ptyd was migrated to the SchemeDaemon/ready_with_fd path: it registers the
"pty" scheme and signals readiness by sending its scheme cap fd back to
init, which init receives via call_ro(FD) in its scheme-service startup.
The service was still declared type="notify", so init waited for a plain
readiness byte ptyd never sends and blocked forever at ptyd — before the
console/login stack could start (post-switchroot boot hang). Declare the
correct type={scheme="pty"} so init uses the matching fd-receive path.
2026-07-16 11:41:34 +09:00
Red Bear OS aa372cf5c1 hwd(acpi): gate per-LNK routing enumeration to debug
The ACPI _LNK object enumeration logged 50+ INFO lines per boot on QEMU
(one per _UID/_CRS/_STA/_DIS/_SRS/_HID method), flooding the console and
slowing serial boot. This is PCI interrupt-routing detail, not needed at
INFO on every boot; move it to debug.
2026-07-16 11:16:01 +09:00
Red Bear OS 99e08650a4 DIAG: log service spawn/wait; temporarily revert switch_root chdir to test spawn hang 2026-07-16 10:41:15 +09:00
Red Bear OS 9dae3cda91 init: try prefix then / for post-switchroot CWD (/usr is not a chdir target) 2026-07-16 09:29:24 +09:00
Red Bear OS 9255eacc02 init: chdir into new root on switch_root so daemons inherit a valid CWD (fixes base-env zsh hang blocking login) 2026-07-16 09:14:24 +09:00
Red Bear OS 1fb3b7c243 inputd: fix producer-write regression — let producer event writes fall through to distribution (was EINVAL, crashing ps2d and killing all input) 2026-07-16 08:27:50 +09:00
Red Bear OS 8818ababbb init: keep boot stdio on kernel console (observable boot) instead of redirecting to /scheme/log 2026-07-16 08:04:02 +09:00
Red Bear OS 2b48b9e966 pcid: log PCIe->I/O-port fallback at info; fbcond: transient no-display at debug 2026-07-16 06:39:43 +09:00
Red Bear OS 32bb63f360 revert TEMP DIAG: re-enable switch_stdio to /scheme/log 2026-07-15 23:57:22 +09:00
Red Bear OS a5680cae92 TEMP DIAG: keep init stdio on kernel console (disable switch_stdio) for headless boot visibility 2026-07-15 23:44:08 +09:00
Red Bear OS 85574c22f1 daemon: drop cmd before readiness wait so early child exit yields EOF (fix hwd/acpid spawn deadlock) 2026-07-15 23:27:40 +09:00
Red Bear OS 8c657b3645 hwd: only spawn acpid when acpi scheme not already registered (fix boot hang) 2026-07-15 23:13:09 +09:00
Red Bear OS d69afbc732 acpid: exit cleanly when acpi scheme already registered (hwd double-spawn) 2026-07-15 22:56:00 +09:00
Red Bear OS e087ff8b71 ptyd: expose PTS number via dup(master, ptsname) for getty slave open 2026-07-15 22:12:37 +09:00
Red Bear OS 54e4c5751c ptyd: accept ptmx as master open; strip init/daemon boot debug spam 2026-07-15 21:38:39 +09:00
Red Bear OS 194a77df11 fix(ptyd): use SchemeDaemon/ready_sync_scheme to send cap fd to init
ptyd was the last initfs daemon still using the old Daemon +
register_sync_scheme + daemon.ready() pattern, where ready() writes a
plain readiness byte. init's scheme-service startup does call_ro(FD)
expecting to receive the scheme cap fd (the SchemeDaemon/ready_with_fd
protocol every other daemon uses), so init blocked forever waiting for
an fd that never arrived, hanging the boot after ptyd.
2026-07-15 15:45:49 +09:00
Red Bear OS db724cda70 init: use blocking waitpid to avoid busy-loop spam 2026-07-15 03:20:47 +09:00
Red Bear OS 3a7c96b19f merge: combine 0a358aa0 (diag + libc::pipe2 fix) with 104da7de (init FILETABLE fix) into canonical submodule/base
Both branches independently fixed the FILETABLE desync bug. This merge creates a single canonical history that preserves the diagnostic commits from 0a358aa0 and the eexist-focused fix from 104da7de.

After this merge, the per-fork submodule/<name> branch (this is the AGENTS.md-mandated canonical ref) is a child of both, so origin can fast-forward to it.

(NO AI attribution in commit message body, per project policy)
2026-07-14 12:19:46 +09:00
Red Bear OS 0a358aa05f diag(base): trace fd transfer in init, daemon, and logd
Add diagnostics to pin down where the INIT_NOTIFY fd handoff hangs:
- init/src/service.rs: log read_pipe fd and call_ro results
- daemon/src/lib.rs: log cap_fd, write_pipe, and call_wo result
- logd/src/main.rs: explicit ready_sync_scheme result and setrens fallback

These are temporary diagnostics for the boot-hang investigation.
2026-07-14 11:19:31 +09:00
Red Bear OS 1e341ff782 init: fix pipe FILETABLE desync — use libc::pipe2 instead of raw syscall
create_pipe() used raw syscall::openat/syscall::dup which allocate kernel
fds WITHOUT registering in relibc FILETABLE. Later FILETABLE-managed
syscalls (Command::spawn -> relibc pipe2) reserve the same fd numbers,
causing EEXIST in kernel insert_file.

Replace with libc::pipe2 which goes through relibc FILETABLE-aware path.
2026-07-13 20:22:31 +03:00
Red Bear OS 104da7de12 init: fix FILETABLE desync causing EEXIST on all daemon spawns
create_pipe() used raw syscall::openat() (SYS_OPENAT) and syscall::dup()
which bypass relibc's FILETABLE-managed fd allocation (SYS_OPENAT_INTO).
This created phantom fds known to the kernel but not to relibc's userspace
FILETABLE. When Command::spawn() later called relibc's pipe2() for
fork+exec error reporting, the FILETABLE allocated a position it thought
was free, but the kernel rejected it with EEXIST (errno 17).

This killed EVERY daemon spawn during boot: logd, randd, zerod, rtcd,
nulld, acpid, pcid, inputd, lived, redoxfs, pcid-spawner, fbcond, vesad,
fbbootlogd, hwd, ps2d — all failed with 'File exists (os error 17)'.

Fix: use libc::pipe2() which goes through relibc's FILETABLE-managed
path (FdGuard::open → SYS_OPENAT_INTO), keeping tables in sync.
2026-07-13 00:47:05 +03:00
Red Bear OS 6e5da7259a rb: remove FEXEC_STEP reference (removed from redox_rt)
Commit bb20fe9c in relibc fork removed FEXEC_STEP diagnostic from
redox_rt::proc. The bootstrap binary in base referenced it in
exec.rs:257, causing build failure:
  error[E0425]: cannot find value  in module

Removed the diagnostic step variable and simplified the panic message.
Build now compiles cleanly.
2026-07-12 23:46:28 +03:00
Red Bear OS 5e5657e4dd rb: add verify exclusion for RB-replaced upstream functions
52 functions documented as intentional RB replacements across:
- initfs (8): RB uses different initfs tooling
- driver-graphics KMS (16): RB refactored display layer
- ihdgd Intel GPU (5): RB driver refactoring
- vesad (2): RB framebuffer refactoring
- virtio-gpu (12): RB async GPU refactoring
- inputd/input/net (3): RB daemon pattern refactoring
- pcid (2): RB PCI refactoring
- xhcid USB (4): RB USB refactoring
- redoxerd (1): RB executor refactoring
- netstack (1): RB network refactoring
- ramfs (2): RB filesystem refactoring
2026-07-12 16:55:59 +03:00
Red Bear OS 8f50862be5 Fix create_pipe: bypass redox_rt::sys::open two-step that consumes has_run_dup
Use direct syscall::openat with ns_fd to get pipe READ end, then
syscall::dup with 'write' to get WRITE end. This avoids the
redox_rt::sys::open bug where step 2 (openat_into_posix on the
pipe read end) consumes has_run_dup, leaving the subsequent dup()
unable to get the write end.
2026-07-12 15:18:01 +03:00
Red Bear OS dce10c4eb2 fix: bypass ns_fd in pipe creation via libredox::open
The init process's ns_fd may be stale after exec, causing EBADF when
pipe2() calls redox_rt::sys::open (which needs current_namespace_fd()).
Use libredox::Fd::open + syscall::dup instead, bypassing the FILETABLE
and ns_fd dependency entirely.
2026-07-12 12:41:32 +03:00
Red Bear OS 234ce3ab1a diag: print pipe() error details in service.spawn 2026-07-12 11:57:10 +03:00
Red Bear OS ab0da30613 fix: register external fds with userspace FILETABLE
Socket and RawEventQueue create fds via libredox raw syscalls that
bypass the redox-rt userspace FILETABLE. FdGuard::dup then reserves
these positions, causing SYS_DUP_INTO to destroy the existing fds.
2026-07-12 10:29:06 +03:00
Red Bear OS 7ba6cff32d diag: remove PM: debug prints from procmgr bootstrap
Removes the 6 libredox::call::write(1, b'PM:N') debug trace lines from
procmgr::run() that were polluting serial output during early boot.
2026-07-12 05:17:55 +03:00
Red Bear OS 1ed140e018 fix: move ACPI S3/battery methods from impl Drop to impl AcpiContext
The suspend_to_ram, read_battery_status, and read_battery_info methods
were incorrectly placed inside 'impl Drop for PhysmapGuard'. They
reference fields (aml_symbols, fadt) that only exist on AcpiContext.
Move them to impl AcpiContext and fix field access (self.fadt.as_ref()
instead of self.fadt()).
2026-07-12 04:14:34 +03:00
Red Bear OS 3fe7b12434 fix: add try_map_bar, try_pci_allocate_interrupt_vector, fix try_mem return type
- try_mem now returns Result (matching caller expectations)
- try_map_bar: non-panicking BAR mapping on PciFunctionHandle
- try_pci_allocate_interrupt_vector: non-panicking IRQ allocation
- virtio-core: reverted .ok_or() back to .map_err() for Result type
2026-07-12 02:48:16 +03:00
Red Bear OS 4932cb4d62 fix: add try_port() to PciBar and try_irq_handle() to LegacyInterruptLine
Non-panicking variants needed by ac97d, vboxd, and other drivers that
prefer error handling over panics.
2026-07-12 02:39:59 +03:00