diff options
author | dzwdz | 2022-07-23 19:28:43 +0200 |
---|---|---|
committer | dzwdz | 2022-07-23 19:28:43 +0200 |
commit | 20c7b5be3bbb5f56a31536c018e20706100f57ae (patch) | |
tree | 47dde902a7d2a2ff464c600d76b4743fe8153e63 /src/user/app | |
parent | 3badc5ac30fcc0836a2604146788158b16b64f2d (diff) |
user_bootstrap: pass the initrd in an argument to init's main
Diffstat (limited to 'src/user/app')
-rw-r--r-- | src/user/app/main.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/user/app/main.c b/src/user/app/main.c index 28c4aa0..9f4d50c 100644 --- a/src/user/app/main.c +++ b/src/user/app/main.c @@ -9,16 +9,17 @@ #include <user/lib/stdlib.h> #include <user/tests/main.h> -// extern char _initrd; +__attribute__((visibility("hidden"))) +extern char _image_base[]; void read_file(const char *path, size_t len); __attribute__((section(".text.startup"))) -int main(void) { +int main(void *initrd) { elf_selfreloc(); file_reopen(stdout, "/com1", 0); - printf("preinit\n"); + printf("in init, loaded at 0x%x\n", &_image_base); /* move everything provided by the kernel to /kdev */ MOUNT("/kdev/", fs_passthru(NULL)); @@ -28,7 +29,7 @@ int main(void) { } if (!fork2_n_mount("/")) fs_dir_inject("/kdev/"); // TODO should be part of fs_whitelist - // MOUNT("/init/", tar_driver(&_initrd)); + MOUNT("/init/", tar_driver(initrd)); MOUNT("/tmp/", tmpfs_drv()); MOUNT("/keyboard", ps2_drv()); MOUNT("/vga_tty", ansiterm_drv()); |