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...
This commit is contained in:
Eryn Wells 2016-03-13 15:54:25 -04:00
parent 1f6ce53e08
commit 5e2c89e588

View file

@ -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");