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

全部博文(47)

文章存档

2011年(1)

2008年(46)

我的朋友

分类: LINUX

2008-04-05 09:54:00

The Linux LDTs

Most Linux User Mode applications do not make use of a Local Descriptor Table, thus the kernel defines a default LDT to be shared by most processes. The default Local Descriptor Table is stored in the default_ldt array. It includes five entries, but only two of them are effectively used by the kernel: a call gate for iBCS executables, and a call gate for Solaris/x86 executables (see the section "Execution Domains" in Chapter 20). Call gates are a mechanism provided by 80 x 86 microprocessors to change the privilege level of the CPU while invoking a predefined function; as we won't discuss them further, you should consult the Intel documentation for more details.

大多数Linux用户模式程序都不使用LDT,因此内核定义了一个默认的LDT供进程共享。默认的LDT存储在数组default_ldt里。它有5个元素,但是内核只有效地利用其中的两个:一个为了iBCS执行的调用门,一个为了Solaris/x86执行的调用门。调用门是x86处理器提供的一种机制,当调用一个预先定义好的函数时用来改变CPU的权限级别。

In some cases, however, processes may require to set up their own LDT. This turns out to be useful to applications (such as Wine) that execute segment-oriented Microsoft Windows applications. The modify_ldt( ) system call allows a process to do this.

然而,在某些情形下,进程可能要求设置属于自己的LDT,这对于某些程序,比如Wine,在执行基于分段的MS程序时,是很有用的。系统调用modify_ldt()允许进程这样做。

Any custom LDT created by modify_ldt( ) also requires its own segment. When a processor starts executing a process having a custom LDT, the LDT entry in the CPU-specific copy of the GDT is changed accordingly.

任何一个由modify_ldt()创建的LDT要求拥有属于自己的段。当处理器开始执行一个拥有自定义的LDT的进程时,GDT中的LDT条目会相应地改变。

User Mode applications also may allocate new segments by means of modify_ldt( ); the kernel, however, never makes use of these segments, and it does not have to keep track of the corresponding Segment Descriptors, because they are included in the custom LDT of the process.

用户模式的进程也可以通过modify_ldt()创建新的段;然而内核不会使用这些段,也不会管理相应的段选择子,因为它们被进程自身的LDT管理。
阅读(350) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~