Commit Graph

152 Commits

Author SHA1 Message Date
vasilito 8f34d2e2ad trace sys_write errors for low FDs 2026-07-11 06:35:23 +03:00
vasilito be8b1a9f79 add posix FD list to AwaitingFiletableChange and EBADF logs 2026-07-11 06:18:41 +03:00
vasilito 63d7dc0470 add filetable state logging at EBADF point 2026-07-11 05:30:31 +03:00
vasilito ed76375e7e fix ArrayString type for context name logging 2026-07-11 05:03:47 +03:00
vasilito 86f4f8758e add context name to openat log and filetable change logging 2026-07-11 04:51:40 +03:00
vasilito 182cc74c2d kernel: fix duplicate closing brace in openat 2026-07-11 04:25:19 +03:00
vasilito 2dac8e3326 kernel: fix openat log - revert to simple version (no context name) 2026-07-11 04:17:30 +03:00
vasilito e3fbd6670c kernel: add context name to openat log 2026-07-11 04:09:38 +03:00
vasilito 7939799536 kernel: add openat logging to trace bootstrap syscalls 2026-07-11 03:57:57 +03:00
vasilito edfd5722fc kernel: normalize non-positioned read/write offset to 0 instead of u64::MAX
sys_read and sys_write passed u64::MAX as the offset for non-positioned
file descriptors. Many scheme handlers (AddrSpace, proc:Start, etc.)
check offset != 0 or offset % word_size != 0, causing EINVAL when
receiving u64::MAX. Passing 0 instead fixes all non-positioned read/write
operations across all scheme handlers uniformly.

This replaces the per-handler u64::MAX workarounds with a root-cause fix.
2026-07-10 15:24:01 +03:00
vasilito 28c65bfcfb kernel: wire I/O accounting into sys_read/sys_write
sys_read increments io_rchar, io_syscr, io_read_bytes.
sys_write increments io_wchar, io_syscw, io_write_bytes.
This makes /proc/[pid]/io show actual I/O activity.

Cross-referenced with Linux 7.1 mm/filemap.c:filemap_get_pages
and include/linux/task_io_accounting.h. The fields are saturated
additions to avoid overflow on long-running processes.
2026-07-08 21:18:00 +03:00
vasilito 5aeb2e8631 Fix kernel syscall compile errors 2026-07-08 00:58:19 +03:00
vasilito d1ddac0e2c kernel: add openat_into + dup_into for upstream 0.9.0 syscall API 2026-07-08 00:49:03 +03:00
vasilito ca67b1da37 0.3.0: converge kernel onto upstream master
- Rebase all Red Bear kernel changes onto upstream master (4d5d36d4).
- Update version to 0.5.12+rb0.3.0 and add Red Bear author attribution.
- Switch redox_syscall direct dependency to local fork path (../syscall).
- Bump rust-toolchain.toml to nightly-2026-05-24.
- Regenerate Cargo.lock for +rb0.3.0 suffixes and path deps.
2026-07-06 18:43:52 +03:00
Ibuki Omatsu 6c3d5d28c6 refactor: Move fd allocation logic into userspace 2026-07-01 08:02:47 -06:00
4lDO2 cee451af38 Use ArrayVec for kcall fd nums, 8% better perf! 2026-05-31 20:24:57 +02:00
Wildan M ec1395b554 Wrap unmap loop with handle_notify_files 2026-05-30 08:40:49 -06:00
Ibuki Omatsu e847768f2b feat: Implement multiple fds variant for call and std_fs_call 2026-05-29 13:07:36 +02:00
Wildan M ba28216ae8 Downgrade locks to read 2026-04-29 21:26:44 +07:00
bjorn3 654ee6ca3e size_of and align_of are part of the prelude nowadays 2026-04-09 15:23:34 -06:00
Speedy_Lex ee1260363c Fix many clippy lints 2026-04-08 19:40:41 +01:00
bjorn3 ab4abf63c9 Deduplicate Page and other paging related things between architectures 2026-04-03 22:15:00 +02:00
Wildan M a42ec44dbf Partially solve borrow rules 2026-04-01 08:42:18 -06:00
Wildan M 3b5a0e4c60 Apply ordered lock to AddrSpaceWrapper without solving borrow checker 2026-04-01 08:42:18 -06:00
Ibuki.O 3934ea454d feat: Implement translation of std_fs_call to each function 2026-03-14 11:37:07 +09:00
Wildan M 6307446ede Solve borrow rules to LockedFdTbl 2026-03-09 15:57:38 +07:00
Wildan M 8412321568 Add lock token to FdTbl without borrow check 2026-03-09 13:12:19 +07:00
Wildan M 206f82709a Demote LockedFileDescription to solve borrow rules 2026-03-09 12:29:24 +07:00
Wildan M 8f270795da Partialy solve borrow checking 2026-03-09 11:47:07 +07:00
Wildan M f40b84a5cc Add lock token to FileDescription, without borrow check 2026-03-09 11:23:51 +07:00
Wildan M fd9c651410 Do not allocate on unneeded Vec 2026-03-07 09:15:20 -07:00
auronandace f0f158e5d6 eliminate 2 unwraps in syscall fs 2026-03-02 17:11:51 -07:00
Wildan M ac0bd2af74 Fix compilation 2026-02-26 04:33:10 +07:00
auronandace df469ddcb3 apply is_multiple_of lint 2026-02-21 08:39:26 +00:00
Jeremy Soller 934162f35a Implement stdfscall 2026-02-11 12:12:49 -07:00
bjorn3 6ddd0a9098 Replace scheme::schemes() with scheme::get_scheme()
We never need to iterate over all schemes. We only ever need to access
individual schemes.
2026-02-06 20:54:42 +01:00
Jeremy Soller 2055a205f1 Remove legacy path message 2026-01-29 10:12:04 -07:00
Ibuki Omatsu 5ac00f5533 Remove namespace management from the kernel. 2026-01-20 20:43:34 -07:00
Ibuki Omatsu e30ed9ab6a Introduce syscall6. Add unlinkat and remove unlink and rmdir. 2025-12-17 18:31:04 -07:00
bjorn3 c089667ade Remove support for the legacy packet user schemes 2025-12-13 15:52:30 +01:00
bjorn3 3bf880e008 Correctly handle MAP_FIXED with a zero address 2025-12-09 23:09:19 +01:00
Jeremy Soller 91ba44e2fa Implement F_DUPFD_CLOEXEC 2025-11-17 17:40:39 -07:00
Jeremy Soller c3437ab6eb Ignore any opens with event: or time: 2025-11-06 09:15:52 -07:00
Speedy_Lex 0931a7f49f Resolve a huge portion of the clippy lints 2025-10-06 06:30:23 -06:00
Jeremy Soller 5dc6f7c3ba lock ordering 2025-09-22 07:48:48 -06:00
bjorn3 5a6117b5ae Replace the log crate with a custom logging system
This avoids the need to explicitly set a logger early during boot, which
reduces the amount of moving parts that could go wrong slightly. And it
cuts the kernel image size by 13kb.
2025-09-13 18:55:16 +02:00
Jeremy Soller 8a2aa411e2 Explicitly scope all locks, fixing multi_core hangs. Allow contexts on any CPU 2025-09-13 10:10:07 -06:00
Wildan Mubarok 1ff46c8482 Fix Linter CI 2025-08-04 06:34:31 -06:00
Ibuki Omatsu e3d8ae1b79 feat: Introduce FdTbl and make Context.files use it for separate file tables. 2025-07-30 15:33:06 -06:00
Darley Barreto 66ea2b46ee Adding openat syscall 2025-07-13 06:43:20 -06:00