diff --git a/Architecture/amd64/cpu/InterruptDescriptorTable.cpp b/Architecture/amd64/cpu/InterruptDescriptorTable.cpp index a7944b1..3cf6f9c 100644 --- a/Architecture/amd64/cpu/InterruptDescriptorTable.cpp +++ b/Architecture/amd64/cpu/InterruptDescriptorTable.cpp @@ -63,6 +63,7 @@ namespace InterruptDescriptorTable extern "C" __naked __used __no_stack_protector __aligned(16) void ExceptionHandlerStub() { asm("cld\n" + "cli\n" "pushq %rax\n" "pushq %rbx\n" @@ -107,6 +108,7 @@ namespace InterruptDescriptorTable extern "C" __naked __used __no_stack_protector __aligned(16) void InterruptHandlerStub() { asm("cld\n" + "cli\n" "pushq %rax\n" "pushq %rbx\n" @@ -145,6 +147,7 @@ namespace InterruptDescriptorTable "addq $16, %rsp\n" + "sti\n" "iretq"); // pop CS RIP RFLAGS SS RSP } diff --git a/Kernel.cpp b/Kernel.cpp index 8d1c048..1f40ede 100644 --- a/Kernel.cpp +++ b/Kernel.cpp @@ -74,8 +74,8 @@ LockClass mExtTrkLock; * - [ ] Rework the stack guard. * * ISSUES: - * - [ ] Kernel stack is smashed when an interrupt occurs. (this bug it occurs when an interrupt like IRQ1 or IRQ12 occurs) - * - [?] After setting the new stack pointer, the kernel crashes with an invalid opcode. + * - [x] Kernel stack is smashed when an interrupt occurs. (this bug it occurs when an interrupt like IRQ1 or IRQ12 occurs) + * - [x] After setting the new stack pointer, the kernel crashes with an invalid opcode. * - [ ] Somewhere in the kernel, the memory is wrongly freed or memcpy/memset. * - [ ] GlobalDescriptorTable::SetKernelStack() is not working properly. * - [ ] Sometimes while the kernel is inside BeforeShutdown(), we end up in a deadlock.