Code: Select all
void isr_handler(registers_t regs)
{
printf("Received Interrupt %d:%p\n",regs.int_no, regs.err_code);
return;
}
Code: Select all
asm volatile ("int $0x03");
I decided to keep track of how many int 13's I received before the machine triple faulted, so I changed my handler to this:
Code: Select all
int previous_interrupts
void isr_handler(registers_t regs)
{
printf("Received %d interrupts before this one. Int no: %d", previous_interrupts, regs.int_no);
++previous_interrupts;
return;
}
I played around trying to get the int 13 to occur again and I've discovered that int 13 only happens when the last part of my ISR handler's code is a printf() call. As long as the last statement in my ISR handler is not a printf() call, then there is no issue. I've also noticed that the error codes for the int 13 are different every once in a while. The one thing they have in common is that they all refer to ridiculously large entries in my nonexistent LDT. It also doesn't seem to matter which interrupt is the one to call my handler the first time.
Does anyone have any idea as to what's going on?