【译】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 ...
随机推荐
- man中文手册
Ubuntu安装man手册 sudo apt-get install manpages-zh CentOS安装man手册 yum install man man中文安装包 yum install ma ...
- 实现日、周、月排行统计 sql
在如今很多系统中,都需要进行日.周.月排行统计,但是在网上寻找 了一番,发现很多都是相对的周.月排行,即周排行则用当前时间减去7天.这样我个人认为并不恰当.如月排行中,假设今天是4月22日,则从3月2 ...
- 数组/矩阵转换成Image类
Python下将数组/矩阵转换成Image类 原创 2017年04月21日 19:21:27 标签: python / 图像处理 3596 先说明一下为什么要将数组转换成Image类.我处理的图像是F ...
- MFC中按下Buttonbutton,弹出一个窗体的同一时候关闭本窗体
CMyDlg *dlg = new CMyDlg(); //新建一个CMyDlg对象 this->ShowWindow(SW_HIDE); ...
- 【HNOI模拟By lyp】Day2
1 toad1.1 题目描述 有 n 个石子, A B 两人博弈, A 先手. A 首先取若干个石子(至少一个,不能取完),然后B和A 再轮流取石子,每次取的石子不能超过 axb ( x 表示上次取的 ...
- 1.jdk安装和环境配置
这个简单,但是记不住,非要网上搜一遍不可: 1.打开我的电脑--属性--高级--环境变量 2.新建系统变量JAVA_HOME 和CLASSPATH 变量名:JAVA_HOME 变量值:C:\Progr ...
- Bootstrap tabs 源码分析
前言: 阅读建议:去github下载一个完整dom然后把,本篇代码复制进去然后运行就好了以地址 tab组件是非常简单的一种组件,因为这是一个系列,所以就顺便看了,其实它写的这个还算不错的,很有条例,也 ...
- LightTable的结构(一)
LightTable使用clojurescript来生成js,然后使用 node-webkit 来处理UI clojurescript非常适合做抽象程度很高的页面和编辑逻辑结构设计, 最近会对整体进行 ...
- iOS开发-多台机器共用证书问题
今天又被证书的问题卡壳了: 在公司的电脑上申请的开发.发布证书,回家用自己的电脑从苹果开发者中心上将证书和配置文件都下载下来提示用不了,弄了很久才想起.p12文件,必须从申请证书的电脑上导出,导入到自 ...
- android短信拦截
广播分2种,无序广播和有序广播.可以理解为散列和队列广播. 首先无序广播,不能中断,分发机制有点类似散列发送.这种广播的的发送为:context.sendBroadcast这种广播是不能中断的,请看A ...