Chinaunix首页 | 论坛 | 博客
  • 博客访问: 56226
  • 博文数量: 47
  • 博客积分: 2095
  • 博客等级: 大尉
  • 技术积分: 560
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-01 18:42
文章分类

全部博文(47)

文章存档

2011年(1)

2008年(46)

我的朋友

分类: LINUX

2008-04-01 21:00:59

Segmentation Unit

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与上面得到的描述的地址相加,得到对应的线形地址。

Notice that, thanks to the nonprogrammable registers associated with the segmentation registers, the first two operations need to be performed only when a segmentation register has been changed.
 
由于影子寄存器的存在,前面步只在段寄存器的内容改变时才会进行。
阅读(367) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~