Problem:
1, how to request the logical address?
2, how do I find the base field of the segment descriptor?
Logical address: Consists of a 16-bit segment selector and a 32-bit offset, which does not mean that the address is the segment selector offset 32-bit and the offset is added.
Segment selector: or called a segment identifier, is a 16-bit long field. As the name implies, used to select segments. To quickly find the segment selector, the processor provides a segment register.
15~3bit, segment index number, 2bit ti bit, 1 0 bit, privilege level.
Since segment selectors only work in a linear address, it is generally assumed that the 32-bit offset is the logical address . The address of a variable in the C language & is the logical address.
Segment Descriptor: In the segment selector, the segment index number points to the segment descriptor in the Segment Descriptor table, which is represented by a 8-byte segment descriptor. Contains 9 identities, such as base. Therefore,base is included in the paragraph description .
The segment descriptor is placed in the Global Descriptor Table (GDT) or the local statement (LDT). The GDT is stored in memory, and the address and size are placed in the GDTR control register. The LDT is placed in the LDTR control register.
TSS: Task status segment. The task State is primarily represented by a number of registers, so this segment is used to hold the contents of the processor register. This segment is only in the GDT.
Linear address: base+ logical address offset in the segment descriptor
Question: What does the field mean in the segment descriptor?
Deep understanding of the Linux kernel-chapter II memory addressing 03