Implement storedevs, prepare to port littlefs

This commit is contained in:
2025-08-16 12:34:36 +02:00
parent c936910199
commit 2b0566c56f
91 changed files with 54963 additions and 37 deletions

27
kernel/baseimg/baseimg.c Normal file
View 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
View File

@ -0,0 +1,6 @@
#ifndef BASEIMG_BASEIMG_H_
#define BASEIMG_BASEIMG_H_
void baseimg_init(void);
#endif // BASEIMG_BASEIMG_H_