aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/syscall/actions/sys_read.c
diff options
context:
space:
mode:
authorMarvin Borner2019-12-07 13:40:28 +0100
committerMarvin Borner2019-12-07 13:40:28 +0100
commitd94b024b73aeca06de417e0fd3c502495312a8b2 (patch)
treebff5cc1b757eeed7f58878cc13551c63464c5a31 /src/kernel/syscall/actions/sys_read.c
parent322167ceab19588473f9074e761390fdeb701790 (diff)
Added userspace libc and began userspace based shell
Diffstat (limited to 'src/kernel/syscall/actions/sys_read.c')
-rw-r--r--src/kernel/syscall/actions/sys_read.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/kernel/syscall/actions/sys_read.c b/src/kernel/syscall/actions/sys_read.c
new file mode 100644
index 0000000..761eec7
--- /dev/null
+++ b/src/kernel/syscall/actions/sys_read.c
@@ -0,0 +1,21 @@
+#include <stdint-gcc.h>
+#include <kernel/lib/stdio.h>
+#include <kernel/lib/string.h>
+#include <kernel/io/io.h>
+#include <kernel/input/input.h>
+#include <kernel/timer/timer.h>
+
+uint32_t sys_read()
+{
+ serial_write("CALL\n");
+
+ keyboard_clear_buffer();
+ while (keyboard_buffer[strlen(keyboard_buffer) - 1] != '\n') {
+ {
+ timer_wait(1); // IDK why?
+ }
+ }
+ serial_write(keyboard_buffer);
+ serial_write("\n");
+ return (uint32_t) keyboard_buffer;
+} \ No newline at end of file