Commit Graph

440 Commits

Author SHA1 Message Date
4lDO2 10c53aef10 Remove RtSigInfo import. 2025-04-19 16:30:48 +02:00
4lDO2 ab11e6b346 Support stopping contexts, by procmgr. 2025-04-19 16:30:47 +02:00
4lDO2 e002d0be33 Remove commented-out syscalls and SigState.rtqs 2025-04-19 16:30:47 +02:00
4lDO2 cb1a838f05 Start moving kill to procmgr. 2025-04-19 16:30:47 +02:00
4lDO2 f40ec48b3e Send event on thread death. 2025-04-19 16:30:46 +02:00
4lDO2 a78d36f7f2 Reach init in userspace. 2025-04-19 16:30:46 +02:00
4lDO2 8883818501 Make kernel compile. 2025-04-19 16:30:45 +02:00
4lDO2 1d5f8fd46d Move proc code to userspace. 2025-04-19 16:30:42 +02:00
bjorn3 f5f877ca22 Fix saving and restoring of float registers on arm64 2025-04-12 17:11:04 +02:00
Jeremy Soller a926baefaf aarch64 fp_load/fp_save do not need to be naked
There is a bug with LLVM and Rust causing naked functions to not support
target_enable directives.

https://github.com/rust-lang/rust/issues/136280
2025-04-12 08:14:38 -06:00
Vincent Berthier 2da88c18c0 Add the sys:stat scheme 2025-02-22 14:27:10 +00:00
4lDO2 ef0758b9cc Always use close message when available. 2025-02-21 16:50:16 +01:00
4lDO2 7295777985 Add one-way close message for schemes. 2025-02-21 15:56:05 +01:00
Jeremy Soller 668a123b9a Switch to naked_asm 2025-01-14 15:59:07 -07:00
Anhad Singh af36ae12b0 fix(mremap): fix referencing
Before it was first add_ref'ed by `borrow_frame_enforce_rw_allocated`,
manually and then by `allocated_shared_one_page`.

Now it is only done by `borrow_frame_enforce_rw_allocated` and does not
get unref-ed as take() is called on the returned `RaiiFrame`.

Now the page is manually mapped and an `Allocated` type grant is
constructed (synonymous to `MAP_PRIVATE`). Before by using `allocated_shared_one_page`
an `AllocatedShared` provided grant was constructed (synonymous to
`MAP_SHARED`), which was wrong as the TCB would've not got CoW-ed
after fork(), making the Tcb malformed.

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2024-12-11 16:37:01 +11:00
Arthur Paulino e19c1404f7 chore: enrich context/switch
* Add documentation and more code comments to `src/context/switch.rs`
* Eliminate a `context.wake.expect(...)` where `context.wake.is_some()`
* Eliminate a TODO item about updating contexts' timestamps in `switch_to`
* Eliminate a dangling `else { continue }` at the end of the loop that iterates
  on contexts
2024-10-31 10:22:21 +00:00
Andrey Turkin cba02a26fa Rework irqchip to support risc-v irqs, and add risc-v irq chips handling 2024-10-22 19:16:21 +03:00
Andrey Turkin 1921c6814b Initial RISC-V implementation
Has no IRQ handling yet
2024-10-20 16:24:21 +03:00
Andrey Turkin db32f5f7a3 Move some conditionally compiled code from common files into arch-gated files 2024-10-19 21:59:14 +03: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
James 3fbd52a212 Made a change in context to the way arrays are resized. Slight change to the logic but resize_with should be slightly more efficient 2024-10-15 21:24:32 +11:00
IncompententPirate fc5d246b30 remove wrapper functions 2024-09-26 22:34:55 +00:00
Andrey Turkin 755694494b Factor KernelMapper out of arch
Same implementation on all the platforms. Also remove mutable Deref as it allowed circumventing RO check
2024-09-25 21:51:39 +03:00
4lDO2 539dc5a24e Remove SYS_UMASK. 2024-09-25 19:55:39 +02:00
4lDO2 7def7ce6e3 Extend size of sig{en,de}queue payload. 2024-09-24 19:18:22 +02:00
4lDO2 54b1fbe453 Implement queued signals.
This currently needs to be done in the kernel for synchronization
reasons, but it's possible all delivery parts can later be moved to
userspace.
2024-09-24 19:18:22 +02:00
4lDO2 6d9cf30445 WIP: realtime signals 2024-09-24 19:18:20 +02:00
Jeremy Soller 1c00450127 Use 64-bit versions of xsave and xrstor 2024-09-04 21:22:10 -06:00
Andrey Turkin d2ebc7ff05 Wholesale fix of warnings
Pretty straightforward changes. This commit tries to avoid making any non-trivial fixes.
2024-09-04 10:55:01 +03:00
4lDO2 4158d899b5 Probably fix TLB shootdown "diagonal" livelock.
Diagonal as in

Thread A        Thread B
Send to B       Send to A
Wait for B      Wait for A.

I haven't reproduced this bug, but this should fix it, since the wait
steps now checks the local percpu block for pending TLB shootdowns onto
itself.
2024-07-24 22:48:56 +02:00
4lDO2 49b94047a8 Fix significant memory leak. 2024-07-24 22:48:56 +02:00
4lDO2 005635083d Fix thread cleanup during active file ops.
This fixes a bug where the window of `viewer` does not exit, due to a
leaked file descriptor.
2024-07-20 22:14:54 +02:00
4lDO2 c54195f10d Ensure process signals can also interrupt. 2024-07-17 17:31:05 +02:00
4lDO2 3c540efb00 Support sending signals to individual threads. 2024-07-16 22:06:21 +02:00
4lDO2 cc465c008b Remove rustc hack. 2024-07-16 19:52:18 +02:00
4lDO2 6bd01513c5 Simplify and improve thread/process cleanup. 2024-07-15 18:08:43 +02:00
4lDO2 a3dedb0639 Do proper resource cleanup for thread exit too. 2024-07-15 18:08:43 +02:00
4lDO2 e67c040f69 WIP: Separate process status from context status. 2024-07-15 18:08:43 +02:00
4lDO2 7fbe5c72e9 Use strong references in context set. 2024-07-15 18:08:42 +02:00
4lDO2 80fe891c6e WIP: Replace ContextId with direct Arcs. 2024-07-15 18:08:42 +02:00
4lDO2 208d74899a Fix fork & process creation, now boots to desktop. 2024-07-15 18:08:42 +02:00
4lDO2 89d532a267 Fix half of proc scheme errors. 2024-07-15 18:08:42 +02:00
4lDO2 89d1d49a4e Fix most code except proc scheme. 2024-07-15 18:08:41 +02:00
4lDO2 8f452b0b0f WIP: continue the process transition 2024-07-15 18:08:41 +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 5e7db80285 Fix a bunch of warnings. 2024-07-15 17:48:45 +02:00
4lDO2 d70ad544e6 Fix SIGKILL and allow SYS_EXIT to pass 16 bits. 2024-07-15 17:20:57 +02:00
4lDO2 ae8e13525f Remove is_pending flag, read word directly instead. 2024-07-15 17:20:57 +02:00
4lDO2 e8060b259d Only save ip and 'archdep' regs when signalling. 2024-07-15 17:20:56 +02:00