2021-09-14 15:34:14 +00:00
|
|
|
bits 32
|
|
|
|
|
|
|
|
; !!! IRQ !!!
|
2021-09-14 15:48:57 +00:00
|
|
|
global Irq_0
|
|
|
|
global Irq_1
|
|
|
|
global Irq_2
|
|
|
|
global Irq_3
|
|
|
|
global Irq_4
|
|
|
|
global Irq_5
|
|
|
|
global Irq_6
|
|
|
|
global Irq_7
|
|
|
|
global Irq_8
|
|
|
|
global Irq_9
|
|
|
|
global Irq_10
|
|
|
|
global Irq_11
|
|
|
|
global Irq_12
|
|
|
|
global Irq_13
|
|
|
|
global Irq_14
|
|
|
|
global Irq_15
|
2021-09-14 15:34:14 +00:00
|
|
|
|
|
|
|
; 32: IRQ0
|
2021-09-14 15:48:57 +00:00
|
|
|
Irq_0:
|
2021-09-14 15:34:14 +00:00
|
|
|
cli
|
2021-09-14 15:52:47 +00:00
|
|
|
push dword 0
|
|
|
|
push dword 32; Note that these don't push an error code on the stack:
|
2021-09-14 15:34:14 +00:00
|
|
|
; We need to push a dummy error code
|
|
|
|
jmp irq_common_stub
|
|
|
|
|
|
|
|
; 33: IRQ1
|
2021-09-14 15:48:57 +00:00
|
|
|
Irq_1:
|
2021-09-14 15:34:14 +00:00
|
|
|
cli
|
2021-09-14 15:52:47 +00:00
|
|
|
push dword 0
|
|
|
|
push dword 33
|
2021-09-14 15:34:14 +00:00
|
|
|
jmp irq_common_stub
|
|
|
|
|
|
|
|
; 34: IRQ2
|
2021-09-14 15:48:57 +00:00
|
|
|
Irq_2:
|
2021-09-14 15:34:14 +00:00
|
|
|
cli
|
2021-09-14 15:52:47 +00:00
|
|
|
push dword 0
|
|
|
|
push dword 34
|
2021-09-14 15:34:14 +00:00
|
|
|
jmp irq_common_stub
|
|
|
|
|
|
|
|
; 35: IRQ3
|
2021-09-14 15:48:57 +00:00
|
|
|
Irq_3:
|
2021-09-14 15:34:14 +00:00
|
|
|
cli
|
2021-09-14 15:52:47 +00:00
|
|
|
push dword 0
|
|
|
|
push dword 35
|
2021-09-14 15:34:14 +00:00
|
|
|
jmp irq_common_stub
|
|
|
|
|
|
|
|
; 36: IRQ4
|
2021-09-14 15:48:57 +00:00
|
|
|
Irq_4:
|
2021-09-14 15:34:14 +00:00
|
|
|
cli
|
2021-09-14 15:52:47 +00:00
|
|
|
push dword 0
|
|
|
|
push dword 36
|
2021-09-14 15:34:14 +00:00
|
|
|
jmp irq_common_stub
|
|
|
|
|
|
|
|
; 37: IRQ5
|
2021-09-14 15:48:57 +00:00
|
|
|
Irq_5:
|
2021-09-14 15:34:14 +00:00
|
|
|
cli
|
2021-09-14 15:52:47 +00:00
|
|
|
push dword 0
|
|
|
|
push dword 37
|
2021-09-14 15:34:14 +00:00
|
|
|
jmp irq_common_stub
|
|
|
|
|
|
|
|
; 38: IRQ6
|
2021-09-14 15:48:57 +00:00
|
|
|
Irq_6:
|
2021-09-14 15:34:14 +00:00
|
|
|
cli
|
2021-09-14 15:52:47 +00:00
|
|
|
push dword 0
|
|
|
|
push dword 38
|
2021-09-14 15:34:14 +00:00
|
|
|
jmp irq_common_stub
|
|
|
|
|
|
|
|
; 39: IRQ7
|
2021-09-14 15:48:57 +00:00
|
|
|
Irq_7:
|
2021-09-14 15:34:14 +00:00
|
|
|
cli
|
2021-09-14 15:52:47 +00:00
|
|
|
push dword 0
|
|
|
|
push dword 39
|
2021-09-14 15:34:14 +00:00
|
|
|
jmp irq_common_stub
|
|
|
|
|
|
|
|
; 40: IRQ8
|
2021-09-14 15:48:57 +00:00
|
|
|
Irq_8:
|
2021-09-14 15:34:14 +00:00
|
|
|
cli
|
2021-09-14 15:52:47 +00:00
|
|
|
push dword 0
|
|
|
|
push dword 40
|
2021-09-14 15:34:14 +00:00
|
|
|
jmp irq_common_stub
|
|
|
|
; 41: IRQ9
|
2021-09-14 15:48:57 +00:00
|
|
|
Irq_9:
|
2021-09-14 15:34:14 +00:00
|
|
|
cli
|
2021-09-14 15:52:47 +00:00
|
|
|
push dword 0
|
|
|
|
push dword 41
|
2021-09-14 15:34:14 +00:00
|
|
|
jmp irq_common_stub
|
|
|
|
|
|
|
|
; 42: IRQ10
|
2021-09-14 15:48:57 +00:00
|
|
|
Irq_10:
|
2021-09-14 15:34:14 +00:00
|
|
|
cli
|
2021-09-14 15:52:47 +00:00
|
|
|
push dword 0
|
|
|
|
push dword 42
|
2021-09-14 15:34:14 +00:00
|
|
|
jmp irq_common_stub
|
|
|
|
|
|
|
|
; 43: IRQ11
|
2021-09-14 15:48:57 +00:00
|
|
|
Irq_11:
|
2021-09-14 15:34:14 +00:00
|
|
|
cli
|
2021-09-14 15:52:47 +00:00
|
|
|
push dword 0
|
|
|
|
push dword 43
|
2021-09-14 15:34:14 +00:00
|
|
|
jmp irq_common_stub
|
|
|
|
|
|
|
|
; 44: IRQ12
|
2021-09-14 15:48:57 +00:00
|
|
|
Irq_12:
|
2021-09-14 15:34:14 +00:00
|
|
|
cli
|
2021-09-14 15:52:47 +00:00
|
|
|
push dword 0
|
|
|
|
push dword 44
|
2021-09-14 15:34:14 +00:00
|
|
|
jmp irq_common_stub
|
|
|
|
|
|
|
|
; 45: IRQ13
|
2021-09-14 15:48:57 +00:00
|
|
|
Irq_13:
|
2021-09-14 15:34:14 +00:00
|
|
|
cli
|
2021-09-14 15:52:47 +00:00
|
|
|
push dword 0
|
|
|
|
push dword 45
|
2021-09-14 15:34:14 +00:00
|
|
|
jmp irq_common_stub
|
|
|
|
|
|
|
|
; 46: IRQ14
|
2021-09-14 15:48:57 +00:00
|
|
|
Irq_14:
|
2021-09-14 15:34:14 +00:00
|
|
|
cli
|
2021-09-14 15:52:47 +00:00
|
|
|
push dword 0
|
|
|
|
push dword 46
|
2021-09-14 15:34:14 +00:00
|
|
|
jmp irq_common_stub
|
|
|
|
|
|
|
|
; 47: IRQ15
|
2021-09-14 15:48:57 +00:00
|
|
|
Irq_15:
|
2021-09-14 15:34:14 +00:00
|
|
|
cli
|
2021-09-14 15:52:47 +00:00
|
|
|
push dword 0
|
|
|
|
push dword 47
|
2021-09-14 15:34:14 +00:00
|
|
|
jmp irq_common_stub
|
|
|
|
|
2021-09-14 15:48:57 +00:00
|
|
|
extern IrqHandler
|
2021-09-14 15:34:14 +00:00
|
|
|
|
|
|
|
; This is a stub that we have created for IRQ based ISRs. This calls
|
2021-09-14 15:48:57 +00:00
|
|
|
; 'Irq__handler' in our C code. We need to create this in an 'irq.c'
|
2021-09-14 15:34:14 +00:00
|
|
|
irq_common_stub:
|
|
|
|
pusha
|
|
|
|
push ds
|
|
|
|
push es
|
|
|
|
push fs
|
|
|
|
push gs
|
|
|
|
mov ax, 0x10
|
|
|
|
mov ds, ax
|
|
|
|
mov es, ax
|
|
|
|
mov fs, ax
|
|
|
|
mov gs, ax
|
|
|
|
mov eax, esp
|
|
|
|
push eax
|
2021-09-14 15:48:57 +00:00
|
|
|
mov eax, IrqHandler
|
2021-09-14 15:34:14 +00:00
|
|
|
call eax
|
|
|
|
pop eax
|
|
|
|
pop gs
|
|
|
|
pop fs
|
|
|
|
pop es
|
|
|
|
pop ds
|
|
|
|
popa
|
|
|
|
add esp, 8
|
|
|
|
iret
|