分类: LINUX
2008-04-01 21:00:59
Figure 2-5 shows in detail how a logical address is translated into a corresponding linear address. The segmentation unit performs the following operations:
图2-5详细描绘了逻辑地址是如何转换成对应的线形地址的。分段单元是这样工作的:
· Examines the TI field of the Segment Selector to determine which Descriptor Table stores the Segment Descriptor. This field indicates that the Descriptor is either in the GDT (in which case the segmentation unit gets the base linear address of the GDT from the gdtr register) or in the active LDT (in which case the segmentation unit gets the base linear address of that LDT from the ldtr register).
检查段选择子的TI域,决定存放段描述符的描述符表(是GDT还是LDT),如果是GDT,则从gdtr中获得GDT的首地址(线形地址),否则从ldtr获取首地址。
· Computes the address of the Segment Descriptor from the index field of the Segment Selector. The index field is multiplied by 8 (the size of a Segment Descriptor), and the result is added to the content of the gdtr or ldtr register.
用段选择子的index域计算段描述符的地址。将index*8的结果加到上面得到的首地址上。
· Adds the offset of the logical address to the Base field of the Segment Descriptor, thus obtaining the linear address.
将逻辑地址offset与上面得到的描述符的地址相加,得到对应的线形地址。