StupidOS/kernel/isr.inc

89 lines
1.2 KiB
PHP
Raw Permalink Normal View History

2024-07-14 09:22:43 +00:00
;; File: isr.inc
2024-07-10 10:56:53 +00:00
macro ISR [name,error] {
forward
dd isr_#name
2024-07-14 09:22:43 +00:00
forward
local szIntName
szIntName db `name#, 0
2024-07-10 10:56:53 +00:00
forward
isr_#name#:
cli
2024-07-14 09:22:43 +00:00
mov esi, szIntName
call klog
2024-07-10 10:56:53 +00:00
if error eq 0
push 0
end if
push error
jmp isr_common
2024-07-10 06:17:00 +00:00
}
2024-07-14 09:22:43 +00:00
irq_dummy:
iret
2024-07-10 06:17:00 +00:00
isr_common:
pusha
mov ax, ds
push eax
mov ax, 0x10
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
2024-07-14 09:22:43 +00:00
mov eax, [esp+IntFrame.intno]
push eax
2024-07-13 07:43:27 +00:00
mov esi, szMsgInterrupt
call klog
2024-07-10 06:17:00 +00:00
pop eax
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
popa
add esp, 8
sti
iret
2024-07-10 10:56:53 +00:00
2024-07-13 07:43:27 +00:00
aISRTable:
2024-07-10 10:56:53 +00:00
ISR \
division_by_zero, 0, \
debug, 0, \
nmi, 0, \
breakpoint, 0, \
overflow, 0, \
bound_range_exceeded, 0, \
invalid_opcode, 0, \
device_not_available, 0, \
double_fault, 1, \
coproc_seg_overrun, 0, \
invalid_tss, 1, \
seg_not_present, 1, \
stack_seg_fault, 1, \
general_protection_fault, 1, \
page_fault, 1, \
reserved15, 0, \
x87_exception, 0, \
alignment_check, 0, \
machine_check, 0, \
simd_exception, 0, \
virt_exception, 0, \
reserved21, 0, \
reserved22, 0, \
reserved23, 0, \
reserved24, 0, \
reserved25, 0, \
reserved26, 0, \
reserved27, 0, \
reserved28, 0, \
reserved29, 0, \
security_exception, 0, \
reserved31, 0
2024-07-13 07:43:27 +00:00
2024-07-14 09:22:43 +00:00
szMsgInterrupt db "Interrupt (int: %x)", 0