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/kernel.asm | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/kernel.asm') diff --git a/src/kernel.asm b/src/kernel.asm index 252fd7b..bd22761 100644 --- a/src/kernel.asm +++ b/src/kernel.asm @@ -24,6 +24,19 @@ _start: or al, 2 out 0x92, al + + ; Remap master PIC + mov al, 00010001b + out 0x20, al ; MasterPIC + + mov al, 0x20 ; Start master ISR at 0x20 + out 0x21, al + + mov al, 00000001b ; Put the PIC in x86 mode + out 0x21, al + + sti + ; Jump to C code call start_kernel jmp $ -- cgit v1.2.3