A few questions on GDT LDT IDT

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
miyano2005
Posts: 6
Joined: Thu Sep 06, 2007 8:44 am

A few questions on GDT LDT IDT

Post by miyano2005 »

Hello guys,
I am a newbie in OSdev. I have read about the GDT,LDT,IDT and other things like this.
What I am not certain about is whether the base address of ,say the GDT, you load into GDTR register is a linear address (virtual address) or a physical address?
If it is a linear address(virtual address), does that imply we have to have enabled and set up all the relevant registers in the paging unit before this base address value is loaded?
Thanks.
osmosys
Posts: 14
Joined: Sun Oct 05, 2008 4:33 am

Re: A few questions on GDT LDT IDT

Post by osmosys »

The values of GDTR, IDTR are the actual physical address. This physical address values get loaded into segment selectors.
Last edited by osmosys on Wed Nov 12, 2008 7:44 am, edited 2 times in total.
CodeCat
Member
Member
Posts: 158
Joined: Tue Sep 23, 2008 1:45 pm
Location: Eindhoven, Netherlands

Re: A few questions on GDT LDT IDT

Post by CodeCat »

Descriptor tables contain linear addresses only. The address translation process goes as follows:

selector -> GDT entry + offset -> linear address -> page directory + page table + page offset -> physical address
interrupt vector -> IDT entry -> linear address -> page directory + page table + page offset -> physical address

A segment can't be more than 4GB, while you can access more than 4GB using PAE page tables. So the reverse would make no sense.
Post Reply