First post, by ThatGuy2244@live.com
I am trying to make a DOS program that is 32-bit, but when I try to enter 32-bit mode I get an error from DOSbox ("exit on error: JMP Invalid Descriptor Type 0"). I have tried different things to try to fix or isolate this problem and it seems to have nothing to do with the descriptors I set up, but only has a problem with my JMP instruction to a 32-bit descriptor. My code for entering the 32-bit environment is:
clilgdt [GDT]mov eax, cr0or eax, 1mov cr0, eaxstijmp 0x08:PModeGDT:dw GDTEnd - GDTStart - 1dd GDTStartGDTStart:dd 0x00000000 ;Descriptor 0 Nulldd 0x00000000dw 0xffff ;Descriptor 1 Codedw 0x0000db 0x00db 10011010bdb 11001111bdb 0x00dw 0xffff ;Descriptor 2 Datadw 0x0000db 0x00db 10010010bdb 11001111bdb 0x00GDTEnd:
My descriptors are set up to be a flat memory model for data and code.