11
« am: 15. November 2009, 11:41 »
Ah, ok. Das mit den Register habe ich nun verstanden.
Hier der Code des FaultHandlers
void FaultHandler(struct SISRParam* Param)
{
// Print an error on the screen the screen and stop the cpu
ClsEx(0x47);
SetTextAttribute(0x47);
kprintf("Exception", 0, 0);
// Print an discription on the screen
kprintf("Description: ", 0, 1);
if(Param->int_no < 32)
kprintf((char*) ExceptionMessage[Param->int_no], 13, 1);
// Show all register
kprintf("Register:", 0, 2);
kprintf("GS:", 3, 3);
kprintf("FS:", 15, 3);
kprintf("ES:", 27, 3);
kprintf("DS:", 38, 3);
kprintf("EAX:", 52, 3);
kprintf("EDI:", 3, 4);
kprintf("ESI:", 15, 4);
kprintf("EBP:", 27, 4);
kprintf("ESP:", 38, 4);
kprintf("EBX:", 52, 4);
kprintf("EDX:", 65, 4);
kprintf("ECX:", 3, 5);
kprintf("EIP:", 15, 5);
kprintf("CS:", 27, 5);
kprintf("EFLAGS:", 38, 5);
kprintf("USERSP:", 52, 5);
kprintf("SS:", 65, 5);
// Stop the CPU
kprintf("System halted!", 0, 6);
SetCursor(0, 7);
asm volatile ("hlt");
}