X86 protected Mode uses a segmentation management mechanism that divides memory into blocks of memory represented by the start address and length limits for these two-dimensional parameters, which are called segments (Segment).
Keyword: Segment descriptor: Describes the properties of a segment.
Segment Description Table: An array that contains multiple segment descriptors.
Segment selector: Used to locate the index of a table item in a Segment description table.
The segment descriptor has three parameters: the Subgrade address, the segment bounds (limit), and the segment attribute (Attributes). The CPU finds the corresponding segment descriptor in the Segment Descriptor table as an index by selecting the contents of the middle selector in the logical address (segment selection sub + segment offset), and the linear address is obtained based on the segment descriptor's middle base address + segment offset (Linear addresses).
Segment selection is divided into three parts, the segment index (high 13 bits), the table indicates the bit (table Indicator,ti): 2, 3 bits, and select which descriptor table should be accessed. 0 means that the Global Descriptor Descriptor (GDT) should be accessed, and 1 means that the local descriptor descriptor (LDT) should be accessed. Request Privilege level (requested Privilege LEVEL,RPL) first bit.
X86 segment Mechanism