Commit Graph

66 Commits

Author SHA1 Message Date
Speedy_Lex ee1260363c Fix many clippy lints 2026-04-08 19:40:41 +01:00
bjorn3 b805336cfc Fix a bunch of warnings 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 3161a44c25 Solve borrow rules for memory.rs 2026-04-01 08:42:18 -06:00
Wildan M ca2a7048d0 Move spin loop hint to crate lock 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
Wildan M 6e0143cf0d Store context to per cpu 2026-03-31 15:29:47 +07:00
bjorn3 f8d93023dd Fix a couple of warnings 2026-03-28 17:07:33 +01:00
Ron Williams fde164b2a0 Revert "Deficit based Weighted Round Robin Scheduler"
This reverts commit b7dabfc3c2.
2026-03-22 18:44:41 +00:00
Akshit Gaur b7dabfc3c2 Deficit based Weighted Round Robin Scheduler 2026-03-22 07:00:31 -06:00
Wildan M 44b6a58032 Add more context to deadlock debug messages 2026-03-14 08:49:40 -06:00
Wildan M 84754dfc5d Solve borrow checking by downgrading waitqueue lock 2026-03-11 09:42:06 +07:00
Wildan M f07725682f Add ordered lock for WaitQueue mutex without solving borrow check 2026-03-11 09:24:45 +07:00
Wildan M 60573e24f3 Solve borrow checking by downgrading condition.wait lock 2026-03-11 09:07:52 +07:00
Wildan M 7ebb5f2a3d Solve borrow checking by downgrading locks 2026-03-11 08:00:48 +07:00
Wildan M 44f2214971 Partially solve borrow checking with WaitQueue 2026-03-11 07:27:21 +07:00
Wildan M eeb03bdcb1 Revert "Add ordered lock for WaitQueue mutex"
This reverts commit 735c68ec30.
2026-03-10 12:11:09 +07:00
Wildan M 7fa253cf6a Add deadlock detection 2026-03-09 16:32:11 +07:00
Wildan M 8412321568 Add lock token to FdTbl without borrow check 2026-03-09 13:12:19 +07:00
Wildan M f40b84a5cc Add lock token to FileDescription, without borrow check 2026-03-09 11:23:51 +07:00
bjorn3 6085c8935c Remove unused WaitQueue::receive method 2026-03-07 21:44:29 +01:00
auronandace f7b0f5ec37 eliminate an unwrap in gdt for x86_shared 2026-03-02 10:56:28 +00:00
Wildan M 437f762339 Prevent drop on WaitCondition 2026-02-27 12:34:13 +07:00
Wildan M 3c2b1a11c5 Add ordered lock for time offset mutex 2026-02-25 11:42:17 +07:00
Wildan M 735c68ec30 Add ordered lock for WaitQueue mutex 2026-02-25 09:48:13 +07:00
auronandace 8138826200 avoid direct indexing in wait_condition 2026-02-23 06:34:20 -07:00
Ibuki Omatsu 5ac00f5533 Remove namespace management from the kernel. 2026-01-20 20:43:34 -07:00
Pascal Reich a919d2626b Inline Documentation Fixes 2026-01-10 16:19:34 -07:00
Anhad Singh d9eae6bb75 fix(sync/wait_condition): deadlock in WaitCondition::wait
Instead of using a simple switch to determine if preemption is enabled
(`is_preemptable: bool`), a counter is used instead. This handles the
case where a function holding a `PreemptGuard` calls another function
that creates a new `PreemptGuard`.

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2025-12-15 13:05:29 +11:00
Anhad Singh 4ff82ad8b5 fix(scheme/user): deadlocks inside call_extended_inner
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2025-11-27 14:39:14 +11:00
bjorn3 4b89feab41 Fix a couple of dead code warnings 2025-10-26 12:07:56 +01: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 cea93f7647 cargo fix --edition & rustfmt
Or to be precise:
RUST_TARGET_PATH=$(pwd)/targets cargo fix --edition \
--target targets/x86_64-unknown-kernel.json \
--target targets/i686-unknown-kernel.json \
--target targets/aarch64-unknown-kernel.json \
--target targets/riscv64-unknown-kernel.json \
-Zbuild-std=core,alloc --allow-dirty --bin kernel
cargo fmt
2025-09-10 16:44:36 +02:00
4lDO2 10ef631fc3 Remove WaitMap from existence. 2025-04-19 16:30:48 +02:00
Andrey Turkin 55041e2eeb Use a custom config flag to conditionally compile DTB-specific areas
Would be great if we could use a feature instead, but Cargo can't do target-specific defaults features
2024-10-19 21:03:43 +03:00
4lDO2 51c4be10e0 Allow waitpid to be interrupted. 2024-07-20 23:17:31 +02:00
4lDO2 c54195f10d Ensure process signals can also interrupt. 2024-07-17 17:31:05 +02:00
4lDO2 e67c040f69 WIP: Separate process status from context status. 2024-07-15 18:08:43 +02:00
4lDO2 80fe891c6e WIP: Replace ContextId with direct Arcs. 2024-07-15 18:08:42 +02:00
4lDO2 0da2fce64a Separate context and process IDs. 2024-07-15 18:08:41 +02:00
4lDO2 d94baa2712 Run rustfmt. 2024-07-15 17:50:18 +02:00
4lDO2 4dba818c83 Check pending unblocked signals before blocking.
This is not a perfect solution, since the kernel technically already has
all the information it needs to synchronize this between the kill()
invocation and the time WaitCondition::wait is called, but it should not
have any noticeable performance impact.
2024-07-15 17:20:57 +02:00
4lDO2 6aa5ed020e Add missing fevent impl for RootScheme. 2024-06-15 12:29:05 +02:00
Jacob Lorentzon bf0fc66ac1 Improved scheme protocol. 2024-06-14 11:31:51 +00:00
4lDO2 239bd317e9 Fix signal ordering wrt syscall return. 2024-03-16 17:49:31 +01:00
bjorn3 782ec87f27 Fix UB in the locking code of context switching
The spin crate considers it UB to call force_write_unlock while there is
a threads trying to obtain a read lock on the same rwlock.

This also switches to the spinning_lot crate for the context rwlock as
it has support for a write guard keeping a reference to the rwlock using
an Arc instead of a reference.
2024-02-25 17:07:41 +01:00
Jeremy Soller 45f1c4e29e Add rustfmt from relibc and apply it with cargo fmt 2024-01-17 13:52:01 -07:00
bjorn3 2d065083df Use HashMap instead of BTreeMap where possible
This shrinks the kernel from 905840 bytes to 862408 bytes.
2023-12-13 19:55:20 +01:00
bjorn3 017702d3d2 Remove a lot of dead code 2023-12-12 15:01:29 +00:00