From d94b024b73aeca06de417e0fd3c502495312a8b2 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sat, 7 Dec 2019 13:40:28 +0100 Subject: Added userspace libc and began userspace based shell --- src/kernel/syscall/actions/sys_read.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/kernel/syscall/actions/sys_read.c (limited to 'src/kernel/syscall/actions/sys_read.c') 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 +#include +#include +#include +#include +#include + +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 -- cgit v1.2.3