my exception handler sucked so i redid it
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user