aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/syscall/syscall.c
diff options
context:
space:
mode:
authorMarvin Borner2020-01-16 21:08:43 +0100
committerGitHub2020-01-16 21:08:43 +0100
commitd5d1749257ff8b9aa6b5ace4b4720b484a2860f3 (patch)
treea2cd4f1c7995e32c1c02b191324fa63f9d30655b /src/kernel/syscall/syscall.c
parent602b98247e9c87e38870e39abf1d8b13aeae5d0f (diff)
parent366119b53d5148922c5df7c7bd088ed71e95499a (diff)
Merged fancy userspace paging
Diffstat (limited to 'src/kernel/syscall/syscall.c')
-rw-r--r--src/kernel/syscall/syscall.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/kernel/syscall/syscall.c b/src/kernel/syscall/syscall.c
index 7ca7f99..93abc83 100644
--- a/src/kernel/syscall/syscall.c
+++ b/src/kernel/syscall/syscall.c
@@ -3,9 +3,12 @@
#include <kernel/interrupts/interrupts.h>
#include <kernel/system.h>
#include <kernel/lib/stdio.h>
+#include <kernel/paging/paging.h>
typedef uint32_t (*syscall_func)(unsigned int, ...);
+extern void jump_userspace();
+
uint32_t (*syscalls[])() = {
[0] = (uint32_t (*)()) halt_loop, // DEBUG!
[1] = sys_write,
@@ -19,6 +22,7 @@ uint32_t (*syscalls[])() = {
void syscall_handler(struct regs *r)
{
+ paging_switch_directory(0);
serial_printf("Received syscall!");
if (r->eax >= sizeof(syscalls) / sizeof(*syscalls))
@@ -31,6 +35,7 @@ void syscall_handler(struct regs *r)
//serial_printf("[SYSCALL] %d (0x%x) 0x%x 0x%x 0x%x 0x%x 0x%x", r->eax, location, r->ebx, r->ecx, r->edx, r->esi, r->edi);
r->eax = location(r->ebx, r->ecx, r->edx, r->esi, r->edi);
+ paging_switch_directory(1);
}
void syscalls_install()