summaryrefslogtreecommitdiff
path: root/src/init/main.c
diff options
context:
space:
mode:
authordzwdz2021-09-12 13:26:29 +0200
committerdzwdz2021-09-12 13:26:29 +0200
commita66ce8238c08703bd1066a8094d6ab537e82b20e (patch)
tree80754d2a54fd5797b87cf9f6596f3a78a29b6e56 /src/init/main.c
parent625ae265cbabe76bd272e9e8f0f637635af64b23 (diff)
implement most of fs_wait
awaited_req is a garbage name but i couldn't come up with a better one. i also have no idea how to handle all the failure states
Diffstat (limited to 'src/init/main.c')
-rw-r--r--src/init/main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/init/main.c b/src/init/main.c
index 8d677af..01e2285 100644
--- a/src/init/main.c
+++ b/src/init/main.c
@@ -28,14 +28,17 @@ int main(void) {
}
void fs_test(void) {
+ static char buf[64] __attribute__((section("text")));
+ int len = 64;
handle_t front, back, file;
front = _syscall_fs_create((void*)&back); // TODO change user_ptr to void*
if (_syscall_fork()) {
// child: is the fs server
log("fs_wait started. ");
- _syscall_fs_wait(back, NULL);
+ _syscall_fs_wait(back, buf, &len);
log("fs_wait returned. ");
+ _syscall_write(tty_fd, buf, len);
} else {
// parent: accesses the fs
_syscall_mount(front, argify("/mnt"));