summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/init/main.c10
-rw-r--r--src/kernel/vfs/request.c4
2 files changed, 13 insertions, 1 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;
diff --git a/src/kernel/vfs/request.c b/src/kernel/vfs/request.c
index 9f0a14f..0524c53 100644
--- a/src/kernel/vfs/request.c
+++ b/src/kernel/vfs/request.c
@@ -57,7 +57,9 @@ _Noreturn void vfs_request_pass2handler(struct vfs_request *req) {
handler->awaited_req.buf, req->input.buf_kern, len))
goto fail; // can't copy buffer
} else {
- panic(); // TODO
+ if (!virt_cpy(handler->pages, handler->awaited_req.buf,
+ req->caller->pages, req->input.buf_kern, len))
+ goto fail; // can't copy buffer
}
if (!virt_cpy_to(handler->pages,