Newer
Older
tree-os / src / kernel / drivers / interrupts / irqs.asm
@lukas lukas on 1 Jan 2022 654 bytes code cleanup: lists
%macro irq 1
    global irqHandler%1
    irqHandler%1:
        cli
        push byte 0
        push byte %1+32
        jmp irqHandler
%endmacro

irqs:
    irq 0
    irq 1
    irq 2
    irq 3
    irq 4
    irq 5
    irq 6
    irq 7
    irq 8
    irq 9
    irq 10
    irq 11
    irq 12
    irq 13
    irq 14
    irq 15

extern handleIRQ

irqHandler:
    cli
    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, handleIRQ
    call eax
    pop eax
    pop gs
    pop fs
    pop es
    pop ds
    popa
    add esp, 8
    sti
    iret