luxos/Kernel/hal/cpu/isrs-asm.asm

218 lines
4.3 KiB
NASM
Raw Permalink Normal View History

2021-09-14 15:34:14 +00:00
bits 32
; !!! ISRs !!!
global isr_exception_0
global isr_exception_1
global isr_exception_2
global isr_exception_3
global isr_exception_4
global isr_exception_5
global isr_exception_6
global isr_exception_7
global isr_exception_8
global isr_exception_9
global isr_exception_10
global isr_exception_11
global isr_exception_12
global isr_exception_13
global isr_exception_14
global isr_exception_15
global isr_exception_16
global isr_exception_17
global isr_exception_18
global isr_exception_19
global isr_exception_20
global isr_exception_21
global isr_exception_22
global isr_exception_23
global isr_exception_24
global isr_exception_25
global isr_exception_26
global isr_exception_27
global isr_exception_28
global isr_exception_29
global isr_exception_30
global isr_exception_31
2021-09-14 15:34:14 +00:00
isr_exception_0:
2021-09-14 15:34:14 +00:00
cli
push dword 0; A normal ISR stub that pops a dummy error code to keep a
2021-09-14 15:34:14 +00:00
; uniform stack frame
push dword 0
2021-09-14 15:34:14 +00:00
jmp isr_common_stub
isr_exception_1:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 1
2021-09-14 15:34:14 +00:00
jmp isr_common_stub
isr_exception_2:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 2
2021-09-14 15:34:14 +00:00
jmp isr_common_stub
isr_exception_3:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 3
2021-09-14 15:34:14 +00:00
jmp isr_common_stub
isr_exception_4:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 4
2021-09-14 15:34:14 +00:00
jmp isr_common_stub
isr_exception_5:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 5
2021-09-14 15:34:14 +00:00
jmp isr_common_stub
isr_exception_6:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 6
2021-09-14 15:34:14 +00:00
jmp isr_common_stub
isr_exception_7:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 7
2021-09-14 15:34:14 +00:00
jmp isr_common_stub
isr_exception_8:
2021-09-14 15:34:14 +00:00
cli
push dword 8
2021-09-14 15:34:14 +00:00
jmp isr_common_stub
isr_exception_9:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 9
2021-09-14 15:34:14 +00:00
jmp isr_common_stub
isr_exception_10:
2021-09-14 15:34:14 +00:00
cli
push dword 10
2021-09-14 15:34:14 +00:00
jmp isr_common_stub
isr_exception_11:
2021-09-14 15:34:14 +00:00
cli
push dword 11
2021-09-14 15:34:14 +00:00
jmp isr_common_stub
isr_exception_12:
2021-09-14 15:34:14 +00:00
cli
push dword 12
2021-09-14 15:34:14 +00:00
jmp isr_common_stub
isr_exception_13:
2021-09-14 15:34:14 +00:00
cli
push dword 13
2021-09-14 15:34:14 +00:00
jmp isr_common_stub
isr_exception_14:
2021-09-14 15:34:14 +00:00
cli
push dword 14
2021-09-14 15:34:14 +00:00
jmp isr_common_stub
isr_exception_15:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 15
2021-09-14 15:34:14 +00:00
jmp isr_common_stub
isr_exception_16:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 16
2021-09-14 15:34:14 +00:00
jmp isr_common_stub
isr_exception_17:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 17
2021-09-14 15:34:14 +00:00
jmp isr_common_stub
isr_exception_18:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 18
2021-09-14 15:34:14 +00:00
jmp isr_common_stub
isr_exception_19:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 19
2021-09-14 15:34:14 +00:00
jmp isr_common_stub
isr_exception_20:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 20
2021-09-14 15:34:14 +00:00
jmp isr_common_stub
isr_exception_21:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 21
2021-09-14 15:34:14 +00:00
jmp isr_common_stub
isr_exception_22:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 22
2021-09-14 15:34:14 +00:00
jmp isr_common_stub
isr_exception_23:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 23
2021-09-14 15:34:14 +00:00
jmp isr_common_stub
isr_exception_24:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 24
2021-09-14 15:34:14 +00:00
jmp isr_common_stub
isr_exception_25:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 25
2021-09-14 15:34:14 +00:00
jmp isr_common_stub
isr_exception_26:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 26
2021-09-14 15:34:14 +00:00
jmp isr_common_stub
isr_exception_27:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 27
2021-09-14 15:34:14 +00:00
jmp isr_common_stub
isr_exception_28:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 28
2021-09-14 15:34:14 +00:00
jmp isr_common_stub
isr_exception_29:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 29
2021-09-14 15:34:14 +00:00
jmp isr_common_stub
isr_exception_30:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 30
2021-09-14 15:34:14 +00:00
jmp isr_common_stub
isr_exception_31:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 31
2021-09-14 15:34:14 +00:00
jmp isr_common_stub
extern IsrsFaultHandler
2021-09-14 15:34:14 +00:00
isr_common_stub:
pusha
push ds
push es
push fs
push gs
mov ax, 0x10 ; Load the Kernel Data Segment descriptor!
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov eax, esp ; Push us the stack
push eax
mov eax, IsrsFaultHandler
2021-09-14 15:34:14 +00:00
call eax ; A special call, preserves the 'eip' register
pop eax
pop gs
pop fs
pop es
pop ds
popa
add esp, 8 ; Cleans up the pushed error code and pushed ISR number
iret ; pops 5 things at once: CS, EIP, EFLAGS, SS, and ESP!