160 lines
2.5 KiB
NASM
160 lines
2.5 KiB
NASM
|
bits 32
|
||
|
|
||
|
; !!! IRQ !!!
|
||
|
global _i86_irq0
|
||
|
global _i86_irq1
|
||
|
global _i86_irq2
|
||
|
global _i86_irq3
|
||
|
global _i86_irq4
|
||
|
global _i86_irq5
|
||
|
global _i86_irq6
|
||
|
global _i86_irq7
|
||
|
global _i86_irq8
|
||
|
global _i86_irq9
|
||
|
global _i86_irq10
|
||
|
global _i86_irq11
|
||
|
global _i86_irq12
|
||
|
global _i86_irq13
|
||
|
global _i86_irq14
|
||
|
global _i86_irq15
|
||
|
|
||
|
; 32: IRQ0
|
||
|
_i86_irq0:
|
||
|
cli
|
||
|
push byte 0
|
||
|
push byte 32; Note that these don't push an error code on the stack:
|
||
|
; We need to push a dummy error code
|
||
|
jmp irq_common_stub
|
||
|
|
||
|
; 33: IRQ1
|
||
|
_i86_irq1:
|
||
|
cli
|
||
|
push byte 0
|
||
|
push byte 33
|
||
|
jmp irq_common_stub
|
||
|
|
||
|
; 34: IRQ2
|
||
|
_i86_irq2:
|
||
|
cli
|
||
|
push byte 0
|
||
|
push byte 34
|
||
|
jmp irq_common_stub
|
||
|
|
||
|
; 35: IRQ3
|
||
|
_i86_irq3:
|
||
|
cli
|
||
|
push byte 0
|
||
|
push byte 35
|
||
|
jmp irq_common_stub
|
||
|
|
||
|
; 36: IRQ4
|
||
|
_i86_irq4:
|
||
|
cli
|
||
|
push byte 0
|
||
|
push byte 36
|
||
|
jmp irq_common_stub
|
||
|
|
||
|
; 37: IRQ5
|
||
|
_i86_irq5:
|
||
|
cli
|
||
|
push byte 0
|
||
|
push byte 37
|
||
|
jmp irq_common_stub
|
||
|
|
||
|
; 38: IRQ6
|
||
|
_i86_irq6:
|
||
|
cli
|
||
|
push byte 0
|
||
|
push byte 38
|
||
|
jmp irq_common_stub
|
||
|
|
||
|
; 39: IRQ7
|
||
|
_i86_irq7:
|
||
|
cli
|
||
|
push byte 0
|
||
|
push byte 39
|
||
|
jmp irq_common_stub
|
||
|
|
||
|
; 40: IRQ8
|
||
|
_i86_irq8:
|
||
|
cli
|
||
|
push byte 0
|
||
|
push byte 40
|
||
|
jmp irq_common_stub
|
||
|
; 41: IRQ9
|
||
|
_i86_irq9:
|
||
|
cli
|
||
|
push byte 0
|
||
|
push byte 41
|
||
|
jmp irq_common_stub
|
||
|
|
||
|
; 42: IRQ10
|
||
|
_i86_irq10:
|
||
|
cli
|
||
|
push byte 0
|
||
|
push byte 42
|
||
|
jmp irq_common_stub
|
||
|
|
||
|
; 43: IRQ11
|
||
|
_i86_irq11:
|
||
|
cli
|
||
|
push byte 0
|
||
|
push byte 43
|
||
|
jmp irq_common_stub
|
||
|
|
||
|
; 44: IRQ12
|
||
|
_i86_irq12:
|
||
|
cli
|
||
|
push byte 0
|
||
|
push byte 44
|
||
|
jmp irq_common_stub
|
||
|
|
||
|
; 45: IRQ13
|
||
|
_i86_irq13:
|
||
|
cli
|
||
|
push byte 0
|
||
|
push byte 45
|
||
|
jmp irq_common_stub
|
||
|
|
||
|
; 46: IRQ14
|
||
|
_i86_irq14:
|
||
|
cli
|
||
|
push byte 0
|
||
|
push byte 46
|
||
|
jmp irq_common_stub
|
||
|
|
||
|
; 47: IRQ15
|
||
|
_i86_irq15:
|
||
|
cli
|
||
|
push byte 0
|
||
|
push byte 47
|
||
|
jmp irq_common_stub
|
||
|
|
||
|
extern _i86_irq_handler
|
||
|
|
||
|
; This is a stub that we have created for IRQ based ISRs. This calls
|
||
|
; '_i86_irq_handler' in our C code. We need to create this in an 'irq.c'
|
||
|
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
|
||
|
mov eax, _i86_irq_handler
|
||
|
call eax
|
||
|
pop eax
|
||
|
pop gs
|
||
|
pop fs
|
||
|
pop es
|
||
|
pop ds
|
||
|
popa
|
||
|
add esp, 8
|
||
|
iret
|