The Linux GDT

  • GDT (Global Descriptor Table): Contains segment descriptors for system wide use and has 18 entries, 14 of which are null unused or reserved.  One per processor. Each GDT has its own TSS segment and LDT/TLS/APM/PnP vary based on execution of processes or BIOS code
    • Unused entries are inserted on purpose so that Segment Descriptors usually accessed together are kept in the same 32-byte line of the hardware cache
    • capture
    • 4 cs and ds segments
    • Task state segment (1 per processor) linear address contained in kernel data seg
      • Stored sequentially in an init_tss array
      • Base: nth component (nth CPU) in init_tss
      • G: Cleared
      • Limit: 0xeb (segment is 236 bytes long)
      • Type: 9 or 11
      • DPL: 0 (only accessible in kernel mode)
    • Local Descriptor Table (1): This is not to be confused with LDTs created by some processes themselves.  In general all processes share the same LDT in the specified in the GDT
    • Thread-Local Storage Segment (3): Allows each thread to have its own data seg
    • Advanced Power Management (3): BIOS uses these as code/data segments when the Linux APM driver invokes BIOS functions
    • Plug and Play (PnP) BIOS Services (5): Same as above used for PnP devicest
    • TSS Double Fault Exceptions (1)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s