holy crap im an idiot, i was getting constatnt gpf because i forgot to pop the stack

This commit is contained in:
2025-06-01 20:57:12 -04:00
parent ecc91fdc7d
commit 4c938a0855
7 changed files with 19 additions and 14 deletions

View File

@ -24,9 +24,13 @@ void exception_handler(unsigned int i)
if (i <= 31)
__asm__ volatile ("cli; hlt"); // hangs the computer
if (i == PIC_PIT) {
printf("Sending EOI instruction to PIT\n");
PIC_sendEOI(0);
if (i == PIC_KEYB) {
#ifdef __TESTING__
kinfo("Sending EOI instruction to KEYB");
#endif
printf("Scancode: %x\n", inb(0x60)); // read from kb
PIC_sendEOI(1);
}
}

View File

@ -6,6 +6,7 @@ isr_stub_%+%1:
cld
push dword %1
call exception_handler
pop eax ; make sure to pop off the dword!!
popad
iret
%endmacro
@ -16,6 +17,7 @@ isr_stub_%+%1:
cld
push dword %1
call exception_handler
pop eax
popad
iret
%endmacro