Only dump bootloader modules once.
This commit is contained in:
parent
a092a57483
commit
e2aad55a8a
|
@ -23,12 +23,19 @@ bool streq(const char* a, const char* b) {
|
|||
}
|
||||
}
|
||||
|
||||
const limine_file& GetInitProgram(const char* path) {
|
||||
void DumpModules() {
|
||||
const limine_module_response& resp = boot::GetModules();
|
||||
dbgln("[boot] Dumping bootloader modules.");
|
||||
for (uint64_t i = 0; i < resp.module_count; i++) {
|
||||
const limine_file& file = *resp.modules[i];
|
||||
dbgln(" %s,%m,%x", file.path, file.address, file.size);
|
||||
}
|
||||
}
|
||||
|
||||
const limine_file& GetInitProgram(const char* path) {
|
||||
const limine_module_response& resp = boot::GetModules();
|
||||
dbgln("Dumping modules");
|
||||
for (uint64_t i = 0; i < resp.module_count; i++) {
|
||||
const limine_file& file = *resp.modules[i];
|
||||
dbgln("%s,%m,%x", file.path, file.address, file.size);
|
||||
if (streq(file.path, path)) return file;
|
||||
}
|
||||
panic("Program not found: %s", path);
|
||||
|
@ -37,6 +44,7 @@ const limine_file& GetInitProgram(const char* path) {
|
|||
} // namespace
|
||||
|
||||
void LoadInitProgram() {
|
||||
DumpModules();
|
||||
const limine_file& init_prog = GetInitProgram("/sys/test");
|
||||
const limine_file& prog2 = GetInitProgram("/sys/test2");
|
||||
|
||||
|
|
Loading…
Reference in New Issue