clean the IHM '-'

This commit is contained in:
Adrien Bourmault 2019-05-17 21:10:22 +02:00
parent 2ee9c7100e
commit 7a663b224f
5 changed files with 13 additions and 12 deletions

View File

@ -110,9 +110,9 @@ void BtInitBootInfo(multiboot_info_t *mbi, void *codeSeg)
void BtDoSanityChecks(uint mbMagic) { void BtDoSanityChecks(uint mbMagic) {
if (!(mbMagic == MULTIBOOT_BOOTLOADER_MAGIC)) if (!(mbMagic == MULTIBOOT_BOOTLOADER_MAGIC))
KeStartPanic("[Init]\tMagic number %x is incorrect\n", mbMagic); KeStartPanic("\tMagic number %x is incorrect\n", mbMagic);
DebugLog("[Init]\tKernel successfully loaded at %p\n", DebugLog("\tKernel successfully loaded at %p\n",
BtLoaderInfo.kernelAddr); BtLoaderInfo.kernelAddr);
} }

View File

@ -147,7 +147,7 @@ void KeSetupIDT(void)
KeSetIDTGate(0x1B, (ulong)isr27, codeSeg, 0x8E); // INTEL RESERVED KeSetIDTGate(0x1B, (ulong)isr27, codeSeg, 0x8E); // INTEL RESERVED
KeSetIDTGate(0x1C, (ulong)isr28, codeSeg, 0x8E); // INTEL RESERVED KeSetIDTGate(0x1C, (ulong)isr28, codeSeg, 0x8E); // INTEL RESERVED
KeSetIDTGate(0x1D, (ulong)isr29, codeSeg, 0x8E); // INTEL RESERVED KeSetIDTGate(0x1D, (ulong)isr29, codeSeg, 0x8E); // INTEL RESERVED
KeSetIDTGate(0x1E, (ulong)isr30, codeSeg, 0x8E); // INTEL RESERVED KeSetIDTGate(0x1E, (ulong)isr30, codeSeg, 0x8E);
KeSetIDTGate(0x1F, (ulong)isr31, codeSeg, 0x8E); // INTEL RESERVED KeSetIDTGate(0x1F, (ulong)isr31, codeSeg, 0x8E); // INTEL RESERVED
// Set IDT IRQs Gates // Set IDT IRQs Gates
@ -175,7 +175,7 @@ void KeSetupIDT(void)
// Load IDT // Load IDT
KeLoadIDT(); KeLoadIDT();
DebugLog("[IdtSetup] Initialized !\n"); DebugLog("\tInterrupt table initialized\n");
} }
// //
@ -252,10 +252,10 @@ void _KeHandleISR(ISRFrame_t *regs)
if ((!regs) || (!regs->rip)) if ((!regs) || (!regs->rip))
KeStartPanic("[ISR ?] Unknown ISR Exception Abort\n"); KeStartPanic("[ISR ?] Unknown ISR Exception Abort\n");
if ((regs->intNo >= 0x15) && (regs->intNo <= 0x1F)) if ((regs->intNo >= 0x15) && (regs->intNo <= 0x1D))
return; // INTEL RESERVED return; // INTEL RESERVED
if (regs->intNo == 0x0F) if ((regs->intNo == 0x0F) || (regs->intNo == 0x1F))
return; // INTEL RESERVED return; // INTEL RESERVED
for (int i = 0; i < isrList.n; i++) { for (int i = 0; i < isrList.n; i++) {
@ -276,7 +276,7 @@ void _KeHandleISR(ISRFrame_t *regs)
static void EarlyExceptionHandler(ISRFrame_t *regs) static void EarlyExceptionHandler(ISRFrame_t *regs)
{ {
KeStartPanic("[ISR 0x%x] Irrecoverable Kernel %s\n\n" KeStartPanic("[ISR 0x%x] Irrecoverable Kernel %s\n\n"
" Error code : %p\n\n" " Error code : 0x%x (%b)\n\n"
" RIP: %#016lx CS: %#016lx RSP: %#016lx\n" " RIP: %#016lx CS: %#016lx RSP: %#016lx\n"
" SS: %#016lx RAX: %#016lx RBX: %#016lx\n" " SS: %#016lx RAX: %#016lx RBX: %#016lx\n"
" RCX: %#016lx RDX: %#016lx RSI: %#016lx\n" " RCX: %#016lx RDX: %#016lx RSI: %#016lx\n"
@ -287,6 +287,7 @@ static void EarlyExceptionHandler(ISRFrame_t *regs)
regs->intNo, regs->intNo,
ExceptionsChar[regs->intNo], ExceptionsChar[regs->intNo],
regs->ErrorCode, regs->ErrorCode,
regs->ErrorCode,
regs->rip, regs->rip,
regs->cs, regs->cs,
regs->rsp, regs->rsp,

View File

@ -275,7 +275,7 @@ void KeEnableRTC(void)
KeRegisterISR(HandleRTC, 0x28); KeRegisterISR(HandleRTC, 0x28);
// Setting up the register control and interrupt rates // Setting up the register control and interrupt rates
DebugLog("[RTC Time] Interrupt frequency set to %d Hz\n", DebugLog("\tRTC interrupt frequency set to %d Hz\n",
32768 >> (RTC_RATE - 1)); 32768 >> (RTC_RATE - 1));
IoWriteByteOnPort(0x70, 0x8B); IoWriteByteOnPort(0x70, 0x8B);

View File

@ -56,8 +56,8 @@ void MmInitHeap(void)
_heap_end = _heap_start; _heap_end = _heap_start;
_heap_max = lmin(MM_HEAP_MAX, MmGetAvailZoneSize(_heap_end)); _heap_max = lmin(MM_HEAP_MAX, MmGetAvailZoneSize(_heap_end));
KernLog("[InitHeap] Start address : %p, Max length : %u Mio\n\n", if ((ulong)_heap_start == _heap_max)
_heap_start, _heap_max / MB); KeStartPanic("The heap failed to initialize ! (Not enough memory)");
} }
// //

View File

@ -41,7 +41,7 @@ void MmInitMemoryMap(void)
rc = InitMemoryMap(); rc = InitMemoryMap();
if (rc) if (rc)
KeStartPanic("[Mm]\tThe memory map failed to initialize.\nError : %s", KeStartPanic("\tThe memory map failed to initialize.\nError : %s",
strerror(rc) ); strerror(rc) );
} }
@ -98,7 +98,7 @@ static error_t InitMemoryMap(void)
if (memoryMap.freeRamSize < MINIMUM_RAM_SIZE) if (memoryMap.freeRamSize < MINIMUM_RAM_SIZE)
return ENOMEM; return ENOMEM;
KernLog("[Mm]\tAvailable Ram Size : %u Mio\n", KernLog("\tAvailable RAM size : %u MB\n",
memoryMap.freeRamSize / MB); memoryMap.freeRamSize / MB);
// Magic value in memory to prevent smashing // Magic value in memory to prevent smashing