diff options
author | Ian Moffett <ian@osmora.org> | 2024-04-06 20:52:28 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2024-04-06 20:52:28 -0400 |
commit | 76ad166d8db3eb2a833c143d31bc4208088babfc (patch) | |
tree | 4849d1dcf2f35d0e74de9614cfd0548835f7be9c /sys/kern | |
parent | 6b40f3d8292214fcdd1f94c67cbfab97ce406180 (diff) |
kernel: sched: Load init by itself
This is temporary
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_sched.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/sys/kern/kern_sched.c b/sys/kern/kern_sched.c index 0e2c63c..50d0999 100644 --- a/sys/kern/kern_sched.c +++ b/sys/kern/kern_sched.c @@ -397,11 +397,10 @@ sched_init(void) { struct proc *init; struct vm_range init_range; - struct auxval auxv = {0}, ld_auxv = {0}; + struct auxval auxv = {0}; struct vas vas = pmap_create_vas(vm_get_ctx()); - const char *init_bin, *ld_bin; + const char *init_bin; - char *ld_path; char *argv[] = {"/usr/sbin/init", NULL}; char *envp[] = {NULL}; @@ -410,17 +409,11 @@ sched_init(void) if ((init_bin = initramfs_open("/usr/sbin/init")) == NULL) { panic("Could not open /usr/boot/init\n"); } - if (loader_load(vas, init_bin, &auxv, 0, &ld_path, &init_range) != 0) { + if (loader_load(vas, init_bin, &auxv, 0, NULL, &init_range) != 0) { panic("Could not load init\n"); } - if ((ld_bin = initramfs_open(ld_path)) == NULL) { - panic("Could not open %s\n", ld_path); - } - if (loader_load(vas, ld_bin, &ld_auxv, 0x00, NULL, &init_range) != 0) { - panic("Could not load %s\n", ld_path); - } - init = sched_create_td((uintptr_t)ld_auxv.at_entry, argv, envp, + init = sched_create_td((uintptr_t)auxv.at_entry, argv, envp, auxv, vas, true, &init_range); if (init == NULL) { panic("Failed to create thread for init\n"); |