Deep understanding of the Linux kernel-chapter II Memory addressing 04

Source: Internet
Author: User

Question: What does the field mean in the segment descriptor?

Information such as linear address/offset/granularity/privilege limit for the first address of the segment.

1, quick access to segment descriptors

When the segment selector is loaded, the corresponding segment descriptor is automatically loaded into the corresponding non-programmed CPU register by memory. The GDT or LDT in main memory is no longer accessed after loading.

2, Segment selector field

Index: Specifies the entry for the corresponding segment descriptor placed in the GDT or LDT

ti:0 GDT 1 LDT

RPL: Privileged level, specifically the privilege level of the current CPU in the CS segment.

3, Segment descriptor address conversion

GDT Address: 0x00020000

Index:2

Address: 0x00020000+ (2*8)) 0x00020010

The maximum number of GDT 2 is 13 square-1. Reason: index is exactly 16-3 = 13 bits.

Fragmentation on Linux: Encourage programmers to divide programs into logically related entities, but Linux uses fragmentation very limited. Fragmentation and paging are a bit redundant, and they can all divide the physical address space of the process.

Fragmentation can assign a process to a different linear address space, and paging can map the same linear address space to a different physical address. Linux prefers paging.

Linux User cs UESR ds kernel cs Kernel ds are all 0, stating that there is no segmentation to map different linear address spaces. All programs use almost the same linear address space.

Deep understanding of the Linux kernel-chapter II Memory addressing 04

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.