src/kernel/interrupts/isrs.c
/**
 * All of our Exception handling Interrupt Service Routines will point to this function. 
 * This will tell us what exception has happened.
 * Right now, we simply halt the system by hitting an endless loop. 
 * All ISRs disable interrupts while they are being serviced as a 'locking' mechanism 
 * to prevent an IRQ from happening and messing up kernel data structures.
 */
All of our Exception handling Interrupt Service Routines will point to this function.
This will tell us what exception has happened.
Right now, we simply halt the system by hitting an endless loop.
All ISRs disable interrupts while they are being serviced as a 'locking' mechanism
to prevent an IRQ from happening and messing up kernel data structures.
All of our Exception handling Interrupt Service Routines will point to this function . This will tell us what exception has happened . Right now we simply halt the system by hitting an endless loop . All ISRs disable interrupts while they are being serviced as a ' locking ' mechanism to prevent an IRQ from happening and messing up kernel data structures .
void isr_faultHandler(regs_t *r) {
    if (r->int_no < 32) {
        set_color(RED, BLACK);
        printf("Exception: %s (err code %x)\n", exception_messages[r->int_no], r->err_code);
        printf("DS:0x%x, CS:0x%x, ES:0x%x, GS:0x%x, FS:0x%x\n", r->ds, r->cs, r->es, r->gs, r->fs);
        printf("EAX:0x%x, EBX:0x%x, ECX:0x%x, EDX:0x%x\n", r->eax, r->ebx, r->ecx, r->edx);
        printf("ESP:0x%x, EBP:0x%x, EIP:0x%x, EDI:0x%x, ESI:0x%x\n", r->esp, r->ebp, r->eip, r->edi, r->esi);
        set_color(LIGHT_GREY, BLACK);
        for(;;) ;
    }
}
void isr_faultHandler ( regs_t * r ) { if ( r -> int_no < 32 ) { set_color ( RED , BLACK ) ; printf ( " \n " , exception_messages [ r -> int_no ] , r -> err_code ) ; printf ( " \n " , r -> ds , r -> cs , r -> es , r -> gs , r -> fs ) ; printf ( " \n " , r -> eax , r -> ebx , r -> ecx , r -> edx ) ; printf ( " \n " , r -> esp , r -> ebp , r -> eip , r -> edi , r -> esi ) ; set_color ( LIGHT_GREY , BLACK ) ; for ( ; ; ) ; } }
All of our Exception handling Interrupt Service Routines will point to this function.
All of our Exception handling Interrupt Service Routines will point to this function .
// An exception: print error.