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_write.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/kernel/syscall/actions/sys_write.c') diff --git a/src/kernel/syscall/actions/sys_write.c b/src/kernel/syscall/actions/sys_write.c index 882ff19..aef2b2b 100644 --- a/src/kernel/syscall/actions/sys_write.c +++ b/src/kernel/syscall/actions/sys_write.c @@ -1,9 +1,11 @@ #include -#include +#include +#include +#include -uint32_t sys_write(unsigned int fd, unsigned int buf, unsigned int count) +uint32_t sys_write(unsigned int buf) { - for (uint32_t i = 0; i < count; i++) - writec(*((char *) buf++)); - return count; + serial_put(((char *) buf)[0]); + printf((const char *) buf); + return strlen((const char *) buf); } \ No newline at end of file -- cgit v1.2.3