MAPPING SEGMENTS TO PAGES
The segmentation and paging mechanisms provide in the support a wide variety of approaches to memory
management. When segmentation and paging are combined, segments can be mapped to pages in several ways.
To implement a flat (unsegmented) addressing environment, for example, all the code, data, and stack modules
can be mapped to one or more large segments (up to 4-GBytes) that share same range of linear addresses (see
Figure 3-2 in Section 3.2.2). Here, segments are essentially invisible to applications and the operating-system or
executive. If paging is used, the paging mechanism can map a single linear-address space (contained in a single
segment) into virtual memory. Alternatively, each program (or task) can have its own large linear-address space
(contained in its own segment), which is mapped into virtual memory through its own paging structures.
Segments can be smaller than the size of a page. If one of these segments is placed in a page which is not shared
with another segment, the extra memory is wasted. For example, a small data structure, such as a 1-Byte semaphore,
occupies 4 KBytes if it is placed in a page by itself. If many semaphores are used, it is more efficient to pack
them into a single page.
The Intel-64 and IA-32 architectures do not enforce correspondence between the boundaries of pages and
segments. A page can contain the end of one segment and the beginning of another. Similarly, a segment can
contain the end of one page and the beginning of another.
Memory-management software may be simpler and more efficient if it enforces some alignment between page and
segment boundaries. For example, if a segment which can fit in one page is placed in two pages, there may be
twice as much paging overhead to support access to that segment.
One approach to combining paging and segmentation that simplifies memory-management software is to give
each segment its own page table, as shown in Figure 4-13. This convention gives the segment a single entry in the
page directory, and this entry provides the access control information for paging the entire segment.
In protected mode, the Intel 64 and IA-32 architectures provide a protection mechanism that operates at both the
segment level and the page level. This protection mechanism provides the ability to limit access to certain
segments or pages based on privilege levels (four privilege levels for segments and two privilege levels for pages).
For example, critical operating-system code and data can be protected by placing them in more privileged
segments than those that contain applications code. The processor’s protection mechanism will then prevent application
code from accessing the operating-system code and data in any but a controlled, defined manner.
Segment and page protection can be used at all stages of software development to assist in localizing and detecting
design problems and bugs. It can also be incorporated into end-products to offer added robustness to operating
systems, utilities software, and applications software.
When the protection mechanism is used, each memory reference is checked to verify that it satisfies various
protection checks. All checks are made before the memory cycle is started; any violation results in an exception.
Because checks are performed in parallel with address translation, there is no performance penalty. The protection
checks that are performed fall into the following categories:
• Limit checks.
• Type checks.
• Privilege level checks.
• Restriction of addressable domain.
• Restriction of procedure entry-points.
• Restriction of instruction set.
All protection violation results in an exception being generated. See Chapter 6, “Interrupt and Exception Handling,”
for an explanation of the exception mechanism. This chapter describes the protection mechanism and the violations which lead to exceptions.
The following sections describe the protection mechanism available in protected mode. See Chapter 20, “8086
Emulation,” for information on protection in real-address and virtual-8086 mode.
MAPPING SEGMENTS TO PAGES的更多相关文章
- [转]Even when one byte matters
Source:http://kernelbof.blogspot.jp/2009/07/even-when-one-byte-matters.html Common Vulnerabilities a ...
- Reentrant protected mode kernel using virtual 8086 mode interrupt service routines
A method for allowing a protected mode kernel to service, in virtual 8086 mode, hardware interrupts ...
- Method of address space layout randomization for windows operating systems
A system and method for address space layout randomization ("ASLR") for a Windows operatin ...
- [轉]关于CR0.WP
关于CR0.WP 我们知道CR0的WP位可以关闭内核写保护.他和页表的R/W位有关.Intel手册中的描述绕来绕去似乎一直没有说到重点. When the processor is in superv ...
- linux系统swappiness参数在内存与交换分区间优化
http://blog.itpub.net/29371470/viewspace-1250975 swappiness的值的大小对如何使用swap分区是有着很大的联系的.swappine ...
- CentOS安装Oracle数据库详细介绍及常见问题汇总
一.安装前准备 1.软件硬件要求 操作系统:CentOS 6.4(32bit)Oracle数据库版本:Oracle 10g(10201_database_linux32.zip)最小内存:1G(检查命 ...
- RHEL7修改swappiness
linux系统swappiness参数在内存与交换分区间优化 2014-08-14 10:24:19分类: Linux swappiness的值的大小对如何使用swap分区是有着很大的联系的.swap ...
- 工作中常用的Linux命令:ipcs/ipcrm命令
本文链接:http://www.cnblogs.com/MartinChentf/p/6057100.html (转载请注明出处) ipcs 1. 命令格式 ipcs [resource-option ...
- Linux Process Virtual Memory
目录 . 简介 . 进程虚拟地址空间 . 内存映射的原理 . 数据结构 . 对区域的操作 . 地址空间 . 内存映射 . 反向映射 .堆的管理 . 缺页异常的处理 . 用户空间缺页异常的校正 . 内核 ...
随机推荐
- JAVA CAS原理深度分析-转载
参考文档: http://www.blogjava.net/xylz/archive/2010/07/04/325206.html http://blog.hesey.net/2011/09/reso ...
- art虚拟机启动问题分析
欢迎转载opendevkit文章, 文章原始地址: http://www.opendevkit.com/?e=69 Attempt to invoke native method in non-sta ...
- .Net平台下,分布式文件存储的实现
遇到的问题 对于Web程序,使用一台服务器的时候,客户端上传的文件一般也都是存储在这台服务器上.但在集群环境中就行不通了,如果每个服务器都存储自己接受到的文件,就乱套了,数据库中明明有这个附件的记录, ...
- objective-c(继承)
objective-c的继承给出基础例子及注意点: 定义并实现基类ClassA #import <Foundation/Foundation.h> @interface ClassA : ...
- Spring中Ordered接口简介
目录 前言 Ordered接口介绍 Ordered接口在Spring中的使用 总结 前言 Spring中提供了一个Ordered接口.Ordered接口,顾名思义,就是用来排序的. Spring是一个 ...
- ASP.NET MVC请求处理管道生命周期的19个关键环节(1-6)
ASP.NET和ASP.NET MVC的HttpApplication请求处理管道有共同的部分和不同之处,本系列将体验ASP.NET MVC请求处理管道生命周期的19个关键环节. ①以IIS6.0为例 ...
- drag & resize元素的jQuery实现
有时项目中会遇到需要拖动元素.拖拽调整元素大小的需求.大部分时候都不想自己写一遍,因为已经有很多现成的例子了.例如jqueryui提供的drag和resize.但是仅仅是为了这么小一个功能就引入一个库 ...
- [nRF51822] 6、基于nRF51822平台的flash读写研究
前言 本文重点介绍flash的数据存取特性.flash的内存划分.一个简单的存取图片的内存管理方式,以及对flash写前删的时间.删后读的时间.写后读的时间进行测量的一个小实验.目的在于更全面了解fl ...
- 为什么一定要杀掉病毒?---帮一位老师解决MyDocument.exe优盘文件夹图标病毒问题
最近一位大学老师给我抱怨了一个她遇到的烦恼,一直在纠结,生活都被打乱了,事情大概是这样的: 她的优盘里辛辛苦苦弄好备课文件,放在了优盘里,可是每次上课时,就是找不到文件.有时好多文件都被修改了,非常烦 ...
- Knockout JS实现任务管理应用程序
1.1.1 摘要 在博文<Ember.js实现单页面应用程序>中,我们介绍了使用Ember JS实现一个单页应用程序 (SPA),这使我想起了几年前写过一个任务管理程序,通过选择日期,然后 ...