diff options
author | Marvin Borner | 2020-01-16 17:15:53 +0100 |
---|---|---|
committer | Marvin Borner | 2020-01-16 17:15:53 +0100 |
commit | cd3ad989210dc8a3f5805dd5d4c4a6bd74e281db (patch) | |
tree | 015fa67057b1ca14a86a8faf4d1cabb0356467b2 /src/kernel/syscall/syscall.c | |
parent | 602b98247e9c87e38870e39abf1d8b13aeae5d0f (diff) |
Quite a different approach to userspace paging
Hope this works soon!
Diffstat (limited to 'src/kernel/syscall/syscall.c')
-rw-r--r-- | src/kernel/syscall/syscall.c | 5 |
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() |