51532336b0
Kernel: Move structures in boot.S to .data section
2023-08-11 00:26:12 +03:00
fd2bcc9156
Kernel: IDT now sends EOI for every interrupt
...
EOI is sent before calling the interrupt handler. This should be fine
since all interrupts are processed with interrupts disabled
2023-08-09 09:57:02 +03:00
008c777a9f
Kernel: Add PageTable::Flags::CacheDisable
...
Also fix multiple places where we were using uint8_t as page table
flags instead of PageTable::flags_t which we promoted to uint16_t
while back.
2023-08-06 23:59:30 +03:00
198e6d7cf6
Kernel: Start work on abstracting Timers
2023-08-04 10:29:42 +03:00
e57c1fc9fc
Kernel: Threads are deleted sooner and cleaner
...
We now delete threads when
1. it is marked as Terminated and is the current thread
2. it tries to start execution in Terminated state
This allows us to never have thread executing in Terminated state
2023-08-04 10:29:42 +03:00
a11b5ae41f
Kernel: align userspace stacks
...
I was getting #GP on sse instructions
2023-08-03 18:09:48 +03:00
91f04ce250
Kernel: Change PageTable API
...
Getting free pages not reserves them, so you don't have to hold
the page table lock :)
2023-08-02 22:09:14 +03:00
926df2b276
Kernel: PageTable now supports reserved pages
...
You can now map pages as reserved, so that they will not be given
from get_free_page() or get_free_contiguous_pages().
2023-08-01 16:35:54 +03:00
217dbca7b7
Kernel: Cleanup returns from any kind on interrupts
2023-08-01 14:23:50 +03:00
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
e86e755c51
Kernel: Generally improve signals
2023-07-31 22:28:18 +03:00
08cdf88586
Kernel: Cleanup signal trampoline
2023-07-30 15:58:35 +03:00
6f7d97cf94
Kernel: Remove is_in_syscall from Thread
2023-07-30 14:49:51 +03:00
5e434f5131
Kernel: Hardware exceptions now sends signals to userspace
2023-07-30 14:34:15 +03:00
f7bf6d5e62
Kernel: Change signal kernel API
...
return rsp and rip are now stored per thread
2023-07-23 18:33:10 +03:00
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
217e5f81cc
Kernel: add default signal actions
2023-07-21 18:02:35 +03:00
dcd4d0daeb
Kernel/LibC: Add bareboness signals
...
You can now call raise() to raise a signal. Signal handlers are
not yet supported, but the handling works :)
2023-07-21 15:45:02 +03:00
faf4220b38
Kernel: kernel memory takes now full pml4e
...
This allows flags to work properly
2023-07-21 13:47:05 +03:00
193ddaa2f6
Kernel: remove PAGE_FLAGS_MASK as that was not correct anymore
...
After I added NXE bit, the flags mask is no longer valid
2023-07-21 12:01:50 +03:00
46eb27883a
Kernel: Don't map kernel executable memory as writable
2023-07-21 11:17:39 +03:00
2db7cdb71e
Kernel: Syscalls now get the interrupt stack
2023-07-21 11:04:16 +03:00
ba9fa00947
Kernel: fix memory leak in PageTable
...
PageTable used to leak 2 pages on creation and other two on deletion
2023-07-19 23:17:39 +03:00
6c1ada8d0a
Kernel: Enable global bit on kernel pages
2023-07-13 15:23:25 +03:00
7d00c2670f
Kernel: Support execute disable bit
...
We will now map executable memory explicitly as executable.
2023-07-13 14:28:53 +03:00
86df258365
Kernel: rework the whole PageTable structure
...
We now have page table structure for kernel memory which is shared
between all processes.
2023-07-05 23:41:35 +03:00
5e123031aa
Kernel: kmalloc has now somewhat dynamic storage
...
Allocations bigger than PAGE_SIZE and those not forced to be identity
mapped are now done on a GeneralAllocator. This allows us to use kmalloc
for big allocations; bigger than the fixed 1 MiB storage.
This is still a hack and the whole kmalloc will have to be rewritten at
some point, but for now this does the job :D
2023-06-18 23:27:00 +03:00
d354cccd37
Kernel: Add enum for ISR name to number
2023-06-18 23:24:27 +03:00
bf617036c7
Kernel: Rework syscall calling
...
I removed the intermediate function when calling syscalls. Now syscall
handler calls the current process automatically. Only exception is
sys_fork, since it needs a assembly trampoline for the new thread.
2023-06-12 14:16:48 +03:00
91f812e17f
Kernel: Exceptions will now enable interrupts before calling exit()
...
this allows scheduler verification on reschedule() not panic
2023-06-11 03:29:22 +03:00
db49cbd6e2
Kernel: We now store the processes exit code
2023-06-10 17:31:56 +03:00
2b9900e56e
Kernel: get_free_contiguous_pages works with non-page aligned addresses
...
also fix bug in ordering
2023-06-06 02:03:23 +03:00
b0e9ab0519
Kernel/LibC: pass environ pointer to process
2023-06-05 21:12:08 +03:00
8352392b38
Kernel: You can specify first vaddr for getting free pages
2023-06-04 01:15:48 +03:00
9f75d9cfe5
Kernel: PageTable now has debug_dump
...
This dumps all the mapped pages and their flags
2023-06-03 20:08:13 +03:00
a42af7e973
Kernel: boot.S is back to 2 MiB pages
...
bochs doesn't seem to support 1 GiB pages
2023-06-03 18:53:36 +03:00
eafa09fecf
Kernel: boot.S maps GiB as single pdpte
2023-05-31 00:51:15 +03:00
8175348284
Kernel: Fix comment
2023-05-31 00:51:15 +03:00
b2832cb47a
Kernel: PageTable destructor works now
...
we are successfully booting higher half kernel now :)
2023-05-31 00:44:14 +03:00
9f499991c8
Kernel: PageTable::create_userspace() now works
2023-05-31 00:44:14 +03:00
ed0dcacab3
Kernel: Move V2P and P2V to Memory/Types.h
2023-05-30 23:57:03 +03:00
e86050f343
Kernel: PageTable::map_range_at maps correctly the last page
2023-05-30 23:56:07 +03:00
57f7da6ce1
Kernel: Booting with higher half kernel gets to Heap initialization
2023-05-30 22:21:12 +03:00
93e6455171
Kernel: start work on higher half kernel
2023-05-30 08:00:17 +03:00
265fe9c62e
Kernel: We now identity map full GiB in boot.S
...
The paging structure is pre-built so no unnecessary calculations are done
2023-05-30 00:08:52 +03:00
e640344d7a
Kernel: Rename MMU to PageTable
...
This is more descriptive name for what it actually represents
2023-05-29 21:06:09 +03:00
7151bb86a8
Kernel/LibC: opening standard files is done in libc
2023-05-29 20:21:19 +03:00
3d95cf02f3
Kernel: We can't lock the MMU lock in load()
...
It needs to be callable always by scheduler
2023-05-29 19:39:35 +03:00
dd3f34cb2c
Kernel: Make RecursiveSpinLock thread safe
...
also SpinLock is now implemented with gcc builtins
2023-05-29 19:38:09 +03:00
f964f6be8d
Kernel: Move page macros to Types.h
2023-05-28 21:03:08 +03:00