summaryrefslogtreecommitdiff
path: root/kernel/source/interrupts.asm
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/source/interrupts.asm')
-rw-r--r--kernel/source/interrupts.asm26
1 files changed, 24 insertions, 2 deletions
diff --git a/kernel/source/interrupts.asm b/kernel/source/interrupts.asm
index e4912ee..df8e7ce 100644
--- a/kernel/source/interrupts.asm
+++ b/kernel/source/interrupts.asm
@@ -267,6 +267,22 @@ isr_end:
ret
+extern on_rtc_interrupt
+
+rtc_isr:
+
+ call isr_start
+
+ call on_rtc_interrupt
+
+ mov al, 0x20
+ out 0x20, al
+ out 0xa0, al
+
+ call isr_end
+
+ iretq
+
extern on_keyboard_interrupt
keyboard_isr:
@@ -343,7 +359,7 @@ load_gdt_and_idt:
out 0x21, al
mov al, 0x01
out 0x21, al
- mov al, 0xf9 ;mask all but irq 1 and 2
+ mov al, 0xf9 ;mask all but irqs 1 and 2
out 0x21, al
mov al, 0x11
@@ -354,9 +370,15 @@ load_gdt_and_idt:
out 0xa1, al
mov al, 0x01
out 0xa1, al
- mov al, 0xef ;mask all but irq 12
+ mov al, 0xee ;mask all but irqs 8 and 12
out 0xa1, al
+ ;register rtc interrupt
+
+ mov rdi, 0x28
+ mov rsi, rtc_isr
+ call set_isr
+
;register keyboard and mouse interrupts
mov rdi, 0x21