my exception handler sucked so i redid it

This commit is contained in:
2025-06-05 17:32:38 -04:00
parent 87e5e06142
commit 79f04df82e
4 changed files with 73 additions and 20 deletions

View File

@ -1,27 +1,61 @@
extern exception_handler
extern exception_handler_err
%macro isr_err_stub 1
isr_stub_%+%1:
pushad
cld
push dword %1
call exception_handler
pop eax ; make sure to pop off the dword!!
popad
iret
;pushad
;cld
;push dword %1
;call exception_handler_err
;pop eax ; pop the error
;pop eax ; make sure to pop off the dword!!
;popad
;iret
push dword %1 ; push the interrupt number
jmp common_interrupt_handler
%endmacro
%macro isr_no_err_stub 1
isr_stub_%+%1:
pushad
cld
;pushad
;cld
;push dword %1
;call exception_handler
;pop eax
;popad
;iret
push dword 0
push dword %1
call exception_handler
pop eax
popad
iret
jmp common_interrupt_handler
%endmacro
common_interrupt_handler:
; lets save the registers
push eax
push ebx
push ecx
push edx
push esi
push edi
push ebp
call exception_handler
; restore the registers
pop ebp
pop edi
pop esi
pop edx
pop ecx
pop ebx
pop eax
; restore the esp
add esp, 8
iret
isr_no_err_stub 0
isr_no_err_stub 1
isr_no_err_stub 2