Invalid Gate Descriptor: Long Mode Code

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.
Post Reply
Fear
Member
Member
Posts: 39
Joined: Wed May 24, 2006 11:00 pm

Invalid Gate Descriptor: Long Mode Code

Post by Fear »

I haven't solved my problem with the externals quite yet, but I think I've found the problem. I initially discounted these errors, thinking that Bochs was just emulating slightly improperly, but the more I think about it, the more it makes sense that those errors would occur. See, Bochs is reporting this error to me:

Code: Select all

interrupt(long mode): gate descriptor is not valid sys seg
So, to my understanding something is wrong with the long mode code section in my GDT. I'm not really sure why this is happening, but I guess something is just a drop off (or maybe a lot off). My whole GDT looks like:

Code: Select all

GDT:
	.GDTNull:
		DD 		0
		DD 		0
    
	.GDTData:
		DW 		0FFFFh
		DW 		0
		DB 		0
		DB 		10010010b
		DB 		10001111b
		DB 		0
	
	.GDTCode:
		DW 		0FFFFh
		DW 		0
		DB 		0
		DB 		10011010b
		DB 		11001111b
		DB 		0
		
	.GDTLong:
		DW 		0FFFFh
		DW 		0
		DB 		0
		DB 		10011010b
		DB		10101111b
		DB		0
GDTEnd:
So, does anyone see whats causing the error?

EDIT: Turns out, I found a workaround for the external things, nothing permanent but it'll do for now. But still, is there a reason Bochs is giving me this error (maybe its not actually an error)?
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post by Combuster »

Since it regards an interrupt, posting the IDT would probably be more helpful.

I haven't found any issues in the GDT though...
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply