Hi,
ScropTheOSAdventurer wrote:I don't think popping into GS is it. I added a panic function call to my general handler (and made it the first line), and the processor triple-faulted before the panic call happened, and thus before I popped into GS. Any other possibilities?
At the moment, the only information we have is that something somewhere causes an exception (and the CPU can't start the exception handler so it generates a double fault, and the CPU can't start the double fault exception handler so it generates a triple fault); and some code that looks OK. The problem/s could be anywhere; possibly including failing to load the GDT or IDT correctly, incorrect GDT or IDT entries, bad/wrong segment registers, bad stack (bad address, too small, etc), forgetting to enable A20, forgetting to reconfigure the PIC or IO APIC, a mistake in a page table, a bug in the boot loader (only loading 10 KiB of the kernel when the kernel is 16 KiB), memory management bugs (e.g. accidentally using a page of ROM as RAM), a random piece of code that (e.g.) uses an un-initialised pointer and trashes something, a mistake in the build scripts or makefiles or linker script or something, a bug in the compiler or assembler or linker or emulator (unlikely), etc.
Basically, we know nothing and the bug could be anything (and there may even be multiple bugs); and you need more information about what's going on. Did you try using something like Bochs debugger?
With Bochs alone (no debugger, just looking at the log) you should be able to determine which instruction caused the crash and if it was (e.g.) a general protection fault, a page fault, which values were in various registers when the triple fault occurred, etc. With Bochs debugger, you should be able to put a magic breakpoint ("xchg bx,bx") just before a software interrupt (e.g. "int 0x20") and single-step from the breakpoint up to the instruction that causes the problem; then examine the contents of registers, memory, the IDT, GDT, paging structures, etc (and double-check that they are all correct until you find something that isn't).
Cheers,
Brendan