您的位置:首页 > 其它

2.1.1 gdt and ldt

2010-09-13 23:15 127 查看
上面的图看的的迷迷糊糊的。。。。=。=~!先不管了 往下看再说 呵呵

When operating in protected mode, all memory accesses pass through either the
global descriptor table (GDT) or an optional local descriptor table (LDT) as shown in
Figure 2-1. These tables contain entries called segment descriptors. Segment
descriptors provide the base address of segments well as access rights, type, and
usage information.

当在保护模式下。所有的内存存取都要通过目标描述表或是一个可选的本地描述表这些表格。这些表格

里所容纳的地址叫做段描述符。段描述符提供段的基本地址像存取权,类型,和使用信息。

Each segment descriptor has an associated segment selector. A segment selector
provides the software that uses it with an index into the GDT or LDT (the offset of its
associated segment descriptor), a global/local flag (determines whether the selector
points to the GDT or the LDT), and access rights information.

每个段描述符有一个关联的段选择子,一个段选择子提供一个可以索引到gd ldt的软件(偏移量相对于段描述符),一个目标/本地 标记(决定这个选择子是指向gdt还是ldt),和存取权信息。
To access a byte in a segment, a segment selector and an offset must be supplied.
The segment selector provides access to the segment descriptor for the segment (in
the GDT or LDT). From the segment descriptor, the processor obtains the base
address of the segment in the linear address space. The offset then provides the
location of the byte relative to the base address. This mechanism can be used to
access any valid code, data, or stack segment, provided the segment is accessible
from the current privilege level (CPL) at which the processor is operating. The CPL is
defined as the protection level of the currently executing code segment.

为了到达一个段的某个字节,必须提供一个段选择子和一个偏移地址,段选择子可以进入段描述符,

从段描述符,处理器获得了了线性地址的基地址,偏移量然后提供相对于基地址的位置,这种机制可以

被使用进入任何有效的数据段,代码段,堆栈段,下面不明白什么意思。。。
See Figure 2-1. The solid arrows in the figure indicate a linear address, dashed lines
indicate a segment selector, and the dotted arrows indicate a physical address. For
simplicity, many of the segment selectors are shown as direct pointers to a segment.
However, the actual path from a segment selector to its associated segment is always
through a GDT or LDT.
The linear address of the base of the GDT is contained in the GDT register (GDTR);
the linear address of the LDT is contained in the LDT register (LDTR).

看下图 实线是代表的线性地址,虚线代表段地址,带点的箭头代表物理地址。为了简单起见 许多段选择子是以一个段的指针形式出现的。然而实际的路径从段选择子到他对应的段通常是通过gdt和ldt的

上面这句完全不知道什么意思 呵呵 可能以后就知道了

现在比较迷糊的地方 段选择子和gdtr 还有ldtr什么关系???????
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: