fix: various kernel bug fixes

This commit is contained in:
2026-04-10 23:16:02 +02:00
parent 0433274244
commit fd7fcbbbc8
12 changed files with 282 additions and 163 deletions
+3 -3
View File
@@ -17,7 +17,6 @@
namespace Hal {
constexpr auto InterruptGate = 0x8E;
constexpr auto TrapGate = 0x8F;
InterruptDescriptor* IDT;
IDTRStruct IDTR{};
@@ -53,6 +52,7 @@ namespace Hal {
"Hypervisor Injection Exception",
"VMM Communication Exception",
"Security Exception",
"Reserved",
"Reserved"
};
@@ -196,7 +196,7 @@ namespace Hal {
// Use IST1 for NMI (2) and Double Fault (8) so they get a
// known-good stack even if the kernel stack has overflowed.
uint8_t ist = (I == 2 || I == 8) ? 1 : 0;
IDTEncodeInterrupt(I, (void*)ExceptionHandler<I>, TrapGate, ist);
IDTEncodeInterrupt(I, (void*)ExceptionHandler<I>, InterruptGate, ist);
SetHandler<I+1,N>::run();
}
};
@@ -211,7 +211,7 @@ namespace Hal {
IDTR.Base = (uint64_t)IDT;
Kt::KernelLogStream(Kt::DEBUG, "IDT") << "Set IDTR Base to " << base::hex << IDTR.Base << " and Limit to " << base::hex << IDTR.Limit;
SetHandler<0, 31>::run();
SetHandler<0, 32>::run();
Kt::KernelLogStream(Kt::OK, "Hal") << "Created exception interrupt vectors";