6.4 Page-Level Protection 页级保护

Two kinds of protection are related to pages:

与页相关的保护有两类:

  1. Restriction of addressable domain. 可寻址域的约束
  2. Type checking. 类型检验

6.4.1 Page-Table Entries Hold Protection Parameters页表项保存保护参数

Figure 6-10 highlights the fields of PDEs and PTEs that control access to pages.

图6-10高亮了控制访问页的PDE和PTE(page directory entries and page table entries)的部分段。

6.4.1.1 Restricting Addressable Domain 可寻址域的约束

The concept of privilege for pages is implemented by assigning each page to one of two levels:

页特权概念通过将每个页分配给两级中的一个来实现:

  1. Supervisor level (U/S=0) -- for the operating system and other systems software and related data.

特权级(U/S = 0) —— 分配给操作系统和其他系统软件和相关数据。

  1. User level (U/S=1) -- for applications procedures and data.

用户级(U/S = 1) —— 分配给应用程序和数据

The current level (U or S) is related to CPL. If CPL is 0, 1, or 2, the processor is executing at supervisor level. If CPL is 3, the processor is executing at user level.

当前级别(U或S)与CPL相关。如果CPL是0、1或2,处理器运行在超级用户级别。如果CPL是3,则处理器运行在用户级别。

When the processor is executing at supervisor level, all pages are addressable, but, when the processor is executing at user level, only pages that belong to the user level are addressable.

当处理器运行在超级用户级别时,所有页都可寻址,但当片日历运行在用户级别时,仅有那些属于用户级别的是可寻址的。

6.4.1.2 Type Checking 类型检查

At the level of page addressing, two types are defined:

在页寻址级别中,定义了两类:

  1. Read-only access (R/W=0) 只读 (R/W = 0)
  2. Read/write access (R/W=1) 读/写 (R/W = 1)

When the processor is executing at supervisor level, all pages are both readable and writable. When the processor is executing at user level, only pages that belong to user level and are marked for read/write access are writable; pages that belong to supervisor level are neither readable nor writable from user level.

当处理器运行在超级用户级别时,所有页即可读,也可写。当处理器运行在用户有级别时,仅当页属于用户级别,并且并标记为读写的才可写入;属于超级用户的页对于用户级别来说即不可读,也不可写。

6.4.2 Combining Protection of Both Levels of Page Tables 在页表上二个级别的组合保护

For any one page, the protection attributes of its page directory entry may differ from those of its page table entry. The 80386 computes the effective protection attributes for a page by examining the protection attributes in both the directory and the page table. Table 6-5 shows the effective protection provided by the possible combinations of protection attributes.

对于任何一页,页目录项的保护属性都不同于页表顶。80386通过检查目录和页表的保护属性来计算保护效果。表6-5显示了通过保护属性可能组合所达到的保护效果。

Table 6-5. Combining Directory and Page Protection

Page Directory Entry     Page Table Entry      Combined Protection

U/S          R/W         U/S      R/W          U/S         R/W

S-0          R-0         S-0      R-0           S           x

S-0          R-0         S-0      W-1           S           x

S-0          R-0         U-1      R-0           S           x

S-0          R-0         U-1      W-1           S           x

S-0          W-1         S-0      R-0           S           x

S-0          W-1         S-0      W-1           S           x

S-0          W-1         U-1      R-0           S           x

S-0          W-1         U-1      W-1           S           x

U-1          R-0         S-0      R-0           S           x

U-1          R-0         S-0      W-1           S           x

U-1          R-0         U-1      R-0           U           R

U-1          R-0         U-1      W-1           U           R

U-1          W-1         S-0      R-0           S           x

U-1          W-1         S-0      W-1           S           x

U-1          W-1         U-1      R-0           U           R

U-1          W-1         U-1      W-1           U           W

Note

S -- Supervisor

R -- Read only

U -- User

W -- Read and Write

x indicates that when the combined U/S attribute is S, the R/W attribute

is not checked.

6.4.3 Overrides to Page Protection 对页保护的覆盖

Certain accesses are checked as if they are privilege-level 0 references, even if CPL = 3:

对某些权限进行检查,就象它们处在特权级0下,哪怕CPL等于3:

  • LDT, GDT, TSS, IDT references. 对LDT、GDT、TSS和IDT的引用
  • Access to inner stack during ring-crossing CALL/INT.

在跨特权级间进行CALL/INT期间访问内部栈。

【译】x86程序员手册22-6.4页级保护的更多相关文章

  1. 【译】x86程序员手册00 - 翻译起因

    从上一次学习MIT的操作系统课程又过去了一年.上次学习并没有坚持下去.想来虽有种种原因,其还在自身无法坚持罢了.故此次再鼓起勇气重新学习,发现课程都已由2014改版为2016了.但大部分内容并没有改变 ...

  2. 【译】x86程序员手册01

    Intel 80386 Reference Programmer's Manual 80386程序员参考手册 Chapter 1 -- Introduction to the 80386 第1章 - ...

  3. 【译】x86程序员手册03 - 2.1内存组织和分段

    2.1 Memory Organization and Segmentation 内存组织和分段 The physical memory of an 80386 system is organized ...

  4. 【译】x86程序员手册18-6.3.1描述符保存保护参数

    6.3 Segment-Level Protection 段级保护 All five aspects of protection apply to segment translation: 段转换时会 ...

  5. 【译】x86程序员手册15-5.2页转换

    5.2 Page Translation 页转换 In the second phase of address transformation, the 80386 transforms a linea ...

  6. 【译】x86程序员手册38-10.2实在址模式下的软件初始化

    10.2 Software Initialization for Real-Address Mode   实地址模式的软件初始化 In real-address mode a few structur ...

  7. 【译】x86程序员手册16-5.3联合使用段与分页转换

    5.3 Combining Segment and Page Translation  联合使用段与分页转换 Figure 5-12 combines Figure 5-2 and Figure 5- ...

  8. 【译】x86程序员手册09-第3章程序指令集

    注:觉得本章内容与理解操作系统不直接相关,所以本章并未看完,也就没有翻译完,放在这里中是为了保证手册的完整.有兴趣的人可以去原址查看. https://pdos.csail.mit.edu/6.828 ...

  9. 【译】x86程序员手册08 -2.6中断和异常

    2.6 Interrupts and Exceptions 中断和异常 The 80386 has two mechanisms for interrupting program execution: ...

随机推荐

  1. ATM取款机模拟——数据结构课设

    今天帮人写的第二篇课设 . ;-) 机智的窝 要求:大概说一下吧,就是要创建一个用户(初始化一账户),模拟ATM的业务(取款,100的整数倍,改密               码,查剩余金额.等等,各 ...

  2. onenstack 简介

    一.云计算的前世今生 所有的新事物都不是突然冒出来的,都有前世和今生.云计算也是IT技术不断发展的产物. 要理解云计算,需要对IT系统架构的发展过程有所认识. 请看下 IT系统架构的发展到目前为止大致 ...

  3. NPOI2.2.0.0实例详解(十)—设置EXCEL单元格【文本格式】 NPOI 单元格 格式设为文本 HSSFDataFormat

    NPOI2.2.0.0实例详解(十)—设置EXCEL单元格[文本格式] 2015年12月10日 09:55:17 阅读数:3150 using System; using System.Collect ...

  4. You don't have permission to access ××× on this server.

    之前开发项目一直在linux上用的xampp集成环境,前几天突然想移到window上面去. 開始在window上安装了一个集成环境(名字大概是 Uniform Service),把项目文件已过去, o ...

  5. iOS tableview cell 的展开收缩

    iOS tableview cell 的展开收缩 #import "ViewController.h" @interface ViewController ()<UITabl ...

  6. python 【第一篇】初识python

    人生苦短,我用python Python是我喜欢的语言,简洁.优美.容易使用.所以我总是很激昂的向朋友宣传Python的好处. python起源 1989年,为了打发圣诞节假期,Guido开始写Pyt ...

  7. Cocos2d-X开发中国象棋《四》设计游戏场景

    设计完開始界面后就要设计游戏界面了 为了理清设计思路先看一张游戏界面效果图 游戏界面设计思路: 1.在窗体上放一张桌子 2.在桌子上放一个棋盘 3.在棋盘右边加入新局button,暂不实现详细的功能 ...

  8. hdu1115 Lifting the Stone(几何,求多边形重心模板题)

    转载请注明出处:http://blog.csdn.net/u012860063 题目链接:pid=1115">http://acm.hdu.edu.cn/showproblem.php ...

  9. iOS开发——高级篇——iOS中为什么block用copy属性

    1. Block的声明和线程安全Block属性的声明,首先需要用copy修饰符,因为只有copy后的Block才会在堆中,栈中的Block的生命周期是和栈绑定的,可以参考之前的文章(iOS: 非ARC ...

  10. 【bzoj1034】[ZJOI2008]泡泡堂BNB

    贪心 将双方的选手均按从强到弱排序,然后第一次扫描尽可能用当前剩下的选手中能赢对手当前最强选手中最弱的一个去赢得胜利,若无法做到,则暂时不考虑给对方最强的选手匹配对手.第二遍扫描使用同样策略去获取尽量 ...