diff options
Diffstat (limited to 'src/init')
-rw-r--r-- | src/init/main.c | 24 | ||||
-rw-r--r-- | src/init/syscalls.c | 4 |
2 files changed, 7 insertions, 21 deletions
diff --git a/src/init/main.c b/src/init/main.c index fb379d2..51764ce 100644 --- a/src/init/main.c +++ b/src/init/main.c @@ -14,27 +14,9 @@ const char *multipageify(const char *str) { } int main() { - char buf[64]; - int len = 64; - - // try to print a string crossing page boundaries - _syscall_debuglog( - multipageify("I cross pages. "), - sizeof("I cross pages. ") - 1); - - if (_syscall_fork() > 0) { - _syscall_debuglog("parent ", - sizeof("parent ") - 1); - - len = _syscall_await(buf, 64); - _syscall_debuglog(buf, len); - } else { - _syscall_debuglog("child ", - sizeof("child ") - 1); - _syscall_exit( - multipageify("this is the child's exit message!"), - sizeof("this is the child's exit message!") - 1); - } + _syscall_fs_open( + multipageify("/some/../path"), + sizeof("/some/../path") - 1); _syscall_exit("bye from init! ", sizeof("bye from init! ") - 1); diff --git a/src/init/syscalls.c b/src/init/syscalls.c index 1e11705..b0e1587 100644 --- a/src/init/syscalls.c +++ b/src/init/syscalls.c @@ -16,6 +16,10 @@ int _syscall_await(char *buf, int len) { return _syscall(_SYSCALL_AWAIT, (int)buf, (int)len, 0); } +fd_t _syscall_fs_open(const char *path, size_t len) { + return _syscall(_SYSCALL_FS_OPEN, (int)path, len, 0); +} + int _syscall_debuglog(const char *msg, size_t len) { return _syscall(_SYSCALL_DEBUGLOG, (int)msg, len, 0); } |