继续。。

来源:互联网 发布:视频音乐下载软件 编辑:程序博客网 时间:2024/04/28 02:27

2.1.1 The "Flat" Model
In a "flat" model of memory organization, the applications programmer sees
a single array of up to 232 bytes (4 gigabytes). While the physical
memory can contain up to 4 gigabytes, it is usually much smaller; the
processor maps the 4 gigabyte flat space onto the physical address space by
the address translation mechanisms described in Chapter 5. Applications
programmers do not need to know the details of the mapping.
A pointer into this flat address space is a 32-bit ordinal number that may
range from 0 to 232-1. Relocation of separately-compiled modules in this
space must be performed by systems software (e.g., linkers, locators,
binders, loaders).

在平坦模式中,应用程序把内存看成一个单一的4G的序列。然而物理内存一般达不到4G

在第五章我们会介绍4G的平坦地址完全的隐射到物理地址上。应用程序是不需要知道内存

是怎样组织的。重置这种单独的编制模式由系统软件执行。
2.1.2 The Segmented Model
In a segmented model of memory organization, the address space as viewed by
an applications program (called the logical address space) is a much larger
space of up to 246 bytes (64 terabytes). The processor maps the 64
terabyte logical address space onto the physical address space (up to 4
gigabytes) by the address translation mechanisms described in Chapter 5.
Applications programmers do not need to know the details of this mapping.
Applications programmers view the logical address space of the 80386 as a
collection of up to 16,383 one-dimensional subspaces, each with a specified
length. Each of these linear subspaces is called a segment. A segment is a
unit of contiguous address space. Segment sizes may range from one byte up
to a maximum of 232 bytes (4 gigabytes).

在分段模式的内存组织中应用程序所能看到的地址空间(逻辑地址空间)达到了2的46次方

为什么是46???翻译机制看第5章应用程序编写者访问一个80386的地址空间作为一个1

维的子空间叫做段。一个段是一个连续的地址空间端的大小 可以从1到4G


A complete pointer in this address space consists of two parts (see Figure
2-1):
1. A segment selector, which is a 16-bit field that identifies a segment.
2. An offset, which is a 32-bit ordinal that addresses to the byte level
within a segment.
During execution of a program, the processor associates with a segment
selector the physical address of the beginning of the segment. Separately
compiled modules can be relocated at run time by changing the base address
of their segments. The size of a segment is variable; therefore, a segment
can be exactly the size of the module it contains.

一个完整的这种地址空间的指针由两部分组成:

一个16位的段id

一个32位的偏移地址。

 

原创粉丝点击