Deep understanding of the Linux kernel-chapter II memory addressing 03

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.