Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
So I'm messing around with IA-32, I enabled the GDT and IDT, everything is working nicely. However, when I enable the IDT -- I get a double fault as the first exception!
I notice two things:
1. It seems like the hardware interrupts themselves are causing this to happen
2. The IDT looks like it's in the wrong place -- but that's only an assumption.
The modifications I've done to the code that differ from the stuff on Github is just a "cli" at the start of _start in stub.s. The source code is here: https://github.com/mxtlrr/theta
You need to remap the PICs. See https://wiki.osdev.org/8259_PIC . Without remapping IRQ0-IRQ7 the default is mapping them to exceptions 0x08 thru 0x0f. As I recall your code and stubs are set assuming the PICS are mapped from 0x20-0x27 (master PIC) and 0x28 to 0x2f (slave PIC).
Edit: I looked at your new repository. I see it is not really the old code at all. It is 32-bit and not 64-bit; the ISR routines don't save restore/registers etc; the error code isn't removed off exceptions with error codes etc. There is just a call to exception_handler followed by an iret. I cam confirm that the issue is that you enabled interrupts; got a timer interrupt; since the PICS haven't been remapped IRQ0 comes in on 0x08 which appears to your kernel to be a double exception fault (which it isn't). Once you properly remap the PICS you will need interrupt handlers for the external interrupts. Your code only has exception handlers (ISRs) for exceptions 0x00 to 0x1f so you will likely get general protection faults because of that.