My OS is triple faulting when I load my GDT.
I am following these two articles from the osdev wiki:
https://wiki.osdev.org/Global_Descriptor_Table
https://wiki.osdev.org/GDT_Tutorial
When I load my GDT I get a triple fault. I think it may have to do with this chunk of code:
global loadGDT
loadGDT:
mov ax, [esp + 4]
mov [gdtr], ax
mov eax, [esp + 8]
mov [gdtr + 2], eax
lgdt [gdtr]
ret
global reloadSegments
reloadSegments:
jmp 0x00:.reload_cs
.reload_cs:
mov ax, 0x00
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov ss, ax
ret
If it helps this is what is in my segments:
Code Segment:
Base: 0
Limit: 0xFFFFF
Access Byte: 10011011
Flags: 1000
Data Segment:
Base: 0
Limit: 0xFFFFF
Access Byte: 10010011
Flags: 1000
The reason I changed the 0x08 and 0x10 is because that didn’t work either so I changed it to 0 since the base of both my segments is 0.