0

how does GDT reflected on linear space of process ( if I understand it right, GDTR contains page and offset ) .? or another version of this question : GDTR is unique for each process .?

Volodymyr Boiko
  • 1,533
  • 15
  • 29

1 Answers1

3

There's only one GDTR register and it points to a location in the linear address space. It's not normally changed for each process. Instead the LDTR register is changed if different processes need different selectors. With most modern operating systems this is not the case and processes all share the same selectors.

This means that the GDT table exists in the same location in the virtual address spaces of all processes. Usually the pages that make up the table are marked so they're only accessible in supervisor-mode so user-mode code can't touch them.

Ross Ridge
  • 38,414
  • 7
  • 81
  • 112
  • 1
    Note that FS or GS are used for thread local stuff, and as such are not shared and are in fact mapped to different base addresses per thread. – Jester May 28 '15 at 22:26