summaryrefslogtreecommitdiff
path: root/src/kernel.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/kernel.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/kernel.asm')
-rw-r--r--src/kernel.asm13
1 files changed, 13 insertions, 0 deletions
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 $