zoukankan      html  css  js  c++  java
  • 《深入理解Linux内核》阅读笔记 --- Chapter 2 Memory Addressing

    1、logical address = segment identifier (16bits) + offset (32bits)

    segment selector其实就是GDT或者LDT的索引,其中的TI字段用来确定是选择GDT还是IDT

    2、segment identifier is called segment selector, and in order to retrieve it quickly,  the process provides segmentation registers whose only purpose is to hold segment selectors,like cs, ss, ds, es, fs and gs.

    3、The cs register has another import function: it includes a 2-bit field that specifies the Current Privilege Level (CPL) of the CPU.

    4、Each segment is represented by an 8-byte Segment Descriptor that describes the segment characteristics.

    Global Descriptor Table(GDT) or Local Descriptor Table(LDT) is used to store them.

    5、There are several types of segments and thus several types of Segment Descriptors:

    Code Segment Descriptor, Data Segment Descriptor, Task State Segment Descriptor(TSSD), Local Descriptor Table Descriptor(LDTD)

    6、TSSD is a segment used to save contents of the processor registers, it can appear only in the GDT

    7、The first entry of the GDT is always 0. This ensures that logical addresses with a null segment selector will be considered invalid, thus causing a processor exception.

    8、Whenever the CPL is changed, some segmentation registers must be correspondingly updated.For instance, when the CPL is equal to 3(User Mode), the ds register must contain the segment selector of the user data segment, but when the CPL is equal to 0, the ds register must contain the segment selector of the kernel data segment

    9、In uniprocessor systems there is only one GDT, while in multiprocessor systems there is one GDT for every CPU in the system.All GDTs are stored in the cpu_gdt_table array, while the addresses and sizes of the GDTs are stored in the cpu_gdt_descr

    10、A Task State Segment (TSS), different for each processor in the system.The linear address space corresponding to a TSS is a small subset of the linear address space corresponding to the kernel data segment.

    Process in user mode are not allowed to access TSS segments.

    11、When a processor starts executing a process having a custom LDT, the LDT entry in the CPU-specified copy of the GDT is changed accordingly.

  • 相关阅读:
    Redis闪退解决办法
    excel导入数据库,存在则更新不存在添加
    sql取逗号前后数据与批量修改某一字段某一值
    sql查询一个字段不同值并返回
    表格加边框
    图论算法-求(有向)图中任意两点间所有路径
    Java实时监控日志文件并输出 转
    ResultSet的记录数  转
    eclipse中显示“编辑器中没有main类型
    压缩
  • 原文地址:https://www.cnblogs.com/YaoDD/p/6306253.html
Copyright © 2011-2022 走看看