[libj6] Update how init args are passed and used

Now the init args are a linked list - this also means ld.so can use its
own plus those of the program (eg, SLP and VFS handles). __init_libj6
now adds the head of the list to its global init_args structure, and the
j6_find_init_handle function can be used to find a handle in those args
for a given proto.

This fixes situations like the logger using the wrong mailbox for the
service locator and never finding the uart driver.
This commit is contained in:
Justin C. Miller
2024-02-20 20:51:14 -08:00
parent 9f8e75f680
commit 4e73e933db
10 changed files with 125 additions and 72 deletions

View File

@@ -75,7 +75,7 @@ main(int argc, const char **argv, const char **env)
return s;
const j6_init_args *initp = j6_get_init_args();
uintptr_t modules_addr = initp->args[0];
uintptr_t modules_addr = initp->argv[0];
std::vector<const module*> mods;
load_modules(modules_addr, sys, 0, mods);