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.

  • 相关阅读:
    C# Excel导出超出65536行报错 Invalid row number (65536) outside allowable range (0..65535)
    C# 获取指定类型的文件
    C# 控制台定时器
    C# 去除Split()中去除内容为空的数据
    C#获取当前服务器运行程序的根目录,获取当前运行程序物理路径
    C#实体转为json字符串
    C#Split的用法,Split分割字符串
    C#直接引用js文件调js里的数据
    java虚拟机学习记录(内存划分、垃圾回收、类加载等机制)
    关于MySQL数据库事务的机制学习总结
  • 原文地址:https://www.cnblogs.com/YaoDD/p/6306253.html
Copyright © 2011-2022 走看看