using segments

3.2 using segment

The segmentation mechanism supported by the IA-32 architecture can be used to
implement a wide variety of system designs. These designs range from flat models
that make only minimal use of segmentation to protect programs to multisegmented
models that employ segmentation to create a robust operating environmentin which multiple programs and tasks can be executed reliably.The following sections give several examples of how segmentation can be employedin a system to improve memory management performance and reliability.

ia_32所支持的分段机制可以被用于执行较多的系统设计。这些设计从平坦模式(用到最小段)到对于多任务模式(使用段去创建一个完整多任务操作环境)来说的保护模式。下面通过一些事例阐述一下系统怎么使用分段来管理内存的

3.2.1 Basic Flat Model
The simplest memory model for a system is the basic “flat model,” in which the operating
system and application programs have access to a continuous, unsegmented
address space. To the greatest extent possible, this basic flat model hides the
segmentation mechanism of the architecture from both the system designer and the
application programmer.
To implement a basic flat memory model with the IA-32 architecture, at least two
segment descriptors must be created, one for referencing a code segment and one
for referencing a data segment (see Figure 3-2). Both of these segments, however,
are mapped to the entire linear address space: that is, both segment descriptors
have the same base address value of 0 and the same segment limit of 4 GBytes. By
setting the segment limit to 4 GBytes, the segmentation mechanism is kept from
generating exceptions for out of limit memory references, even if no physical
memory resides at a particular address. ROM (EPROM) is generally located at the top
of the physical address space, because the processor begins execution atFFFF_FFF0H. RAM (DRAM) is placed at the bottom of the address space because the
initial base address for the DS data segment after reset initialization is 0.
3.2.1

最简单的内存模式是一个基本的平坦的模型,主要是在那些操作系统进入一个连续的 的不分段的地址空间,这种基本的平坦模式在最大限度上对程序和系统设计者隐藏段机制。

为了执行一个基本的平坦内存模式在Ia-32下,至少要创建连个段描述符,一个相对于数据段 一个相对于代码段。这些段整个映射到线性地址上。这就是说这些描述符有同样的基地址值0和同样的段界限4g。通过设置4g的段界限,如果没有真正的物理地址在你指定的地址上 分段机制就会调用超出段界限的异常。Rom一般被放在物理地址的顶部,因为处理器一般都是在FFFF-FFF0H开始执行RAM一般都放置在地址空间的底部 因为在重启之后初始的数据段ds的基地址是0.

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值