Commit Graph

93 Commits

Author SHA1 Message Date
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 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
Wildan M 4692e32455 Update redox-path to relax canonical path requirement 2026-07-05 18:03:54 +07:00
Ibuki Omatsu 372b200f26 refactor: Adapt to userspace fd allocation 2026-07-01 08:20:05 -06:00
Jacob Lorentzon 24a98c0309 Merge branch 'relpathat' into 'main'
feat: Implement realpathat for ramfs

See merge request redox-os/base!271
2026-05-29 13:13:36 +02:00
Ibuki Omatsu 52b1d04e12 feat: Implement realpathat for ramfs 2026-05-29 13:13:35 +02:00
bjorn3 24fb66e144 Fix warnings for updated rustc
And move away from an internal feature now that there is a proper
(unstable) function for it.
2026-05-27 21:11:53 +02:00
bjorn3 7757d2d32f Fix init path passed to fexec_impl
Getting this path wrong breaks dynamically linking init.
2026-04-27 20:35:05 +02:00
bjorn3 cdf45983fa initfs: Hard code creation time
This improves reproducibility of the initfs.
2026-04-26 12:16:30 +02:00
bjorn3 2052b70212 initfs: Allocate inodes in write_inode 2026-04-25 13:54:23 +02:00
bjorn3 4fa1ef7c98 Fix building bootstrap for i586 2026-04-19 20:49:19 +02:00
aarch eb82e9cc88 RISCV64: Change VA scheme to Sv39 for real hardware support 2026-04-18 09:45:13 -06:00
Wildan M db5209afbd Update redox-rt 2026-04-18 03:33:52 +07:00
Akshit Gaur 11feb08036 Remove local stuff 2026-04-17 17:30:25 +05:30
Akshit Gaur 854ab48c85 Use local syscall and libredox 2026-04-17 15:22:29 +05:30
Akshit Gaur 4a527cb374 Add ProcCall 2026-04-17 14:39:58 +05:30
Akshit Gaur 2ccd96cf3d revamp sync_kernel_attrs 2026-04-17 14:39:58 +05:30
Akshit Gaur ec1e02e712 ens to prio 2026-04-17 14:39:58 +05:30
bjorn3 c0f548f219 bootstrap: Move a bunch of build flags from the recipe 2026-04-16 19:54:15 +02:00
Ribbon 90ea974ce0 Add missing Cargo package description and update drivers README 2026-03-16 10:39:15 -06:00
bjorn3 44614a0b3f Support removing schemes from a namespace
This can be done using rmdir /scheme/my_scheme. Scheme implementations
do not yet exit when all fds are closed, but you can now kill the
service and restart it after you removed its scheme.
2026-03-07 22:07:34 +01:00
bjorn3 3a406b75e2 bootstrap: Only keep the initfs data mapped in the initfs process 2026-03-07 12:46:45 +01:00
bjorn3 ecaa58d5e5 bootstrap: Remove outdated fixme
The initfs data is already mapped as read-only by the "rest of memory"
mprotect.
2026-03-07 12:46:45 +01:00
bjorn3 a8f3e83e9d bootstrap: Map .data.rel.ro, GOT and PLT as read-only 2026-03-07 12:46:45 +01:00
bjorn3 311e180019 bootstrap: Move scheme socket creation to spawn 2026-03-06 22:25:20 +01:00
bjorn3 b31f48cb59 bootstrap: Directly pass event cap fd to procmgr 2026-03-06 22:25:19 +01:00
bjorn3 890f325368 bootstrap: Store FdGuard's in KernelSchemeMap 2026-03-06 22:25:18 +01:00
bjorn3 b641ed3741 bootstrap: Pass proc auth FdGuard by-value 2026-03-06 22:25:16 +01:00
bjorn3 0d957f8d20 bootstrap: Return FdGuard for the scheme root in spawn 2026-03-06 22:25:14 +01:00
bjorn3 fe3f09133d bootstrap: Use FdGuard for scheme_creation_cap 2026-03-06 22:25:05 +01:00
Ibuki Omatsu 2738f69224 feat: Implement std_fs_call handling to initfs, ramfs, acpi and xhci 2026-02-28 08:15:16 -07:00
Jeremy Soller 3a94262aff Downgrade scheme not found log level to info 2026-02-26 10:00:39 -07:00
Ibuki Omatsu ac3d816672 feat: Pass initial cwd fd to init 2026-02-26 06:36:30 -07:00
bjorn3 0227c0677c init: Introduce switchroot command
This sets PATH, LD_LIBRARY_PATH and runs init scripts for the new root.
In the future this could replace the entire set of services that should
run, restarting any services for which a newer executable is available
in the new root and stopping any services which don't exist in the new
root. This behavior could also be useful for soft-reboots in the future
to handle updates without rebooting the entire system.
2026-02-19 20:18:07 +01:00
bjorn3 c028c49c55 initfs: Symlinks should be resolved relative to symlink parent 2026-02-17 20:54:53 +01:00
bjorn3 fc4b48df67 initfs: Fix stat for symlinks 2026-02-17 20:54:47 +01:00
bjorn3 f0413aec8e initfs: Fill in st_ino
Otherwise ls and other tools will think they have already visited a
directory when recursively enumerating all files.
2026-02-17 20:54:40 +01:00
bjorn3 edd1c249e9 initfs: Remove uid and gid fields for inodes
The initfs creation code always puts 0 in them.
2026-02-17 20:54:35 +01:00
Anhad Singh fff728c5e5 misc(Cargo.lock): bump redox-rt
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2026-02-17 01:03:09 +11:00
Jeremy Soller 4788db00de Update redox-syscall and redox-scheme for stdfscall 2026-02-11 12:21:35 -07:00
bjorn3 9ec0733951 bootstrap: Move computation of schemes from initnsmgr to main 2026-02-07 20:32:09 +01:00
bjorn3 a04626044e bootstrap: Use FdGuard inside initnsmgr 2026-02-07 20:06:06 +01:00
bjorn3 029e3a48e2 bootstrap: Use FdGuard for sync_pipe 2026-02-07 20:06:06 +01:00
bjorn3 c0c002bfbc bootstrap: Remove Arc around KernelSchemeMap 2026-02-07 20:06:02 +01:00
bjorn3 842855e26f Fix /scheme/proc/ps header 2026-02-07 12:32:52 +01:00
bjorn3 9e28791c2b Fix a couple of warnings 2026-02-07 12:19:41 +01:00
bjorn3 a40955bb80 Remove setrens handling and the rns/ens process fields
It is no longer used due to the capability rework.
2026-02-06 21:59:17 +01:00
4lDO2 c6f5703313 Fix typo causing rt signals not to wakeup thread. 2026-02-05 15:13:47 +01:00