I finally decided to add a kernel panic screen to my OS instead of just printing out the error when I realized that I wasn't actually catching any exceptions (tested with a divide by zero code)
Instead, I would get a triple fault and reboot. All other interrupts seem to work (keyboard, syscalls, PIT, etc...) but my exception code doesn't seem to work :/
This is the code, every exception related ISR push their ID on the stack and an optional zero to keep the stack integrity when there is no additional code and calls it:
Code: Select all
_asm_fault_handler:
pusha
push %ds
push %es
push %fs
push %gs
mov $0x10, %ax
mov %ax, %ds
mov %ax, %es
mov %ax, %fs
mov %ax, %gs
movl %esp, %eax
push %eax
movl _fault_handler, %eax
call *%eax
pop %eax
pop %gs
pop %fs
pop %es
pop %ds
popa
add $8, %esp
iret