From 499784a824c541001c2fd52ae95eba88dcfc952b Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sat, 21 Dec 2019 22:22:03 +0100 Subject: Many debugging/serial improvements Sorry for the little information, but I did many things :) --- src/kernel/syscall/actions/sys_paging_alloc.c | 1 - src/kernel/syscall/actions/sys_read.c | 1 - src/kernel/syscall/actions/sys_write.c | 2 -- src/kernel/syscall/syscall.c | 7 ++++--- 4 files changed, 4 insertions(+), 7 deletions(-) (limited to 'src/kernel/syscall') diff --git a/src/kernel/syscall/actions/sys_paging_alloc.c b/src/kernel/syscall/actions/sys_paging_alloc.c index fb4e415..57ffd39 100644 --- a/src/kernel/syscall/actions/sys_paging_alloc.c +++ b/src/kernel/syscall/actions/sys_paging_alloc.c @@ -1,6 +1,5 @@ #include #include -#include uint32_t sys_paging_alloc(uint32_t count) { diff --git a/src/kernel/syscall/actions/sys_read.c b/src/kernel/syscall/actions/sys_read.c index 83e645c..ed2cca8 100644 --- a/src/kernel/syscall/actions/sys_read.c +++ b/src/kernel/syscall/actions/sys_read.c @@ -3,7 +3,6 @@ #include #include #include -#include uint32_t sys_read(char *buf) { diff --git a/src/kernel/syscall/actions/sys_write.c b/src/kernel/syscall/actions/sys_write.c index d395384..76d88b8 100644 --- a/src/kernel/syscall/actions/sys_write.c +++ b/src/kernel/syscall/actions/sys_write.c @@ -1,7 +1,6 @@ #include #include #include -#include uint32_t sys_write(char *buf) { @@ -11,7 +10,6 @@ uint32_t sys_write(char *buf) uint32_t sys_writec(char ch) { - serial_write_hex(ch); writec((char) ch); return 0; } \ No newline at end of file diff --git a/src/kernel/syscall/syscall.c b/src/kernel/syscall/syscall.c index 7d5420d..5f32c42 100644 --- a/src/kernel/syscall/syscall.c +++ b/src/kernel/syscall/syscall.c @@ -1,9 +1,8 @@ #include #include #include -#include -#include #include +#include typedef uint32_t (*syscall_func)(unsigned int, ...); @@ -20,7 +19,7 @@ uint32_t (*syscalls[])() = { void syscall_handler(struct regs *r) { - serial_write("Received syscall!\n"); + serial_printf("Received syscall!"); if (r->eax >= sizeof(syscalls) / sizeof(*syscalls)) return; @@ -29,6 +28,8 @@ void syscall_handler(struct regs *r) if (!location) return; + //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); } -- cgit v1.2.3