Implement storedevs, prepare to port littlefs
This commit is contained in:
27
kernel/baseimg/baseimg.c
Normal file
27
kernel/baseimg/baseimg.c
Normal file
@ -0,0 +1,27 @@
|
||||
#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");
|
||||
}
|
||||
}
|
6
kernel/baseimg/baseimg.h
Normal file
6
kernel/baseimg/baseimg.h
Normal file
@ -0,0 +1,6 @@
|
||||
#ifndef BASEIMG_BASEIMG_H_
|
||||
#define BASEIMG_BASEIMG_H_
|
||||
|
||||
void baseimg_init(void);
|
||||
|
||||
#endif // BASEIMG_BASEIMG_H_
|
Reference in New Issue
Block a user