Bananymous
797ca65c66
Kernel: Add physical memory info to /proc/{pid}/meminfo
2023-09-30 22:11:45 +03:00
Bananymous
f88ad7efcd
Kernel: All process' memory areas can report their virtual mem usage
2023-09-30 21:15:46 +03:00
Bananymous
b51d2f5295
Kernel: mmap regions are now demand paged
...
mmap will not actually take any memory unless you use the given
memory.
2023-09-28 21:07:14 +03:00
Bananymous
fcdc922343
Kernel: Enter ACPI mode with lai
2023-09-28 12:30:27 +03:00
Bananymous
fe2dca16f0
Kernel/LibC: add flag to enable/disable sse support
...
SSE support is very experimental and causes GP. I decided to make
SSE not default until I get to fixing it :)
2023-09-23 02:28:25 +03:00
Bananymous
720bc418a6
All: Clear lines with only whitspace in them
2023-09-10 00:31:42 +03:00
Bananymous
a7f37236bf
Kernel: Zero initialize threads sse_storage
2023-08-11 00:26:43 +03:00
Bananymous
217dbca7b7
Kernel: Cleanup returns from any kind on interrupts
2023-08-01 14:23:50 +03:00
Bananymous
8b1bccb79b
Kernel: store/load sse/mmx/fpu state on isr/irq/syscall
...
I haven't tested this yet but should be fine. This will be optimized
to only save state from threads that are using it
2023-07-31 22:28:57 +03:00
Bananymous
6f7d97cf94
Kernel: Remove is_in_syscall from Thread
2023-07-30 14:49:51 +03:00
Bananymous
879706e6e9
Kernel: Signals are not queued anymore
...
Posix doesn't require signal queing if you don't use sigqueue() which
we don't support. Process also has its own pending signal mask.
2023-07-29 16:54:31 +03:00
Bananymous
22cd9af8cc
Kernel: Restructure process and thread termination
...
When we want to kill a process, we mark its threads as Terminating
or Terminated. If the thread is in critical section that has to be
finished, it will be in Terminating state until done. Once Scheduler
is trying to execute Terminated thread it will instead delete it.
Once processes last thread is marked Terminated, the processes will
turn it into a cleanup thread, that will allow blocks and memory
cleanup to be done.
2023-07-28 18:06:20 +03:00
Bananymous
522aa8e762
Kernel: add Thread::queue_signal()
2023-07-24 22:26:10 +03:00
Bananymous
f7bf6d5e62
Kernel: Change signal kernel API
...
return rsp and rip are now stored per thread
2023-07-23 18:33:10 +03:00
Bananymous
adb14ba373
Kernel: Userspace signal handlers are now called one at a time
...
I added a syscall for telling the kernel when signal execution has
finished. We should send a random hash or id to the signal trampoline
that we would include in the syscall, so validity of signal exit can
be confirmed.
2023-07-23 13:34:53 +03:00
Bananymous
2149cec29f
Kernel: Make signals more POSIX
2023-07-21 20:01:12 +03:00
Bananymous
b56316e9da
Kernel: Scheduler now sends queued signals
2023-07-21 19:27:10 +03:00
Bananymous
a989c44211
Kernel: Make signals thread specific
2023-07-21 19:00:59 +03:00
Bananymous
c0c0bbc1bf
Kernel: SYS_FORK can now fail instead of panicing on error
2023-07-19 17:47:12 +03:00
Bananymous
4da1d6fd27
Kernel: Implement Process::exec()
2023-05-31 20:56:29 +03:00
Bananymous
909e847369
Kernel: Move userspace entry functions to Process instead of Thread
2023-05-31 19:31:10 +03:00
Bananymous
0202ccec5f
Kernel: ISR will now crash userspace process instead of panicing kernel
2023-05-28 20:53:10 +03:00
Bananymous
6fdbe6f9c2
Kernel: Add bareboness fork() function
2023-05-28 18:08:49 +03:00
Bananymous
0129619d9a
Kernel: Processes and Threads use VirtualRange memory allocations
2023-05-28 17:48:34 +03:00
Bananymous
b847d7dfd5
Kernel: MMU::get() is now MMU::kernel
...
MMU is can now be locked with RecursiveSpinLock.
Scheduler now has get_current_tid() that works before the Scheduler
is initialized. This allows RecursiveSpinLock usage early on.
2023-05-28 16:18:18 +03:00
Bananymous
f33e78882e
Kernel: Add argc and argv to process entry
2023-05-16 00:27:49 +03:00
Bananymous
58ce907327
Kernel: Usespace threads now have an interrupt stack
2023-04-25 14:49:18 +03:00
Bananymous
bd95f17426
Kernel: Stack pointer out of bounds now panics with a message
2023-04-25 13:40:55 +03:00
Bananymous
1406a75a92
Kernel: Cleanup process creation for userspace
2023-04-22 16:51:50 +03:00
Bananymous
be14a6c239
Kernel: Stack pointer is validated when updated
...
This allows us not to fail stack pointer when in syscall since
interrupts use their own stack
2023-04-21 10:40:24 +03:00
Bananymous
3aa0eeb4a3
Kernel: Add barebones per process virtual addresses
...
We now assign every (userspace) process its own MMU which we load
in scheduler. This allows every process to have separate virtual
address space.
This is very hackish implementations but it works for now
2023-04-20 00:45:41 +03:00
Bananymous
7bd4593748
Kernel: Process is not reference counted any more
...
This was not necessary and it made things needlessly complicated
2023-04-19 00:34:18 +03:00
Bananymous
8637959289
Kernel: We can create basic userspace processes
...
These are still allocated on the kernel memory
2023-04-12 17:52:36 +03:00
Bananymous
12779cdef8
Kernel: Threads now use only 4 KiB stack :)
2023-04-12 00:22:08 +03:00
Bananymous
2fabe1949c
BAN: Move RefPtr to its own file and create New.h
...
New.h contains definitions for placement new operators and
BAN::allocator and BAN::dealloctor
2023-04-10 21:07:25 +03:00
Bananymous
e704968f96
Kernel: Threads can now be terminated mid execution
2023-04-10 21:07:25 +03:00
Bananymous
79090c2648
Kernel: cleanup includes
...
I went quickly went through all files since I found some weird
includes :D
2023-04-01 02:14:49 +03:00
Bananymous
88ee35165f
Kernel: Thread is no longer RefCounted
...
This makes developement with Scheduler much easier against compiler
optimizations. I could now remove the pragma GCC optimize stuff.
2023-03-30 19:16:51 +03:00
Bananymous
1b7625581d
Kernel: Add basic concept of Processes
...
We now create Shell as a process that has its own threads
2023-03-16 12:17:04 +02:00
Bananymous
af854ec9e1
Kernel: Thread creation now takes void(*)() as entry and void* as data
...
This simplifies threading for the future and gets rid of (undefined?)
cast of member function pointer to address
2023-03-09 15:33:42 +02:00
Bananymous
23b3028e15
Kernel: Rename RefCounted -> RefPtr and implement RefCounted
2023-03-08 03:26:25 +02:00
Bananymous
b8ee77eb78
Kernel: Initial work on new scheduler with queues
...
Sleeping is definately broken
2023-03-08 02:41:44 +02:00
Bananymous
1dd61e93b6
Kernel: Threads cannot take arguments anymore
2023-03-02 01:56:09 +02:00
Bananymous
1bd8b0fe5c
Kernel: Sleep now actually sleeps and allows idling
2023-02-19 18:52:25 +02:00
Bananymous
5b5e620d8a
Kernel: Improve multithreading support
...
We can now use arbitary BAN::function<void(...)> as the Thread.
I also implemented multithreading for i386 since it was not done
on the initial multithreading commit.
2023-02-02 23:24:12 +02:00
Bananymous
6a9d60a8fb
Kernel: Implement somewhat functioning multithread support
...
This still uses only a single cpu, but we can now have 'parallelization'
This seems to work fine in qemu and bochs, but my own computer did not
like this when I last tried.
I have absolutely no idea how multithreading should actually be
implmemented and I just thought and implemented the most simple one I
could think of. This might not be in any way correct :D
2023-02-01 01:53:35 +02:00