From 5f8b5ce7efb7738eaebad43f9648975788ae19ff Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Tue, 28 Apr 2020 20:59:57 +0200 Subject: Fixed userspace entering... Many other fixes too, but I won't mention them because I don't want to :) --- src/kernel/syscall/actions/sys_alloc.c | 6 ------ src/kernel/syscall/actions/sys_free.c | 2 +- src/kernel/syscall/actions/sys_get_pointers.c | 18 ------------------ src/kernel/syscall/actions/sys_getch.c | 10 ++++++++++ src/kernel/syscall/actions/sys_malloc.c | 7 +++++++ src/kernel/syscall/actions/sys_putch.c | 9 +++++++++ src/kernel/syscall/actions/sys_read.c | 21 --------------------- src/kernel/syscall/actions/sys_write.c | 15 --------------- 8 files changed, 27 insertions(+), 61 deletions(-) delete mode 100644 src/kernel/syscall/actions/sys_alloc.c delete mode 100644 src/kernel/syscall/actions/sys_get_pointers.c create mode 100644 src/kernel/syscall/actions/sys_getch.c create mode 100644 src/kernel/syscall/actions/sys_malloc.c create mode 100644 src/kernel/syscall/actions/sys_putch.c delete mode 100644 src/kernel/syscall/actions/sys_read.c delete mode 100644 src/kernel/syscall/actions/sys_write.c (limited to 'src/kernel/syscall/actions') diff --git a/src/kernel/syscall/actions/sys_alloc.c b/src/kernel/syscall/actions/sys_alloc.c deleted file mode 100644 index 65269de..0000000 --- a/src/kernel/syscall/actions/sys_alloc.c +++ /dev/null @@ -1,6 +0,0 @@ -#include - -uint32_t sys_alloc(uint32_t count) -{ - return 0; // (uint32_t) umalloc(count); -} \ No newline at end of file diff --git a/src/kernel/syscall/actions/sys_free.c b/src/kernel/syscall/actions/sys_free.c index cbd4c70..480cd53 100644 --- a/src/kernel/syscall/actions/sys_free.c +++ b/src/kernel/syscall/actions/sys_free.c @@ -3,6 +3,6 @@ uint32_t sys_free(uint32_t ptr) { - kfree((void *)ptr); + ufree((void *)ptr); return 0; } \ No newline at end of file diff --git a/src/kernel/syscall/actions/sys_get_pointers.c b/src/kernel/syscall/actions/sys_get_pointers.c deleted file mode 100644 index 181630b..0000000 --- a/src/kernel/syscall/actions/sys_get_pointers.c +++ /dev/null @@ -1,18 +0,0 @@ -#include -#include -#include -#include - -struct userspace_pointers { - unsigned char *fb; - struct font *font; -}; - -uint32_t sys_get_pointers() -{ - struct userspace_pointers *pointers = - (struct userspace_pointers *)kmalloc(sizeof(struct userspace_pointers)); - pointers->fb = fb; - pointers->font = font; - return (uint32_t)pointers; -} \ No newline at end of file diff --git a/src/kernel/syscall/actions/sys_getch.c b/src/kernel/syscall/actions/sys_getch.c new file mode 100644 index 0000000..f1e4dfb --- /dev/null +++ b/src/kernel/syscall/actions/sys_getch.c @@ -0,0 +1,10 @@ +#include +#include +#include +#include +#include + +uint32_t sys_getch() +{ + return (uint32_t)getch(); +} \ No newline at end of file diff --git a/src/kernel/syscall/actions/sys_malloc.c b/src/kernel/syscall/actions/sys_malloc.c new file mode 100644 index 0000000..8adc362 --- /dev/null +++ b/src/kernel/syscall/actions/sys_malloc.c @@ -0,0 +1,7 @@ +#include +#include + +uint32_t sys_malloc(uint32_t count) +{ + return (uint32_t)umalloc(count); +} \ No newline at end of file diff --git a/src/kernel/syscall/actions/sys_putch.c b/src/kernel/syscall/actions/sys_putch.c new file mode 100644 index 0000000..beaa4a2 --- /dev/null +++ b/src/kernel/syscall/actions/sys_putch.c @@ -0,0 +1,9 @@ +#include +#include +#include + +uint32_t sys_putch(char ch) +{ + putch(ch); + return 0; +} \ No newline at end of file diff --git a/src/kernel/syscall/actions/sys_read.c b/src/kernel/syscall/actions/sys_read.c deleted file mode 100644 index 24d83d1..0000000 --- a/src/kernel/syscall/actions/sys_read.c +++ /dev/null @@ -1,21 +0,0 @@ -#include -#include -#include -#include -#include - -uint32_t sys_read(char *buf) -{ - keyboard_clear_buffer(); - keyboard_char_buffer = 0; - while (keyboard_char_buffer != '\n') { - getch(); - } - memcpy(buf, keyboard_buffer, strlen(keyboard_buffer)); - return strlen(buf); -} - -uint32_t sys_readc() -{ - return (uint32_t)getch(); -} \ No newline at end of file diff --git a/src/kernel/syscall/actions/sys_write.c b/src/kernel/syscall/actions/sys_write.c deleted file mode 100644 index f15004f..0000000 --- a/src/kernel/syscall/actions/sys_write.c +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include - -uint32_t sys_write(char *buf) -{ - printf(buf); - return strlen((const char *)buf); -} - -uint32_t sys_writec(char ch) -{ - writec(ch); - return 0; -} \ No newline at end of file -- cgit v1.2.3