summaryrefslogtreecommitdiff
path: root/src/user/bootstrap/main.c
diff options
context:
space:
mode:
authordzwdz2022-07-30 20:45:36 +0200
committerdzwdz2022-07-31 00:13:08 +0200
commit40674fa5469c7af09095d5dd5cca8eccc728561c (patch)
treeb1d49dedf9eb2718d34c13272e0f00e99aa31732 /src/user/bootstrap/main.c
parentfdeac40f867ca0c43ade53cce4b77bb146b10aae (diff)
user: replace the MOUNT macro with MOUNT_AT
The old style could be confused with a regular function, where the driver would be executed unconditionally. This should make it more obvious that the driver doesn't get executed in the parent process.
Diffstat (limited to 'src/user/bootstrap/main.c')
-rw-r--r--src/user/bootstrap/main.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/user/bootstrap/main.c b/src/user/bootstrap/main.c
index e877b64..fc239cf 100644
--- a/src/user/bootstrap/main.c
+++ b/src/user/bootstrap/main.c
@@ -15,14 +15,16 @@ void _start(void) {
_syscall_memflag(&_bss_start, &_bss_end - &_bss_start, MEMFLAG_PRESENT);
/* move everything provided by the kernel to /kdev */
- MOUNT("/kdev/", fs_passthru(NULL));
- if (!fork2_n_mount("/")) {
+ MOUNT_AT("/kdev/") { fs_passthru(NULL); }
+ MOUNT_AT("/") {
const char *l[] = {"/kdev/", NULL};
fs_whitelist(l);
}
- if (!fork2_n_mount("/")) fs_dir_inject("/kdev/"); // TODO should be part of fs_whitelist
+ MOUNT_AT("/") {
+ fs_dir_inject("/kdev/"); // TODO should be part of fs_whitelist
+ }
- MOUNT("/init/", tar_driver(&_initrd));
+ MOUNT_AT("/init/") { tar_driver(&_initrd); }
void *init = tar_find("bin/init", 8, &_initrd, ~0) + 512;
if (init) {