Search code examples
cassemblyoperating-systemprotected-mode

about GDT and processes


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 .?


Solution

  • 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.