I am having issues with enabling interrupts for my operating system, IcarusOS. It seems to be only crashing when I enable interrupts. I have checked thoroughly through my GDT, IDT, and IRQ handlers and I cannot seem to find anything that is definitively wrong with the initialization. I compiled a brief list of some things I have gone through in order to debug the system with no success.
- Everything runs fine when stepping through QEMU with GDB. Hangs on the infinite loop in kernel_main indefinitely. When I use the command continue without any breakpoints, however, QEMU crashes.
- I have stepped through and made sure that GDT is set up properly. While I believe the setup is accurate, I'm open to feedback if any adjustments are needed. I've included a screenshot of the GDT setup for reference
- The "I can't get interrupts working" page refers to accidentally setting up timer interrupt on vector 8, https://wiki.osdev.org/I_Can't_Get_Inte ... interrupts. I do not think this is my case, however, because the PIC remapping I did was very much identical to the wiki page's remapping.
- The irq routines seems to point to the handler function for the timer, as shown by GDB.
- It does not seem to crash QEMU until an interrupt is called for the PIT.
The source code can be found at https://github.com/Coalby/IcarusOS. I added the object files and iso image before posting this because I thought it would save you guys some time if you want to run it locally. I apologize in advance for the messy code. I have been trying to write cleaner code lately and will be actively trying to fix it up this weekend. Any help would be greatly appreciated! Please let me know if I can give any more information that can help you.