diff options
author | Marvin Borner | 2020-04-29 15:26:21 +0200 |
---|---|---|
committer | Marvin Borner | 2020-04-29 15:26:21 +0200 |
commit | 396d7d303d3bf0e796d0c817883ec1dec928352a (patch) | |
tree | 69d79c31ca94da7aa3089709be08f1d959023472 /src/kernel/syscall | |
parent | 4f3c75d23188bd480739d6d1514543c95cfe3399 (diff) |
Some work on the libgui
Diffstat (limited to 'src/kernel/syscall')
-rw-r--r-- | src/kernel/syscall/actions/sys_pointers.c | 17 | ||||
-rw-r--r-- | src/kernel/syscall/syscall.c | 7 |
2 files changed, 18 insertions, 6 deletions
diff --git a/src/kernel/syscall/actions/sys_pointers.c b/src/kernel/syscall/actions/sys_pointers.c index 1a2d8f7..ced95de 100644 --- a/src/kernel/syscall/actions/sys_pointers.c +++ b/src/kernel/syscall/actions/sys_pointers.c @@ -2,16 +2,27 @@ #include <kernel/graphics/vesa.h> #include <kernel/fs/load.h> #include <kernel/memory/alloc.h> +#include <kernel/memory/paging.h> +#include <kernel/tasks/process.h> struct pointers { - uint8_t *fb; + struct vbe_mode_info *current_mode_info; struct font *font; }; uint32_t sys_pointers() { - struct pointers *pointers = kmalloc(sizeof(struct pointers)); - pointers->fb = fb; + struct vbe_mode_info *ret = (struct vbe_mode_info *)umalloc(sizeof(struct vbe_mode_info)); + ret->attributes = current_mode_info->attributes; + ret->pitch = current_mode_info->pitch; + ret->width = current_mode_info->width; + ret->height = current_mode_info->height; + ret->bpp = current_mode_info->bpp; + ret->memory_model = current_mode_info->memory_model; + ret->framebuffer = current_mode_info->framebuffer; + + struct pointers *pointers = umalloc(sizeof(struct pointers)); + pointers->current_mode_info = ret; pointers->font = font; return pointers; diff --git a/src/kernel/syscall/syscall.c b/src/kernel/syscall/syscall.c index af59499..dec3d38 100644 --- a/src/kernel/syscall/syscall.c +++ b/src/kernel/syscall/syscall.c @@ -4,6 +4,7 @@ #include <kernel/system.h> #include <kernel/lib/stdio.h> #include <kernel/io/io.h> +#include <kernel/tasks/process.h> typedef uint32_t (*syscall_func)(uint32_t, ...); @@ -18,7 +19,6 @@ uint32_t (*syscalls[])() = { [0] = (uint32_t(*)())halt_loop, // DEBUG! void syscall_handler(struct regs *r) { cli(); - log("Received syscall!"); if (r->eax >= sizeof(syscalls) / sizeof(*syscalls)) return; @@ -27,10 +27,11 @@ void syscall_handler(struct regs *r) if (!location) return; - log("[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); + log("[SYSCALL] %s called %d with 0x%x 0x%x 0x%x 0x%x 0x%x", current_proc->name, 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); + sti(); } |