- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
Intel 的 64 位 IDT 门描述符中有一个段选择器。然而,根据我对 5 部分 Intel 手册的理解,中断处理程序的线性地址从 IDT 门描述符中指定的 64 位偏移量加载到 RIP 中。
段选择器的唯一用途是检查:
我的问题是:
非常感谢!
最佳答案
如果我的解释正确的话,根据英特尔手册,x64 不使用分段。我读过AMD's System programming for AMD64为了理解这一点,因为我发现他们的解释更容易理解,因为他们明确地处理 x86_64 (我想他们确实发明了它);他们说:
In long mode, the effects of segmentation depend on whether the processor is running in compatibility mode or 64-bit mode:
- In compatibility mode, segmentation functions just as it does in legacy mode, using legacy 16-bit or 32-bit protected mode semantics.
- 64-bit mode, segmentation is disabled, creating a flat 64-bit virtual-address space. As will be seen, certain functions of some segment registers, particularly the system-segment registers, continue to be used in 64-bit mode.
具体来说,请查找第 4.8 节长模式段描述符。回答你的第二个问题:
Fields Ignored in 64-Bit Mode. Segmentation is disabled in 64-bit mode, and code segments span all of virtual memory. In this mode, code-segment base addresses are ignored. For the purpose of virtual-address calculations, the base address is treated as if it has a value of zero.
解释一下:因为 x86_64 中的“段”是整个地址空间,所以基地址除了 0 之外没有任何意义,因为偏移量都是绝对的(相对于 0)。
因此,这将回答我认为的第一个问题 - RIP 被视为 64 位偏移值。来自同章的门描述符页面:
In long mode, gate descriptors are expanded by 64 bits, allowing them to hold 64-bit offsets.
处理数据段时会变得更加复杂:
Data segments referenced by the FS and GS segment registers receive special treatment in 64-bit mode. For these segments, the base address field is not ignored, and a non-zero value can be used in virtual-address calculations. A 64-bit segment-base address can be specified using model- specific registers. See “FS and GS Registers in 64-Bit Mode” on page 70 for more information.
该部分指出:
FS and GS Registers in 64-Bit Mode. Unlike the CS, DS, ES, and SS segments, the FS and GS segment overrides can be used in 64-bit mode. When FS and GS segment overrides are used in 64-bit mode, their respective base addresses are used in the effective-address (EA) calculation. The complete EA calculation then becomes (FS or GS).base + base + (scale ∗ index) + displacement. The FS.base and GS.base values are also expanded to the full 64-bit virtual-address size, as shown in Figure 4-5. The resulting EA calculation is allowed to wrap across positive and negative addresses.
In 64-bit mode, FS-segment and GS-segment overrides are not checked for limit or attributes. Instead, the processor checks that all virtual-address references are in canonical form.
换句话说,数据段可以像使用分段一样,尽管只检查分段的形式,而不检查访问的形式是否位于段的范围内。
我认为这是正确的解释;然而,非常感谢更正/指针。
关于assembly - IA-32e 64 位 IDT 门描述符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8284756/
我正在处理一个启动时间要求很紧的项目。目标架构是在 32 位保护模式下运行的基于 IA-32 的处理器。确定可以改进的领域之一是当前系统动态初始化处理器的 IDT(中断描述符表)。由于我们没有任何即插
对于 IA-32 架构,IDT 条目具有以下格式: struct IDTDescr { uint16_t offset_1; // offset bits 0..15 uint16_t s
在 linux 内核的控制流中,发现控制权转移到 IDT,它有中断的位置(例如:0x80 系统调用)。然后控制移动到适当的系统调用。另请阅读 IDT 仅在启动时初始化。 我想了解更多来自真实内核的 I
注意:我在 FreeBSD 上运行,但我也将 Linux 作为标签包含在内,因为这个问题有些笼统,而且我对 Linux 特定的解决方案很感兴趣。 编辑 : 只是为了确认问题不是 FreeBSD 特有的
在Linux系统上,中断向量表(IVT)和中断描述符表(IDT)有什么区别? 最佳答案 这与 Linux 无关。它是 CPU 的结构,操作系统对其进行初始化以处理中断和异常。在实寻址模式下,该结构只包
我正在 Hook 我的 x86 linux 内核的 IDT 条目。更具体地说,我连接了第 0x80 个 IDT 条目,它是系统调用中断处理程序。 如果我如下设置 Hook 处理函数,一切都会顺利 vo
我的目标是从 MacOS 内核模块访问 IDT。 我在 VMFusion 10.0.1 下运行 macOS 10.13.2,似乎 sidt 汇编命令指向损坏的表结构。 此操作码应将地址返回到“中断描述
我目前正在尝试从头开始创建一个 x86-64 内核(使用 GRUB Multiboot2 作为引导加载程序)。我设置我的 GDT 很好,但是在设置我的 IDT 时,似乎有问题。我通过 hlt 在我的代
我无法让 IDT 工作,因为我的中断例程没有被调用,尤其是当我按下键盘上的某个键时与键盘相关的例程。我正在传递 IDT 表的特殊 48 位指针地址。我正在这样做 dt_ptr idt_ptr; //
以下代码: 标题: // InterruptDescriptorTable.h #define MAX_IDT_ENTRIES 256 #define MAKELONG(a, b) ((unsign
在 IDT 中,每一行都有一些称为“DPL”的位 - 描述符特权级别,内核为 0,普通用户为 3(可能还有更多级别)。我不明白两件事: 这是运行中断处理程序代码所需的级别?或触发导致它的事件?因为 s
Intel 的 64 位 IDT 门描述符中有一个段选择器。然而,根据我对 5 部分 Intel 手册的理解,中断处理程序的线性地址从 IDT 门描述符中指定的 64 位偏移量加载到 RIP 中。 段
这个问题的灵感来自多年来许多人遇到的问题,尤其是在 x86 操作系统开发中。最近一个related NASM question被编辑撞了。在那种情况下,该人使用 NASM 并收到组装时间错误: shi
尝试使用以下代码获取中断描述符表的数据: /* SIDT returns IDT in following format */ #pragma pack(1) typedef struct {
我正在尝试使用 R 包 CEM 执行粗化的精确匹配。我有一个观察数据框(没有遗漏的观察结果,列名见下文),我正在尝试: 以抑郁症 (depres6mo) 进行 CEM 作为匹配治疗,然后 对匹配的数据
我是一名优秀的程序员,十分优秀!