From d789f43bb82b8c43f0e8a5a53a4ce8b30d1c0984 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Sun, 12 Sep 2021 18:31:15 +0200 Subject: first working access function! --- src/init/main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/init') diff --git a/src/init/main.c b/src/init/main.c index f31da02..28bb4a7 100644 --- a/src/init/main.c +++ b/src/init/main.c @@ -42,6 +42,7 @@ void fs_test(void) { log("requesting file. "); file = _syscall_open(argify("/mnt/tty")); log("open returned. "); + _syscall_write(file, argify("hello")); } void fs_server(handle_t back) { @@ -55,6 +56,15 @@ void fs_server(handle_t back) { log(" was opened. "); _syscall_fs_respond(0, NULL, 0); // doesn't check the path yet break; + + case VFSOP_WRITE: + // uppercase the buffer + for (int i = 0; i < len; i++) buf[i] &= ~32; + // and passthrough to tty + _syscall_write(tty_fd, buf, len); + _syscall_fs_respond(len, NULL, 0); // return the amt of bytes written + break; + default: log("fuck"); break; -- cgit v1.2.3