intel IA32e 64 bit mode confusion

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
User avatar
Zacariaz
Member
Member
Posts: 1069
Joined: Tue May 22, 2007 2:36 pm
Contact:

intel IA32e 64 bit mode confusion

Post by Zacariaz »

Well, lets take it from the start.

Before entering, what intel call, IA32e 64 bit mode, one must first enter protected mode. So far so good. In order to do that one must set some descriptors and stuff, change a bit, and then we are in protected mode, and now the comfusion starts, bacause the intel manual states that: "in 64 bit mode segmentation is generally (but not completely) disabled" What does the middle part really mean? Further more in 64 bit mode discriptors is expanded to 80 bit, and wont that cause trouble as the previously loaded discriptors is 48 bit? Is paging really disabled? do you have to use pages? etc.
I have many more questions, but i guess the real question is if somebody know a guide/tutorial or simple sourcecode avalible.

Maybe i just have no idea what im talking about, but ill hope for an answer.

Thanks
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 »

for long mode, limit checking is disabled, and the base is used only for FS and GS.

When loading the gdt (or idt), the bits that are not specified are filled in with zeroes by the processor, so that when lgdt is issued from real/protected mode the top 32 bits of the base are zeroed out.
"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 ]
User avatar
bluecode
Member
Member
Posts: 202
Joined: Wed Nov 17, 2004 12:00 am
Location: Germany
Contact:

Re: intel IA32e 64 bit mode confusion

Post by bluecode »

Zacariaz wrote:Further more in 64 bit mode discriptors is expanded to 80 bit, and wont that cause trouble as the previously loaded discriptors is 48 bit?
The GDT descriptors are still 8byte, but most of the information is ignored (look in the intel/amd manual, there is a nice colourfull diagramm). But the IDT descriptors are 18Byte wide and look quite different. The base address of fs/gs is not taken from the descriptor but from some weired MSR.
Is paging really disabled? do you have to use pages?
yes, paging must be enabled, otherwise your not in long mode.
Post Reply