Commit Graph

3250 Commits

Author SHA1 Message Date
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
Red Bear OS bf9989b7c0 fix: add try_mem() to PciBar, fix virtio-core caller
Added try_mem() returning Option<(usize, usize)> for non-panicking
memory BAR access. Fixed virtio-core/probe.rs to use .ok_or() instead
of .map_err() to match the Option return type.
2026-07-12 02:34:09 +03:00
Red Bear OS be2d7503c9 chore: gitignore Cargo.lock (build artifact) 2026-07-12 02:26:18 +03:00
Red Bear OS 0422712e29 fix: add sndbuf/rcvbuf to Socket accept initializer
The accept() method was missing sndbuf and rcvbuf fields that were
added to the Socket struct. Inherit values from the listening socket.
2026-07-12 02:25:20 +03:00
Red Bear OS f2092fa973 fix: correct redox-ioctl patch path in Cargo.toml
The [patch] section pointed to ../../relibc/source/redox-ioctl which
doesn't exist. Fixed to ../relibc/redox-ioctl matching the main
dependency path at line 114.
2026-07-12 02:23:20 +03:00
Red Bear OS b59dffc0ff fix: replace 8 .expect("TODO") panic points with proper error handling
- on_sendfd: subscribe/dup errors return error Response instead of panic
- fork/new_thread: subscribe errors propagate via ? operator
- signal delivery (4 sites): status fd write errors are best-effort (let _ =)

The procmgr is the first userspace process manager — a panic here kills
the entire system. These changes make it resilient to transient fd errors.
2026-07-12 01:51:11 +03:00
Red Bear OS 00b799d512 absorb: 41 orphaned base patches re-applied (Phase 1.0A)
Per local/docs/PATCH-PRESERVATION-AUDIT-2026-07-12.md the base
fork was carrying only 38 of 100 patches in local/patches/base/.
The other 62 patches' content was silently missing from the fork
working tree, even though their .patch files were preserved.

This commit re-applies 41 patches that genuinely still apply
cleanly + 17 hunks that partially applied. Recovery covers:

- D-Bus initfs service wiring (P4-initfs-dbus-services)
- USB service wiring (P4-initfs-usb-drm-services)
- netcfg/dhcp/dhcpv6 driver fixes
- acpid shutdown/PM/quirk fixes
- inputd/ps2d hard-fail logging
- pcid driver interface refinements (server cmd channel)
- virtio-core for VirtualBox support
- ixgbed/rtl8139/rtl8168 net drivers
- ahcid NCQ + per-function interrupt coalescing
- logd persistent logging
- bootstrap procmgr race-condition fixes
- cargo version pin to +rb0.3.0 (synchronized release branch)

58 files changed, +1444/-318 lines.

Untracked mnt/ tree and *.orig / *.rej files cleaned up after
patch application (leftover from absolute-path patch headers).
2026-07-12 01:29:08 +03:00
Red Bear OS 5023b72728 Cargo.lock: regenerate after Cargo.toml version sync (branch 0.3.0 -> 0.3.1)
- bytemuck 1.25.0 -> 1.25.1 (patch bump)
- bytemuck_derive 1.10.2 -> 1.11.0 (minor bump)
- Other minor patches refreshed

Part of Phase 0 fix for G1 (Cargo.lock drift).
The suffix-only drift +rb0.3.0 -> +rb0.3.1 was already
applied on master via cargo generate-lockfile. The
other entries are non-Cat-2 transitive bumps that
catches with the lockfile refresh.

No functional change to Cat 2 fork entries (those
already match Cargo.toml at +rb0.3.1).
2026-07-12 01:15:16 +03:00
Red Bear OS 75f6cf902d bootstrap: restore upstream exec.rs from commit 372b200f
Our Red Bear patches had reverted the userspace fd allocation refactor
(commit 372b200f) in exec.rs. This caused FD tracking mismatches
between the userspace FILETABLE and the kernel fd table, resulting in
EEXIST errors and fork failures.

Restored the upstream version which correctly uses redox_rt::sys::*
functions (openat, dup, sys_call_ro) that go through the FILETABLE,
and openat_into_upper for pre-init FD allocation. Also includes the
filetable_binary_fd setup and same_process flag in ExtraInfo.
2026-07-11 17:23:29 +03:00
Red Bear OS aedc416f0c bootstrap: fix FD allocation to match upstream userspace fd model
The bootstrap's start.rs used libredox::call::openat which resolved to
the bootstrap's own redox_openat_v1 in initfs.rs, calling syscall::openat
(SYS_OPENAT). This let the kernel allocate POSIX FDs 0,1,2 for
stdin/stdout/stderr, but the userspace FILETABLE was never updated.

Later, exec.rs called auth.dup(b'cur-context') via redox_rt::sys::dup,
which asked the empty FILETABLE for a free slot (returning 0), then
passed it to SYS_DUP_INTO. The kernel rejected it with EEXIST because
posix_fdtbl[0] was already occupied by stdin.

Fix: use syscall::openat_into to directly specify FD slots 0,1,2 in
start.rs, and use syscall::dup_into with a computed FD index for
cur-context in exec.rs. Both bypass the FILETABLE, which is only
populated later by redox_rt::initialize_freestanding.
2026-07-11 17:02:37 +03:00
Red Bear OS f4c7552767 bootstrap: fix refutable pattern for Option<FexecResult> 2026-07-11 14:21:59 +03:00
Red Bear OS 479138d02f bootstrap: adapt to upstream redox-rt API changes
- ExtraInfo now requires filetable_fd and same_process fields
- fexec_impl now returns Option<FexecResult>
2026-07-11 14:13:50 +03:00
Red Bear OS 979b5fa55c base: update Cargo.lock 2026-07-11 12:02:49 +03:00
Red Bear OS bd595851e2 base: apply Red Bear patches on latest upstream/main
251 files: init, acpid, ipcd, netcfg, ihdgd, virtio-gpud, scheme-utils,
inputd, block driver, ptyd, ramfs, randd, initfs bootstrap, path deps,
version +rb0.3.1, author attribution
2026-07-11 11:39:24 +03:00
Jeremy Soller 1b17b3fc24 Merge branch 'pty-redoxer' into 'main'
redoxerd: Proper pty init

See merge request redox-os/base!303
2026-07-10 17:35:02 -06:00
Wildan M eb48b04b54 redoxerd: Proper pty init 2026-07-10 11:22:55 +07:00
Jeremy Soller 9e12870329 Remove unused redox-rt from Cargo.toml, it is defined in bootstrap/Cargo.toml 2026-07-09 13:09:02 -06:00
Jeremy Soller 9a855b3c43 Merge branch 'main' into 'main'
ptyd: add documentation for the `pty' scheme's resources

See merge request redox-os/base!302
2026-07-08 16:30:43 -06:00
Connor-GH 46965493a0 ptyd: add documentation for the `pty' scheme's resources 2026-07-08 13:13:06 -05:00
Jeremy Soller 3e5007b3d8 Merge branch 'main' into 'main'
ptyd: implement tcflush, tcdrain, and tcsendbreak

See merge request redox-os/base!301
2026-07-07 16:55:01 -06:00
Connor-GH cc03dca2c8 ptyd: implement tcflush, tcdrain, and tcsendbreak 2026-07-07 16:43:18 -05:00
Jeremy Soller 2e702052f9 Merge branch 'cwd-boot' into 'main'
init: Change cwd to `/` at boot

See merge request redox-os/base!289
2026-07-06 05:42:20 -06:00
Wildan M f80b51411b init: Change cwd to / at boot 2026-07-06 05:17:35 +07:00
Jeremy Soller ae1538c27e Merge branch 'path-update' into 'main'
Update redox-path to relax canonical path requirement

See merge request redox-os/base!300
2026-07-05 10:54:36 -06:00
Jeremy Soller a2f68597c2 Merge branch 'raspi-fix' into 'main'
randd: Fix ARM hardware seed detection, raspi: Fix bcm driver init

See merge request redox-os/base!299
2026-07-05 05:44:14 -06:00
Wildan M 4692e32455 Update redox-path to relax canonical path requirement 2026-07-05 18:03:54 +07:00
Wildan M 572561035b raspi: Fix bcm driver init 2026-07-05 11:08:50 +07:00
Wildan M d75260e0d8 randd: Fix ARM hardware seed detection 2026-07-05 11:07:37 +07:00
Jeremy Soller 2878a22564 Merge branch 'fix_fbcond_enter' into 'main'
Fix enter key in fbcond

See merge request redox-os/base!297
2026-07-03 06:01:44 -06:00
bjorn3 d1b51888b6 Fix enter key in fbcond 2026-07-02 19:57:52 +02:00
Jeremy Soller 5238db02b0 Merge branch 'gpu_drm45' into 'main'
drivers/graphics/driver-graphics: Implement cursor planes

See merge request redox-os/base!296
2026-07-02 11:55:22 -06:00
bjorn3 31793e7c0c drivers/graphics/driver-graphics: Implement cursor planes 2026-07-02 19:33:53 +02:00
Jeremy Soller ff274f62b8 Merge branch 'gpu_drm44' into 'main'
drivers/graphics/driver-graphics: Implement DRM_IOCTL_MODE_CLOSEFB

See merge request redox-os/base!292
2026-07-01 14:13:58 -06:00
Jeremy Soller 00a3dfb215 Merge branch 'better_panic_message' into 'main'
Improve panic message when manually starting a daemon

See merge request redox-os/base!291
2026-07-01 14:13:23 -06:00
bjorn3 4411f8cfb6 drivers/graphics/driver-graphics: Implement DRM_IOCTL_MODE_CLOSEFB 2026-07-01 21:49:11 +02:00
bjorn3 f74a6f8765 Improve panic message when manually starting a daemon 2026-07-01 21:42:05 +02:00
Jeremy Soller f1c44511ec Merge branch 'less_board_config' into 'main'
Unconditionally compile bcm2835-sdhcid

See merge request redox-os/base!290
2026-07-01 13:35:39 -06:00
bjorn3 ed73d8a36d Rustfmt 2026-07-01 21:11:55 +02:00
bjorn3 f71d388c5b Unconditionally compile bcm2835-sdhcid
This moves us closer towards having a single unified image for all arm64
systems. Only init still has the board compiled in rather than detecting
it from the device tree or ACPI tables.
2026-07-01 21:06:41 +02:00
Jeremy Soller a301f50bca Merge branch 'avoid-blocking-nsmgr' into 'main'
refactor: Adapt to userspace fd allocation

See merge request redox-os/base!283
2026-07-01 08:20:05 -06:00
Ibuki Omatsu 372b200f26 refactor: Adapt to userspace fd allocation 2026-07-01 08:20:05 -06:00
Jeremy Soller 29a1f4f8ec Merge branch 'remove_unnecessary_struct_repr' into 'main'
Remove unnecessary struct reprs

See merge request redox-os/base!288
2026-06-26 06:30:51 -06:00