From 80b2c1c2ab36b4ddb030e135bcacf1f30db362d2 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Thu, 9 Sep 2021 21:14:26 +0200 Subject: basic _syscall_fs_wait() impl, doesn't pass the req yet --- src/init/main.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/init/main.c') diff --git a/src/init/main.c b/src/init/main.c index 41f51d3..8d677af 100644 --- a/src/init/main.c +++ b/src/init/main.c @@ -30,8 +30,18 @@ int main(void) { void fs_test(void) { handle_t front, back, file; front = _syscall_fs_create((void*)&back); // TODO change user_ptr to void* - _syscall_mount(front, argify("/mnt")); - file = _syscall_open(argify("/mnt/test")); + + if (_syscall_fork()) { + // child: is the fs server + log("fs_wait started. "); + _syscall_fs_wait(back, NULL); + log("fs_wait returned. "); + } else { + // parent: accesses the fs + _syscall_mount(front, argify("/mnt")); + log("requesting file. "); + file = _syscall_open(argify("/mnt/test")); + } } void misc_tests(void) { -- cgit v1.2.3