summaryrefslogtreecommitdiff
path: root/src/kernel/core/kmain.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/core/kmain.cpp')
-rw-r--r--src/kernel/core/kmain.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/kernel/core/kmain.cpp b/src/kernel/core/kmain.cpp
index 314c033..9ec06df 100644
--- a/src/kernel/core/kmain.cpp
+++ b/src/kernel/core/kmain.cpp
@@ -77,15 +77,15 @@ extern "C" void kmain(multiboot_info_t* mbd, int32_t magic) {
*ke_vt << "Loading modules :\n";
for (unsigned i = 0; i < mbd->mods_count; i++) {
*ke_vt << " * " << (char*)mods[i].string;
- if (elf_check((uint8_t*)mods[i].mod_start)) {
- *ke_vt << " : Invalid ELF file\n";
- } else {
+ if (elf_check((uint8_t*)mods[i].mod_start) == 0) {
process *pr = elf_exec((uint8_t*)mods[i].mod_start, PL_USER);
if (pr == 0) {
*ke_vt << " : Error loading\n";
} else {
*ke_vt << " : OK, pid=" << (int)pr->pid << "\n";
}
+ } else {
+ *ke_vt << " : Invalid ELF file\n";
}
}