1

I went through many of the tutorials available on the Net about the Global Descriptor Table. But I couldn't find a site which explains all the fields in the 64-bit descriptor in detail. Moreover I was stuck with the selector concept in the GDT. I know a selector has an Index, TI for whether GDT or LDT fields. In simple, What is the relation that relates a selector with the GDT? If possible please explain in detail.

Thank you..

Panther Coder
  • 1,058
  • 1
  • 16
  • 43
  • A selector is an index into the GDT or LDT. The TI bit tells you which. – Ross Ridge Jul 18 '16 at 03:57
  • Did you look in Intel's official docs? (links in [the x86 tag wiki](http://stackoverflow.com/tags/x86/info) Intel documents pretty much everything in full detail with diagrams in their PDFs. Also, did you check http://wiki.osdev.org/GDT points you to the right page of Intel's docs for the long-mode GDT. – Peter Cordes Jul 18 '16 at 07:24

1 Answers1

6

Assuming Protected Mode.

The 16 bits registers cs, ds, es, ss, fs and gs are called Selector registers, each contains a value called Selector.

A selector is made up of three fields:

Segment Selector

The Index and Table indicator select a Segment descriptor in an straightforward way:

Selection of a Descriptor

The general descriptor format is:

Descriptor


A complete reference can be found in Intel Manual 3A Chapters 3 - 7.

A short overview can be found in this other answer of mine.

Community
  • 1
  • 1
Margaret Bloom
  • 41,768
  • 5
  • 78
  • 124