【译】x86程序员手册28-7.7任务地址空间
7.7 Task Address Space 任务地址空间
The LDT selector and PDBR fields of the TSS give software systems designers flexibility in utilization of segment and page mapping features of the 80386. By appropriate choice of the segment and page mappings for each task, tasks may share address spaces, may have address spaces that are largely distinct from one another, or may have any degree of sharing between these two extremes.
LDT选择子和TSS中的PDBR字段为软件系统设计者提供了更灵活的方式来利用80386关于段和页映射特性。通过为每个任务适当选择段和页映射,多任务可以共享地址空间,也可以有与其他任务很不一样的地址空间,或者二者之间的一种平衡方式。
The ability for tasks to have distinct address spaces is an important aspect of 80386 protection. A module in one task cannot interfere with a module in another task if the modules do not have access to the same address spaces. The flexible memory management features of the 80386 allow systems designers to assign areas of shared address space to those modules of different tasks that are designed to cooperate with each other.
任务有一个确切的地址空间是80386的保护中很重要的一个方面。一个任务中的模块不能干涉另一个任务的模块,只要这个模块没有权限访问相同的地址空间。80386灵活的内存管理特性允许系统设计者分配共享地址空间区域给那些位于不同任务中,却被设计成互相协作的模块。
7.7.1 Task Linear-to-Physical Space Mapping 任务的线性地址到物理地址的空间映射
The choices for arranging the linear-to-physical mappings of tasks fall into two general classes:
如何安排任务的线性地址到物理地址的映射,一般有两类:
- One linear-to-physical mapping shared among all tasks.
一个线性地址到物理地址的映射被所有任务共享。
When paging is not enabled, this is the only possibility. Without page tables, all linear addresses map to the same physical addresses.
当分页没有被启用,这是仅有的可能性。不使用页表,所有线性地址映射到相同的物理地址。
When paging is enabled, this style of linear-to-physical mapping results from using one page directory for all tasks. The linear space utilized may exceed the physical space available if the operating system also implements page-level virtual memory.
当分页功能被启用后,这种风格的线性地址到物理地址的映射结果就是对所有任务都使用一个页目录。如果操作系统也实现了页级的虚拟内存,则可利用的线性地址空间可以超出可用的物理地址空间。
- Several partially overlapping linear-to-physical mappings.
多个部分的叠加线性地址到物理地址的映射。
This style is implemented by using a different page directory for each task. Because the PDBR (page directory base register) is loaded from the TSS with each task switch, each task may have a different page directory.
这种风格是通过对每一个任务使用不同的页目录来实现的。因为PDBR(页目录基址寄存器)是从每个切换任务的TSS中装载的,每个任务都可有不同的页目录。
In theory, the linear address spaces of different tasks may map to completely distinct physical addresses. If the entries of different page directories point to different page tables and the page tables point to different pages of physical memory, then the tasks do not share any physical addresses.
理论上,不是任务的线性地址空间可以被映射到完全明确的物理地址上。因为不同页目录的项指向不同页表,页表指向不同的物理内存页,任务不用共享任何物理地址。
In practice, some portion of the linear address spaces of all tasks must map to the same physical addresses. The task state segments must lie in a common space so that the mapping of TSS addresses does not change while the processor is reading and updating the TSSs during a task switch. The linear space mapped by the GDT should also be mapped to a common physical space; otherwise, the purpose of the GDT is defeated. Figure 7-6 shows how the linear spaces of two tasks can overlap in the physical space by sharing page tables.
而实践中,所有任务中的部分线性地址空间必须被映射到相同的物理地址。任务状态段(TSS)必须位于通用空间,这样,当处理器在切换任务期间读取或更新TSS时,TSS的地址映射不被修改。GDT映射的线性地址空间也应当被映射到通用物理地址空间;否则,GDT的目的就失去了。图7-6所示,如何通过共享页表使两个任务的线性地址空间在物理地址空间上重叠。

7.7.2 Task Logical Address Space 任务的逻辑地址空间
By itself, a common linear-to-physical space mapping does not enable sharing of data among tasks. To share data, tasks must also have a common logical-to-linear space mapping; i.e., they must also have access to descriptors that point into a shared linear address space. There are three ways to create common logical-to-physical address-space mappings:
通用线性地址到物理地址空间映射自身无法在任务中间共享数据。为了共享数据,任务必须拥有通用的逻辑地址到线性地址空间的映射;也就是说,他们必须可以访问指向共享的线性地址空间的描述符。创建一个通用的逻辑地址到线性地址的空间映射有以下三种方法:
- Via the GDT. All tasks have access to the descriptors in the GDT. If those descriptors point into a linear-address space that is mapped to a common physical-address space for all tasks, then the tasks can share data and instructions.
通过GDT。所有任务都有权访问GDT中的描述符。对于所有任务而言,如果这些描述符指向的线性地址空间已被映射到一个通用的物理地址空间,那么任务就可以共享数据和指令。
- By sharing LDTs. Two or more tasks can use the same LDT if the LDT selectors in their TSSs select the same LDT segment. Those LDT-resident descriptors that point into a linear space that is mapped to a common physical space permit the tasks to share physical memory. This method of sharing is more selective than sharing by the GDT; the sharing can be limited to specific tasks. Other tasks in the system may have different LDTs that do not give them access to the shared areas.
通过共享LDT。如果在TSS中的LDT选择子都选择了一个相同的LDT段,那么二个或多个任务就可以使用相同的LDT。如果那些LDT中的描述符指向的线性地址空间已经被映射到一个通用的物理地址空间,就允许多个任务共享这些物理内存。这种共享方式比通过GDT共享的方式有更多的选择余地;共享可以限制在指定的任务中间。系统中的其他任务可以有不同的LDT,这样就可以不允许他们访问共享区域。
- By descriptor aliases in LDTs. It is possible for certain descriptors of different LDTs to point to the same linear address space. If that linear address space is mapped to the same physical space by the page mapping of the tasks involved, these descriptors permit the tasks to share the common space. Such descriptors are commonly called "aliases". This method of sharing is even more selective than the prior two; other descriptors in the LDTs may point to distinct linear addresses or to linear addresses that are not shared.
通过LDT中的描述符别名。让LDT中不同的描述符指向相同的线性地址空间是可能的。如果通过任务参与的页映射将线性地址空间被映射到相同的物理地址空间,这些描述符允许任务共享这些通用空间。这样的描述符被叫做“别名”。这种共享方式比前两个更加有选择余地;LDT中的其他描述符可以指向明确的线性地址或那些不共享的线性地址。
【译】x86程序员手册28-7.7任务地址空间的更多相关文章
- 【译】x86程序员手册01
Intel 80386 Reference Programmer's Manual 80386程序员参考手册 Chapter 1 -- Introduction to the 80386 第1章 - ...
- 【译】x86程序员手册03 - 2.1内存组织和分段
2.1 Memory Organization and Segmentation 内存组织和分段 The physical memory of an 80386 system is organized ...
- 【译】x86程序员手册00 - 翻译起因
从上一次学习MIT的操作系统课程又过去了一年.上次学习并没有坚持下去.想来虽有种种原因,其还在自身无法坚持罢了.故此次再鼓起勇气重新学习,发现课程都已由2014改版为2016了.但大部分内容并没有改变 ...
- 【译】x86程序员手册38-10.2实在址模式下的软件初始化
10.2 Software Initialization for Real-Address Mode 实地址模式的软件初始化 In real-address mode a few structur ...
- 【译】x86程序员手册09-第3章程序指令集
注:觉得本章内容与理解操作系统不直接相关,所以本章并未看完,也就没有翻译完,放在这里中是为了保证手册的完整.有兴趣的人可以去原址查看. https://pdos.csail.mit.edu/6.828 ...
- 【译】x86程序员手册05 - 2.3寄存器
2.3 Registers 寄存器 The 80386 contains a total of sixteen registers that are of interest to the applic ...
- 【译】x86程序员手册02 - 基本的程序模式
Chapter 2 -- Basic Programming Model: 基本的程序模式 Introduces the models of memory organization. Defines ...
- 【译】x86程序员手册40-10.5初始化的例子
10.5 Initialization Example初始化的例子 译注:本来想把这个例子全部注释完,但由于对intel汇编实不熟悉,有太多的伪指令,本人也是免强看懂,所以就不再做翻译了. $TITL ...
- 【译】x86程序员手册39-10.3切换到保护模式
10.3 Switching to Protected Mode 切换到保护模式 Setting the PE bit of the MSW in CR0 causes the 80386 to b ...
- 【译】x86程序员手册37-第10章 初始化
Chapter 10 Initialization 第10章 初始化 After a signal on the RESET pin, certain registers of the 80386 a ...
随机推荐
- 再探gdb经常使用命令
前面已经有了一篇对gdb经常使用命令的总结.见 http://blog.csdn.net/u011848617/article/details/12838875 这里对眼下学过的gdb命令进行了 ...
- spring test---restful与文件上传
spring提供了大量经常使用的功能測试,如文件上传.restful风格url訪问.以下介绍主要介绍下test中经常使用功能的使用方法: 首先能够静态导入类.方便在測试类中使用,导入的类有 impor ...
- C/C++实现正负数四舍五入
首先我们来看看 (int) 强制类型转换: #include <stdio.h> #include <stdlib.h> int main(){ int a = (int)(- ...
- 8-13 canvas专题-阶段练习二(下)
8-13 canvas专题-阶段练习二(下) <!DOCTYPE html> <html lang="zh-cn"> <head> <me ...
- scapy基础-网络数据包结构
网络层次模型,数据包的组成是学习scapy的基础,下文主要关注模型中各个层次的用途,ethernet II和ip包数据结构. 1.五层模型简介 名称 作用 包含协议 应用层 面向程序对程序的传输 ...
- 8 Range 对象
8.1 引用Range 引用Range的主要方法: Application.ActiveCell Application.Range Application.Selection Worksheet.C ...
- NOIP 2013 花匠 神仙操作
题目:https://www.luogu.org/problemnew/show/P1970 今天又学习了一个新的神仙操作: 标签是DP,想了一下,没什么心情写,默默打开题解——(狂喜!) 一位大佬( ...
- KVPhone,VOS官方的SIP软电话电脑客户端
来自官方,品质纯正.但是可能因为JAVA环境等问题无法安装,可以试试! 下载地址: 解压密码:www.51voip.org
- ssh使用秘钥文件连接提示WARNING: UNPROTECTED PRIVATE KEY FILE!(转载)
转自:http://www.01happy.com/ssh-unprotected-private-key-file/ 在centos 6.4下使用ssh连接远程主机时,用的是另外一个密钥,需要用-i ...
- C++中虚析构函数的作用 (转载)
转自:http://blog.csdn.net/starlee/article/details/619827 我们知道,用C++开发的时候,用来做基类的类的析构函数一般都是虚函数.可是,为什么要这样做 ...