Init clean-up

This commit is contained in:
Adrien Bourmault 2019-03-23 23:58:49 +01:00
parent fd9f87ddd4
commit 5cfc5997dc
2 changed files with 7 additions and 4 deletions

View File

@ -109,6 +109,8 @@ void InitBootInfo(multiboot_info_t *mbi)
// //
noreturn void StartKern(multiboot_info_t *mbInfo, int mbMagic) noreturn void StartKern(multiboot_info_t *mbInfo, int mbMagic)
{ {
error_t mapBad;
// We're not ready to deal with interrupts // We're not ready to deal with interrupts
DisableIRQs(); DisableIRQs();
@ -128,9 +130,10 @@ noreturn void StartKern(multiboot_info_t *mbInfo, int mbMagic)
); );
//Memory mapping //Memory mapping
error_t mapBad = InitMemoryMap(); if ((mapBad = InitMemoryMap()))
if (mapBad) StartPanic("[Init] The memory map failed to initialize. Error : %d",
StartPanic("[Init] The memory map failed to initialize. Error : %d", mapBad); mapBad
);
// We're out // We're out
KernLog("\n[Init] Evil never dies !\n"); KernLog("\n[Init] Evil never dies !\n");

View File

@ -32,7 +32,7 @@ error_t InitMemoryMap(void)
DebugLog("[InitMemoryMap] Memory map address : %p, length : %d\n", DebugLog("[InitMemoryMap] Memory map address : %p, length : %d\n",
GetBootInfo(memory).mapAddr, GetBootInfo(memory).mapLength); 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; return ENOMEM;
DebugLog("[InitMemoryMap] Low memory : %d Kio, Up memory : %d Mio\n", DebugLog("[InitMemoryMap] Low memory : %d Kio, Up memory : %d Mio\n",
GetBootInfo(memory).lowMemory, GetBootInfo(memory).upMemory / (MB/KB)); GetBootInfo(memory).lowMemory, GetBootInfo(memory).upMemory / (MB/KB));