From 9869d1022a44874083664b0c1a14cbc26b4e187e Mon Sep 17 00:00:00 2001 From: Drew Galbraith Date: Mon, 29 May 2023 22:07:47 -0700 Subject: [PATCH] Mask all interrupts on the master PIC except the timer. This prevents us from getting a GP fault when an unhandled interrupt arises. --- zion/interrupt/interrupt.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zion/interrupt/interrupt.cpp b/zion/interrupt/interrupt.cpp index 76da596..bc0b5f2 100644 --- a/zion/interrupt/interrupt.cpp +++ b/zion/interrupt/interrupt.cpp @@ -129,6 +129,9 @@ void EnablePic() { outb(PIC1_DATA, 0x20); // PIC1 offset. outb(PIC1_DATA, 0x4); outb(PIC1_DATA, 0x1); + + // Mask all except the timer. + outb(PIC1_DATA, 0xE); } void InitIdt() {