summaryrefslogtreecommitdiff
path: root/src/init
diff options
context:
space:
mode:
authordzwdz2021-08-22 15:51:45 +0200
committerdzwdz2021-08-22 15:51:45 +0200
commit2c0113cb72b63ba7177d14a60bcd9e51eee8e5cf (patch)
tree82d53fd92996da15bca3b9321a85e9f88f6e566c /src/init
parentac74cec51fa9c31e4c8cea2dd9f01b7b895d61b4 (diff)
basic mount resolving
Diffstat (limited to 'src/init')
-rw-r--r--src/init/main.c10
-rw-r--r--src/init/syscalls.c4
2 files changed, 12 insertions, 2 deletions
diff --git a/src/init/main.c b/src/init/main.c
index 51764ce..0c5f034 100644
--- a/src/init/main.c
+++ b/src/init/main.c
@@ -13,10 +13,16 @@ const char *multipageify(const char *str) {
return out;
}
+#define mount(path) _syscall_mount(path, sizeof(path)-1, 0)
+
int main() {
+ mount("/");
+ mount("/some/where");
+ mount("/some");
+
_syscall_fs_open(
- multipageify("/some/../path"),
- sizeof("/some/../path") - 1);
+ multipageify("/some/where/file"),
+ sizeof("/some/where/file") - 1);
_syscall_exit("bye from init! ",
sizeof("bye from init! ") - 1);
diff --git a/src/init/syscalls.c b/src/init/syscalls.c
index b0e1587..fb59bd3 100644
--- a/src/init/syscalls.c
+++ b/src/init/syscalls.c
@@ -20,6 +20,10 @@ fd_t _syscall_fs_open(const char *path, size_t len) {
return _syscall(_SYSCALL_FS_OPEN, (int)path, len, 0);
}
+int _syscall_mount(const char *path, int len, fd_t fd) {
+ return _syscall(_SYSCALL_MOUNT, (int)path, len, fd);
+}
+
int _syscall_debuglog(const char *msg, size_t len) {
return _syscall(_SYSCALL_DEBUGLOG, (int)msg, len, 0);
}