LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 03-14-2015, 09:31 AM   #1
xsecuritym
LQ Newbie
 
Registered: Feb 2015
Posts: 2

Rep: Reputation: Disabled
Smile Address of gdtr register


I am not clear about the address of gdtr.

from the book "Understanding The Linux Kernel". 2.2.2 Segment Descriptor( page 38)

"The address of the GDT in main memory is contained in the gdtr processor register and the address of the currently used LDT is contained in the ldtr processor egister."

My question: is the address in gdtr logical address/linear address or physical address?

I think it should be physical address, because paging has not implemented before that. Need someone help to confirm it and provide better explanation

Another question about paragraph: book "Understanding The Linux Kernel". 2.2.4 Segment Linux (page 43).

For each process, therefore, the GDT contains two different Segment Descriptors: one for the TSS segment and one for the LDT segment. The maximum number of entries allowed in the GDT is 12+2xNR_TASKS, where, in turn, NR_TASKS denotes the maximum number of processes.where, in turn, NR_TASKS denotes the maximum number of processes. In the previous list we described the six main Segment Descriptors used by Linux. Four additional Segment Descriptors cover Advanced Power Management (APM) features, and four entries of the GDT are left unused, for a grand total of 14.

12+2xNR TASKS, where does the 12 come from? I think it should be 14 as "In the previous list we described the six main Segment Descriptors used by Linux. Four additional Segment Descriptors cover Advanced Power Management (APM) features, and four entries of the GDT are left unused, for a grand total of 14."

I might misunderstand something, please help to make me clear.

Thanks, $XSM
 
Old 03-14-2015, 12:59 PM   #2
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Read x86 pentium intel manuals for reference.

Osdev site has also page on it.
 
Old 03-17-2015, 01:35 AM   #3
xsecuritym
LQ Newbie
 
Registered: Feb 2015
Posts: 2

Original Poster
Rep: Reputation: Disabled
2.4.1 Global Descriptor Table Register (GDTR)
The GDTR register holds the base address (32 bits in protected mode; 64 bits in
IA-32e mode) and the 16-bit table limit for the GDT. The base address specifies the
linear address of byte 0 of the GDT; the table limit specifies the number of bytes in
the table.
The LGDT and SGDT instructions load and store the GDTR register, respectively. On
power up or reset of the processor, the base address is set to the default value of 0
and the limit is set to 0FFFFH. A new base address must be loaded into the GDTR as
part of the processor initialization process for protected-mode operation.
See also: Section 3.5.1, Segment Descriptor Tables.

---------------------------------------
so it should be linear address of the 0 of GDT.
how could the linear address to be translate to physical address?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to register mcast address in c++ warint06 Programming 2 01-01-2013 02:57 PM
how does macro to get base address register in configuration space works jamesbon Programming 1 11-22-2010 07:19 PM
Base address for hardware pin and register..! cvr Linux - Hardware 1 07-22-2010 05:06 PM
dynamically register ip address to windows 2000 dns PantherSE Linux - Networking 0 06-23-2004 12:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 02:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration