#include "commandline.h" #include "jove.h" #include "initrd.h" #include "tasking.h" #include "arch/elf.h" __attribute__((noreturn)) void kinit(void) { const char *init_filepath = cmdline_get("init"); if(init_filepath == NULL) kpanic("init filepath not found in kernel commandline\n"); initrd_file_t *init_file = ird_getfile(init_filepath); if(init_file == NULL) kpanic("init file not found in initrd [filepath=\"%s\"]\n", init_filepath); uintptr_t ip = elf_load(init_file->data, init_file->size); kexec((void*)ip, 0, NULL, 0, NULL); kpanic("Reached end of kinit\n"); }