diff options
author | Marvin Borner | 2020-04-28 20:59:57 +0200 |
---|---|---|
committer | Marvin Borner | 2020-04-28 20:59:57 +0200 |
commit | 5f8b5ce7efb7738eaebad43f9648975788ae19ff (patch) | |
tree | ab8fc4d4baa4adb99dc90461df689650acf34cef /src/kernel/syscall/actions | |
parent | bfe16de4be67565f1a1e7b1331fcbe3aedf9c54e (diff) |
Fixed userspace entering...
Many other fixes too, but I won't mention them because I don't want to
:)
Diffstat (limited to 'src/kernel/syscall/actions')
-rw-r--r-- | src/kernel/syscall/actions/sys_alloc.c | 6 | ||||
-rw-r--r-- | src/kernel/syscall/actions/sys_free.c | 2 | ||||
-rw-r--r-- | src/kernel/syscall/actions/sys_get_pointers.c | 18 | ||||
-rw-r--r-- | src/kernel/syscall/actions/sys_getch.c | 10 | ||||
-rw-r--r-- | src/kernel/syscall/actions/sys_malloc.c | 7 | ||||
-rw-r--r-- | src/kernel/syscall/actions/sys_putch.c | 9 | ||||
-rw-r--r-- | src/kernel/syscall/actions/sys_read.c | 21 | ||||
-rw-r--r-- | src/kernel/syscall/actions/sys_write.c | 15 |
8 files changed, 27 insertions, 61 deletions
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 <stdint.h> - -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 <stdint.h> -#include <kernel/graphics/vesa.h> -#include <kernel/fs/load.h> -#include <kernel/memory/alloc.h> - -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 <stdint.h> +#include <kernel/lib/stdio.h> +#include <kernel/input/input.h> +#include <kernel/lib/lib.h> +#include <kernel/lib/string.h> + +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 <stdint.h> +#include <kernel/memory/alloc.h> + +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 <stdint.h> +#include <kernel/lib/stdio.h> +#include <kernel/lib/string.h> + +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 <stdint.h> -#include <kernel/lib/stdio.h> -#include <kernel/input/input.h> -#include <kernel/lib/lib.h> -#include <kernel/lib/string.h> - -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 <stdint.h> -#include <kernel/lib/stdio.h> -#include <kernel/lib/string.h> - -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 |