2021-07-16 01:03:20 +00:00
|
|
|
.section .text
|
|
|
|
|
|
|
|
isr:
|
|
|
|
pushal
|
|
|
|
pushl %esp
|
2021-07-17 22:08:00 +00:00
|
|
|
addl $32, (%esp)
|
2021-07-16 01:03:20 +00:00
|
|
|
call interrupt_handler
|
|
|
|
add $4, %esp
|
|
|
|
popal
|
2021-07-16 13:11:48 +00:00
|
|
|
add $8, %esp
|
2021-07-16 01:03:20 +00:00
|
|
|
iret
|
|
|
|
|
2021-07-17 22:08:00 +00:00
|
|
|
#define isr_callback_error(NAME, VECTOR)\
|
|
|
|
.global NAME; \
|
|
|
|
NAME: \
|
|
|
|
pushl $VECTOR; \
|
|
|
|
jmp isr
|
|
|
|
|
|
|
|
#define isr_callback_no_error(NAME, VECTOR)\
|
|
|
|
.global NAME ; \
|
|
|
|
NAME: \
|
|
|
|
pushl $0; \
|
|
|
|
pushl $VECTOR; \
|
|
|
|
jmp isr
|
|
|
|
|
|
|
|
isr_callback_no_error(isr_divide, 0)
|
|
|
|
isr_callback_no_error(isr_debug, 1)
|
|
|
|
isr_callback_no_error(isr_nmi, 2)
|
|
|
|
isr_callback_no_error(isr_breakpoint, 3)
|
|
|
|
isr_callback_no_error(isr_overflow, 4)
|
|
|
|
isr_callback_no_error(isr_bound_range_exceeded, 5)
|
|
|
|
isr_callback_no_error(isr_invalid_opcode, 6)
|
|
|
|
isr_callback_no_error(isr_device_not_available, 7)
|
|
|
|
isr_callback_no_error(isr_double_fault, 8)
|
|
|
|
isr_callback_no_error(isr_coprocessor_segment_overrun, 9)
|
|
|
|
isr_callback_error(isr_invalid_tss, 10)
|
|
|
|
isr_callback_error(isr_segment_not_present, 11)
|
|
|
|
isr_callback_error(isr_stack_segment_fault, 12)
|
|
|
|
isr_callback_error(isr_general_protection, 13)
|
|
|
|
isr_callback_error(isr_page_fault, 14)
|
|
|
|
isr_callback_no_error(isr_fpu_floating_point_error, 16)
|
|
|
|
isr_callback_error(isr_alignment_check, 17)
|
|
|
|
isr_callback_no_error(isr_machine_check, 18)
|
|
|
|
isr_callback_no_error(isr_simd_floating_point_exception, 19)
|
|
|
|
isr_callback_no_error(isr_virtualization_exception, 20)
|
|
|
|
isr_callback_error(isr_control_protection_exception, 21)
|
2021-07-26 09:17:52 +00:00
|
|
|
isr_callback_no_error(isr_pit, 32)
|
2021-07-21 18:30:55 +00:00
|
|
|
isr_callback_no_error(isr_keyboard, 33)
|