diff --git a/kaleid/kernel/init/init.c b/kaleid/kernel/init/init.c index 0dac2bf..94c8034 100644 --- a/kaleid/kernel/init/init.c +++ b/kaleid/kernel/init/init.c @@ -109,6 +109,8 @@ void InitBootInfo(multiboot_info_t *mbi) // noreturn void StartKern(multiboot_info_t *mbInfo, int mbMagic) { + error_t mapBad; + // We're not ready to deal with interrupts DisableIRQs(); @@ -128,9 +130,10 @@ noreturn void StartKern(multiboot_info_t *mbInfo, int mbMagic) ); //Memory mapping - error_t mapBad = InitMemoryMap(); - if (mapBad) - StartPanic("[Init] The memory map failed to initialize. Error : %d", mapBad); + if ((mapBad = InitMemoryMap())) + StartPanic("[Init] The memory map failed to initialize. Error : %d", + mapBad + ); // We're out KernLog("\n[Init] Evil never dies !\n"); diff --git a/kaleid/kernel/mm/map.c b/kaleid/kernel/mm/map.c index 5ea56c6..d84f662 100644 --- a/kaleid/kernel/mm/map.c +++ b/kaleid/kernel/mm/map.c @@ -32,7 +32,7 @@ error_t InitMemoryMap(void) DebugLog("[InitMemoryMap] Memory map address : %p, length : %d\n", GetBootInfo(memory).mapAddr, GetBootInfo(memory).mapLength); - if ((GetBootInfo(memory).upMemory / (MB/KB)) <= MINIMUM_RAM_SIZE) //XXX before loading kernel... + if ((GetBootInfo(memory).upMemory / (MB/KB)) <= MINIMUM_RAM_SIZE) return ENOMEM; DebugLog("[InitMemoryMap] Low memory : %d Kio, Up memory : %d Mio\n", GetBootInfo(memory).lowMemory, GetBootInfo(memory).upMemory / (MB/KB));