Looking at the Bochs log, I was able to find this gem of information: 00007381864e[CPU0 ] iret: SS selector null
Does this have to do with my TSS?
I modified my descriptor to be:
Code: Select all
gdt_set_gate(5, tss, 103, 0x89, 0); // TSS descriptor
Code: Select all
void gdt_set_gate(int num, unsigned long base, unsigned long limit, unsigned char access, unsigned char gran)
{
// Setup the descriptor base address
gdt[num].base_low = (base & 0xFFFF);
gdt[num].base_middle = (base >> 16) & 0xFF;
gdt[num].base_high = (base >> 24) & 0xFF;
// Setup the descriptor limits
gdt[num].limit_low = (limit & 0xFFFF);
gdt[num].granularity = ((limit >> 16) & 0x0F);
// Set up the granularity and access flags
gdt[num].granularity |= (gran & 0xF0);
gdt[num].access = access;
}