28 lines
682 B
C
28 lines
682 B
C
#include <stdint.h>
|
|
#include <stddef.h>
|
|
#include <limine.h>
|
|
#include "baseimg.h"
|
|
#include "bootinfo/bootinfo.h"
|
|
#include "kprintf.h"
|
|
#include "util/util.h"
|
|
#include "hal/hal.h"
|
|
|
|
void baseimg_init(void) {
|
|
LOG("baseimg", "looking for base image...\n");
|
|
struct limine_file *baseimg = NULL;
|
|
for (size_t i = 0; i < BOOT_INFO.modules->module_count; i++) {
|
|
struct limine_file *module = BOOT_INFO.modules->modules[i];
|
|
if (hal_strcmp(util_get_filename(module->path), "base.img") == 0) {
|
|
baseimg = module;
|
|
break;
|
|
}
|
|
}
|
|
|
|
if (baseimg == NULL) {
|
|
ERR("baseimg", "base.img not found\n");
|
|
hal_hang();
|
|
} else {
|
|
LOG("baseimg", "base.img found\n");
|
|
}
|
|
}
|