diff options
author | Jon Santmyer <jon@jonsantmyer.com> | 2025-09-02 11:35:38 -0400 |
---|---|---|
committer | Jon Santmyer <jon@jonsantmyer.com> | 2025-09-02 11:35:38 -0400 |
commit | d26eb8b54969e79d933a8e20f2725343cd42deab (patch) | |
tree | 9b6aaf6e84ed965d146c129028e32e00ef846adc /device | |
parent | 8f0ba2fd31408d04175513b8826bf9418ad8b087 (diff) | |
download | jove-kernel-d26eb8b54969e79d933a8e20f2725343cd42deab.tar.gz jove-kernel-d26eb8b54969e79d933a8e20f2725343cd42deab.tar.bz2 jove-kernel-d26eb8b54969e79d933a8e20f2725343cd42deab.zip |
move limine to arch-specific directory.
untie boot code from non-boot code
Diffstat (limited to 'device')
-rw-r--r-- | device/initrd.c | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/device/initrd.c b/device/initrd.c index b2e615e..58f38c9 100644 --- a/device/initrd.c +++ b/device/initrd.c @@ -3,7 +3,7 @@ #include <stddef.h> #include "device/initrd.h" -#include "device/processor.h" +#include "boot.h" #include "object.h" #include "jove.h" #include "bootargs.h" @@ -20,30 +20,6 @@ struct jove_ObjectDirectory s_initrd_dir = { } }; -static uintptr_t s_initrd_getaddr(char *path); - -#if defined(__limine__) - -#include "boot/limine/limine.h" -static struct limine_module_request s_module_request = { - .id = LIMINE_MODULE_REQUEST -}; - -static uintptr_t -s_initrd_getaddr(char *path) -{ - struct limine_module_response *response = s_module_request.response; - for(size_t i = 0; i < response->module_count; i++) { - struct limine_file *module = response->modules[i]; - if(strcmp(path, module->path) == 0) - return (uintptr_t)module->address; - } - kpanic("Failed to load module at path %s\n", path); -} - - -#endif - static size_t s_tar_oct_dec(const char *oct) { @@ -83,9 +59,7 @@ initrd_setup(void) kpanic("Missing kernel commandline argument for initrd."); } - uintptr_t initrd_addr = s_initrd_getaddr(initrd_path); - klogf("Initrd found at %p\n", initrd_addr); - tar_parse((tar_block_t*)initrd_addr); + tar_parse(_boot_initrd_base); _initDirectory.entries[INIT_OBJECT_INITRD_DIR] = (objdir_entry_t) { .type = KO_OBJECT_DIRECTORY, |