您的位置:首页 > 运维架构 > Linux

深入理解Linux内核 第二章知识点总结

2016-02-21 13:31 387 查看
总结了第二章知识点,用提问的形式来检测知识点的掌握程度

1-80x86微处理器的三种地址:

When dealing with 80 x 86 microprocessors, we have to distinguish three kinds of addresses(当处理80x86微处理器时,我们需要区别三种地址):

Logical address(逻辑地址)

包含在机器语言指令中,用于指定操作数或者指令的地址。逻辑地址包含著名的80x86段结构,段结构是强制MS-DOS和windows编程者将他们的程序分为段。每个逻辑地址由段和偏移组成,偏移表示段的开始到实际地址的距离。

Included in the machine language instructions to specify the address of an
operand
or of an instruction. This type of address
embodies(包含)
the well-known 80 x 86 segmented architecture that forces MS-DOS and Windows programmers to divide their programs into
segments(段)
. Each logical address consists of a segment and an offset (or displacement) that
denotes(表示)
the distance from the start of the segment to the actual address.

Linear address (also known as
virtual address
)线性地址又称为虚拟地址

32位无符号整数,可以表示最高4Gb地址(0x00000000~0xffffffff)。

A single 32-bit unsigned integer that can be used to address up to 4 GB that is, up to 4,294,967,296 memory cells. Linear addresses are usually represented in
hexadecimal notation(16进制符号)
; their values range from 0x00000000 to 0xffffffff

Physical address(物理地址)

用于在内存芯片上寻址内存单元。物理地址是32位或者36位的无符号整数。

Used to address memory cells in memory chips. They correspond to the
electrical signals(电子信号)
sent along the address pins of the microprocessor to the memory bus. Physical addresses are represented as 32-bit or 36-bit unsigned integers.

2-逻辑地址是如何转换为物理地址的?

在MMU中先通过
segment 单元
将逻辑地址转换为线性地址(或虚拟地址),然后通过
paging (分页)单元
转换为物理地址。

3-bus和RAM之间拥有硬件电路
memory arbiter
,其作用是什么?

在RAM chips空闲时,允许处理器的访问。RAM chips繁忙时,拒绝其他处理器的访问。

4-逻辑地址包含哪两部分?

a segment identifier(段标识符)

an offset(偏移量)

5-段寄存器的作用?

为了更快的得到段选择子(segment selectors),用特定寄存器来保存其值。

6-Cs、ds、ss的作用?cs在的特殊用途?

7-什么是段描述符?

8位段描述符来描述段的信息

8-GDT/GDTR?LDT/LDTR?

段描述符保存在全局描述符表或者局部描述符表中。

只有一个GDT,每个进程有各自的LDTR。

描述符表的地址和尺寸保存在相应的寄存器(GDTR/LDTR)中

9-TSS/TSSD是什么?

TSS是任务状态段,任务状态段是用于保存处理器寄存器的内容.

TSSD是TSS的描述符。TSSD仅仅可以出现再GDT中,相应的
type
域的值要为11或者9,取决于相应的进程是否运行在CPU上。

10-LDTD是什么?

包含LDT的段的描述符。仅能存在于GDT中。

11-段选择子的三个域?

index, TI, RPL

12-段描述符在GDT和LDT中地址如何得到?

LDT or GDT首地址 + 8 × (段描述符 index域的值)

13-Linux为何优先使用分页(paging)而不是段(segmentation)?

多个进程使用相同段寄存器的值和相同的线性地址集使得内存管理更容易

一些体系结构如RISC对段支持性很差,Linux需要兼容广泛的体系结构。

14-如何寻址到内核段(数据段或者代码段)?

将宏_ USER_CS , USER_DS , KERNEL_CS , and _KERNEL_DS 之一的值加载到
cs
段寄存器中。

15-TLS段?

是一种允许多线程应用充分利用三个包含每个线程局部数据的机制。

16-APM段:

当APM驱动调用BIOS函数进行得到和设置APM设备状态的时候,其可能用到的代码和数据段

17-PnP段:

Linux pnp驱动调用BIOS函数来检测PnP服务使用的资源,其可能调用的数据和代码段
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: