From 147dfc2374b9b05bf2da49ab663c0b0bc28bda63 Mon Sep 17 00:00:00 2001 From: Baptiste Wicht Date: Fri, 18 Oct 2013 22:36:15 +0200 Subject: [PATCH] Add IRQ handlers system --- src/interrupts.asm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/interrupts.asm b/src/interrupts.asm index 9491728a..e5638689 100644 --- a/src/interrupts.asm +++ b/src/interrupts.asm @@ -62,6 +62,14 @@ _irq%1: ; Disable interruptions to avoid being interrupted cli + mov rax, [irq_handlers + 8 *%1] + cmp rax, 0 + + je .eoi + call rax + + .eoi: + mov rax, %1 ; IRQ number cmp rax, 8 jl .master @@ -214,3 +222,7 @@ IDT64: IDTR64: dw (256 * 16) - 1 ; Limit dq IDT64 ; Base + +; Handlers for each IRQ, 0 indicate no handler +irq_handlers: + times 16 dq 0