24b886b0d1
kernel: Log each thread's instruction pointer when dumping scheduler stats
2024-12-11 19:18:25 +01:00
d8e4489079
kernel: Make Thread::ip() and sp() const-friendly
2024-12-11 19:17:04 +01:00
2868fd8122
kernel: Add a way to lookup specific threads
2024-12-11 19:16:45 +01:00
56a2b607b5
kernel: Fix some debug-only log strings after the process rework
2024-12-11 19:16:22 +01:00
d05d6fad0b
kernel: Interrupt waitpid (even when SIGCHLD is pending) when other signals are also pending
...
Build and test / build (push) Successful in 1m36s
This fixes init not receiving the kill signal when running tests.
2024-12-07 13:15:58 +01:00
42afef5ccb
kernel: Leave reaping to the reap thread
...
Build and test / build (push) Has been cancelled
This seems to fix previous problems. Apparently reaping a thread somewhat corrupts/replaces the calling thread's address space.
I should've known there's a reason we do it in a separate kernel thread...
2024-12-07 13:05:38 +01:00
dc766e1da7
kernel: Rework VFS access checking + add processes
...
Build and test / build (push) Has been cancelled
VFS functions now accept a single Process* pointer instead of credentials and groups.
There is now a distinction between processes and threads
Now to fix all the bugs... waitpid crashes the process with an NX error...
2024-12-06 21:35:59 +01:00
7761a8a41f
kernel+launch: Always send SIGCHLD when a child exits
...
Build and test / build (push) Successful in 1m44s
POSIX says so. I thought it was only when the parent wasn't actively waiting, to signal it, but it turns out it's always sent.
2024-12-04 22:44:16 +01:00
3032415bc0
kernel: Move "push_mem_on_stack" and "pop_mem_from_stack" to MemoryManager
Build and test / build (push) Successful in 1m52s
2024-11-23 20:03:04 +01:00
7b2977a036
kernel: Use a mutex to allocate new posix timers for a thread
2024-11-23 20:02:34 +01:00
2ce2d57eff
kernel: Prevent kernel threads from calling exit_and_signal_parent()
...
Build and test / build (push) Successful in 1m53s
Kernel threads are supposed to use kernel_exit() instead, so it makes no sense to have an extra branch for them.
2024-06-23 22:53:30 +02:00
907049c405
kernel: Signal the reap thread when a kernel thread exits via exit_and_signal_parent()
...
Build and test / build (push) Successful in 1m54s
This shouldn't happen, but just in case.
2024-05-02 10:58:34 +02:00
ab70a72434
kernel: Fix extra qualification in Thread.h
...
Build and test / build (push) Failing after 12m15s
Forgot to build after writing the previous commit, but CI caught it anyway.
2024-05-01 10:54:59 +02:00
1d0f18cab9
kernel: Move stack checking and expansion into an architecture-independent file
Build and test / build (push) Failing after 1m45s
2024-05-01 10:52:08 +02:00
de6f5c38d8
kernel: Try to grow the stack on stack overflows, up to a maximum of 8MB
...
Build and test / build (push) Successful in 1m49s
This helps keep GCC happy when compiling slightly complex programs :)
2024-04-28 16:27:18 +02:00
fd402083d7
kernel: Fix kernel panic when adding a timer before another one
...
This was caused because add_to_timer_queue() did not set active_clock when inserting a timer before the end, making disarm() a no-op.
Therefore, the clock would continue to use the timer after it had been freed.
2024-01-06 18:12:25 +01:00
41c90aa436
kernel: Add POSIX timer support
2024-01-05 22:12:58 +01:00
2a85a7473a
kernel: Show stacktraces on all signal terminations
2024-01-04 21:04:24 +01:00
1208d94b37
kernel: Add stack diagnostics to userspace fault reporting
2024-01-04 11:14:19 +01:00
b619f717c8
kernel+libc: Implement pause() and sigsuspend()
continuous-integration/drone/push Build is passing
2023-12-04 20:26:01 +01:00
3ad23eab21
kernel: Add support for supplementary groups (1/2)
...
Adds support for supplementary groups internally in the kernel.
No userspace support.
2023-11-22 18:49:40 +01:00
d1d53c6891
kernel: Remove signal debug messages
2023-11-16 22:02:17 +01:00
678121c3ed
kernel+libc: Add setitimer()
continuous-integration/drone/push Build is passing
2023-11-16 21:48:18 +01:00
c4d2847da1
kernel: Rework the entire time system to use modular clocks
continuous-integration/drone/push Build is passing
2023-11-15 23:50:04 +01:00
e28e1c682c
kernel: Tweak some timer code
continuous-integration/drone/push Build is passing
2023-11-04 10:47:41 +01:00
dfebdce689
kernel: Add a timer queue with more versatility than simple alarm()
continuous-integration/drone/push Build is passing
2023-11-03 19:53:34 +01:00
e1d5b7e7b4
kernel: Implement thread stopping and continuing
continuous-integration/drone/push Build is failing
2023-10-28 15:15:32 +02:00
b3cbbea9d6
kernel: Move file descriptors into their own separate file
2023-10-23 20:13:11 +02:00
c323a812a5
kernel+libc+terminal+wind: Add support for POSIX sessions
...
continuous-integration/drone/push Build is passing
Fixes #42 .
2023-10-14 20:41:34 +02:00
5f0830cd41
kernel: Add /dev/tty
continuous-integration/drone/push Build is passing
2023-10-14 19:00:10 +02:00
eeb69c923c
kernel: Rename Scheduler::new_userspace_thread to clarify that it's only meant for init
continuous-integration/drone/push Build is passing
2023-09-25 19:34:02 +02:00
441e04076a
kernel: Do not allow sending signals to dying threads
...
This was causing a kernel panic when closing the terminal by directly exiting the shell (either EOF or the exit command)
2023-09-22 22:40:24 +02:00
d93e9f6b4b
kernel: Fix sending signals to threads that are in a long syscall
2023-09-20 07:06:00 +02:00
1528c772fd
kernel: Store the full command line of a process
2023-09-04 11:43:11 +02:00
a35ca0b367
libluna+kernel: Add Bitset and use it for signals
continuous-integration/drone/push Build is passing
2023-08-23 10:51:02 +02:00
d144a818d8
kernel: Completely prevent sending signals to kernel threads
continuous-integration/drone/push Build is passing
2023-08-22 15:25:05 +02:00
2abb43d709
kernel+libos: Call Vector::try_reserve where it is appropriate
continuous-integration/drone/push Build is failing
2023-08-22 11:54:00 +02:00
4a654bf093
kernel: Handle OOMs better and without deadlocking
...
Use a separate task to do it.
Also fix a bug where the init thread would get no kernel stack ever since 5f698b477
.
2023-08-17 20:14:33 +02:00
b8f81502b8
kernel: Fix some debug messages that are not shown by default
2023-08-16 09:03:25 +02:00
e2a77bb3da
kernel+libc: Add pledge support
continuous-integration/drone/push Build is failing
2023-08-12 21:38:25 +02:00
52064e0317
libc+kernel: Add alarm() and getpagesize()
2023-08-11 18:09:12 +02:00
826be882a9
kernel: Interrupt syscalls before exiting because of a signal
...
Closes #40 .
2023-08-08 10:41:46 +02:00
bc20e1a31b
kernel: Store FD_CLOEXEC in the file descriptor itself
...
continuous-integration/drone/push Build is passing
Closes #39 .
2023-08-03 17:47:18 +02:00
2572695c8d
kernel: Support mapping shared memory using mmap()
2023-08-02 22:20:05 +02:00
4c87d72b44
kernel/binfmt: Add documentation + support script interpreters being scripts themselves
continuous-integration/drone/push Build is passing
2023-07-31 20:41:18 +02:00
1c76675e40
kernel: Add a framework to add more executable formats, possibly from userspace
...
This lets us implement shebangs and possibly an interface similar to Linux's binfmt_misc.
2023-07-30 18:25:44 +02:00
0c873923e8
kernel: Make OpenFileDescription shareable
continuous-integration/drone/pr Build is passing
2023-07-30 11:33:46 +02:00
fb08594a18
kernel: Separate FileDescriptors and OpenFileDescription
...
Also, add a did_close() callback for OpenFileDescriptions losing all their references.
2023-07-30 11:33:06 +02:00
28cc4b2306
kernel: Add default action for SIGWINCH
continuous-integration/drone/push Build is passing
2023-07-27 14:00:30 +02:00
11df5a2ec3
kernel: Use pid_t internally for process IDs
...
continuous-integration/drone/push Build is passing
This removes a bunch of casts between pid_t and u64, and makes more sense since pid_t is literally the data type for process IDs.
2023-07-26 21:32:00 +02:00