From 5e2c89e5886bbd53340670c67f0bcead186eab71 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Sun, 13 Mar 2016 15:54:25 -0400 Subject: [PATCH] OMG INTERRUPTS ARE WORKING The segment selector that you put in the interrupt table is a byte offset, and *not* an index into the table. Now interrupts work! But only one. And I think I know how to fix this... --- src/Interrupts.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Interrupts.cc b/src/Interrupts.cc index 66e0e89..2b8f5fa 100644 --- a/src/Interrupts.cc +++ b/src/Interrupts.cc @@ -50,10 +50,12 @@ InterruptHandler::initialize() auto& console = kernel::Console::systemConsole(); for (size_t i = 0; i < IDT::Size; i++) { - mIDT.setDescriptor(i, IDT::DescriptorSpec::exceptionHandler(1, &unhandledInterrupt)); + mIDT.setDescriptor(i, IDT::DescriptorSpec::exceptionHandler(0x8, &unhandledInterrupt)); } + mIDT.setDescriptor(0x21, IDT::DescriptorSpec::exceptionHandler(0x8, &handleHardwareInterrupt1)); mIDT.load(); - console.printString("Interrupt table loaded\n"); + + console.printString("IDT loaded\n"); mPIC.initialize(0x20, 0x28); // Map hardware IRQs to interrupt vectors 32 through 48. console.printString("Hardware interrupts initialized\n");