diff options
author | Marvin Borner | 2019-12-09 16:06:37 +0100 |
---|---|---|
committer | Marvin Borner | 2019-12-09 16:06:37 +0100 |
commit | 33bdf18dad2539aca21727e95e04bfedecd37a76 (patch) | |
tree | 26ca76090ef534ca192a2ee25dded3cf11fe08cc /src/userspace | |
parent | 79d2ca772615474f18f32e91cf7fa8d53d02e73d (diff) |
Lars, your wish may come true if you fix this!
Diffstat (limited to 'src/userspace')
-rw-r--r-- | src/userspace/main.c | 5 | ||||
-rw-r--r-- | src/userspace/syscall.h | 9 |
2 files changed, 11 insertions, 3 deletions
diff --git a/src/userspace/main.c b/src/userspace/main.c index 1e68496..64077eb 100644 --- a/src/userspace/main.c +++ b/src/userspace/main.c @@ -6,8 +6,7 @@ void user_main() syscall_write(hello); while (1) { - char buffer[20] = {'\0'}; - syscall_read(buffer); - syscall_write(buffer); + char ch = (char) syscall_readc(); + syscall_writec(ch); }; }
\ No newline at end of file diff --git a/src/userspace/syscall.h b/src/userspace/syscall.h index d5d8920..4ddd9d2 100644 --- a/src/userspace/syscall.h +++ b/src/userspace/syscall.h @@ -66,6 +66,11 @@ DECL_SYSCALL1(write, char *); DECL_SYSCALL1(read, char *); +DECL_SYSCALL1(writec, char); + +DECL_SYSCALL0(readc); + + /** * DEFINITIONS */ @@ -73,4 +78,8 @@ DEFN_SYSCALL1(write, 1, char *); DEFN_SYSCALL1(read, 2, char *); +DEFN_SYSCALL1(writec, 3, char); + +DEFN_SYSCALL0(readc, 4); + #endif |