From 2725b95a1f78d2feac553d37252f2e560c2f9aac Mon Sep 17 00:00:00 2001 From: Carlos Maiolino Date: Fri, 1 Aug 2025 21:03:16 +0200 Subject: 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 --- src/idt/idt.asm | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'src/idt/idt.asm') 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 -- cgit v1.2.3