The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: Geryon on July 01, 2005, 09:08:58 PM

Title: What is wrong with WindowsXP GDT ?
Post by: Geryon on July 01, 2005, 09:08:58 PM
Global Descriptor Table
Base: 8003F000   Limit: 000003FF

Base   — Segment base address
Limit   — Segment Limit
DPL   — Descriptor privilege level
P   — Segment present
G   — Granularity

-------------------------------------------------------------------------------
Sel.  Base      Limit     DPL  P   G    Description
-------------------------------------------------------------------------------
0008  00000000  FFFFFFFF   0   P   4Kb  Execute/Read, accessed
0010  00000000  FFFFFFFF   0   P   4Kb  Read/Write, accessed
0018  00000000  FFFFFFFF   3   P   4Kb  Execute/Read, accessed
0020  00000000  FFFFFFFF   3   P   4Kb  Read/Write, accessed
0028  80042000  000020AB   0   P   1b   32-Bit TSS (Busy)

********************************************************************

Look at GDTs Base . It must be a physical addressi,  is it right ?
i have only 256MB RAM but this gdt base is above 2GB

how could it be ? ? ?
Title: Re: What is wrong with WindowsXP GDT ?
Post by: rea on July 01, 2005, 09:29:06 PM
Page translation I guess.
Title: Re: What is wrong with WindowsXP GDT ?
Post by: Geryon on July 01, 2005, 10:02:49 PM
Page translation needs valid segment descriptors..
Title: Re: What is wrong with WindowsXP GDT ?
Post by: roticv on July 02, 2005, 02:00:27 AM
The segment descriptors are valid. You need to take a look at the page tables too.
Title: Re: What is wrong with WindowsXP GDT ?
Post by: Geryon on July 02, 2005, 08:14:35 AM
hmmm...
is gdt base  a Linear address ???
(http://criminal2.hypermart.net/pg.JPG)
Title: Re: What is wrong with WindowsXP GDT ?
Post by: The Dude of Dudes on July 02, 2005, 02:44:56 PM
It is a linear address (translated via page tables). Quote from the Intel Instruction Set Manual:


(LGDT LIDT) are the only instructions that directly load a linear address (that is, not a segment relative address) and a limit in protected mode.

I would assume this means a segment base value of 0 is used.
Title: Re: What is wrong with WindowsXP GDT ?
Post by: Geryon on July 02, 2005, 03:00:33 PM
thank you
Title: Re: What is wrong with WindowsXP GDT ?
Post by: ToutEnMasm on July 11, 2005, 12:38:51 PM
Hello,
GetThreadSelectorEntry can be used instead of LDT GDT to obtain the same result.
                                                     ToutEnMasm