Global Descriptor Table: Difference between revisions

m
Change flag names to be more in line with the intel manual.
[unchecked revision][unchecked revision]
(Added section to make clear that the format of system segments is different from usual segments.)
m (Change flag names to be more in line with the intel manual.)
Line 88:
!style="width: 12.5%;"|0
|-
|'''PrP''' ||colspan=2|'''PrivlDPL''' || '''S''' || '''ExE''' || '''DC''' || '''RW''' || '''AcA'''
|}
 
* '''PrP:''' Present bit. Allows an entry to refer to a valid segment. Must be set ('''1''') for any valid segment.
* '''PrivlDPL:''' Descriptor privilege level field. Contains the [[Security#Rings|CPU Privilege level]] of the segment. '''0''' = highest privilege (kernel), '''3''' = lowest privilege (user applications).
* '''S:''' Descriptor type bit. If clear ('''0''') the descriptor defines a system segment (eg. a [[Task_State_Segment|Task State Segment]]). If set ('''1''') it defines a code or data segment.
* '''ExE:''' Executable bit. If clear ('''0''') the descriptor defines a data segment. If set ('''1''') it defines a code segment which can be executed from.
* '''DC:''' Direction bit/Conforming bit.
** For data selectors: Direction bit. If clear ('''0''') the segment grows up. If set ('''1''') the segment [[Expand_Down|grows down]], ie. the '''Offset''' has to be greater than the '''Limit'''.
Line 103:
** For code segments: Readable bit. If clear ('''0'''), read access for this segment is not allowed. If set ('''1''') read access is allowed. Write access is never allowed for code segments.
** For data segments: Writeable bit. If clear ('''0'''), write access for this segment is not allowed. If set ('''1''') write access is allowed. Read access is always allowed for data segments.
* '''AcA:''' Accessed bit. Best left clear ('''0'''), the CPU will set it when the segment is accessed.
 
{| class="wikitable"
Line 113:
!style="width: 25%;"|0
|-
|'''GrG''' || '''SzDB''' || '''L'''
|Reserved
|}
 
* '''GrG:''' Granularity flag, indicates the size the '''Limit''' value is scaled by. If clear ('''0'''), the '''Limit''' is in 1 Byte blocks (byte granularity). If set ('''1'''), the '''Limit''' is in 4 KiB blocks (page granularity).
* '''SzDB:''' Size flag. If clear ('''0'''), the descriptor defines a 16-bit protected mode segment. If set ('''1''') it defines a 32-bit protected mode segment. A GDT can have both 16-bit and 32-bit selectors at once.
* '''L:''' Long-mode code flag. If set ('''1'''), the descriptor defines a 64-bit code segment. When set, '''Sz''' should always be clear. For any other type of segment (other code types or any data segment), it should be clear ('''0''').
 
Line 139:
!style="width: 12.5%;"|0
|-
|'''PrP''' ||colspan=2|'''PrivlDPL''' || '''S''' || colspan=4|'''Type'''
|}
 
53

edits