summaryrefslogtreecommitdiff
path: root/src/idt/idt.asm
diff options
context:
space:
mode:
authorCarlos Maiolino <[email protected]>2025-08-01 21:03:16 +0200
committerCarlos Maiolino <[email protected]>2025-08-01 21:03:16 +0200
commit2725b95a1f78d2feac553d37252f2e560c2f9aac (patch)
tree3e68aaf21c25fc2a46e3ee29fb4f23b188e3b3a4 /src/idt/idt.asm
parent57d8e2b236c7a185bdd941c247ef0dcc5961a24e (diff)
Setup interrupt handling
Remap master PIC to IOAddress 0x20 to avoid collisions with CPU exceptions. Setup a default interrupt handler and map all interrupts to this handler by default. Setup a Keyboard interrupt handler for testing purposes Wire everything up in the Makefile Signed-off-by: Carlos Maiolino <[email protected]>
Diffstat (limited to 'src/idt/idt.asm')
-rw-r--r--src/idt/idt.asm24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/idt/idt.asm b/src/idt/idt.asm
index 998a242..235f46b 100644
--- a/src/idt/idt.asm
+++ b/src/idt/idt.asm
@@ -1,6 +1,12 @@
section .asm
-global idt_load:
+extern int21h_handler
+extern default_int_handler
+
+global int21h
+global default_handler
+global idt_load
+
idt_load:
push ebp
@@ -11,3 +17,19 @@ idt_load:
pop ebp
ret
+
+int21h:
+ cli
+ pushad ; Push all general-purpose registers to the stack
+ call int21h_handler
+ popad
+ sti
+ iret
+
+default_handler:
+ cli
+ pushad ; Push all general-purpose registers to the stack
+ call default_int_handler
+ popad
+ sti
+ iret