summaryrefslogtreecommitdiff
path: root/src/init/main.c
diff options
context:
space:
mode:
authordzwdz2021-09-12 18:31:15 +0200
committerdzwdz2021-09-12 18:31:15 +0200
commitd789f43bb82b8c43f0e8a5a53a4ce8b30d1c0984 (patch)
treec07b0e5aafbeeedfc9ffcb9eb981b3f5c7059c2d /src/init/main.c
parent5194b7f3a6eadc7439d28da6e2a49330ccd273a9 (diff)
first working access function!
Diffstat (limited to 'src/init/main.c')
-rw-r--r--src/init/main.c10
1 files changed, 10 insertions, 0 deletions
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;