- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
如果该位为零,那么内存是逐字节寻址的?如果是1,那么内存是按4Kb×4Kb寻址的?
例如,如果该位设置为 0,并且我寻址内存位置 a000h,那么我将寻址该字节在那个位置对吧?如果我寻址下一个位置a001h,那么这将是内存中的下一个字节,对吗?
但如果该位为 1,我会寻址 4Kb block 吗?
那么寻址 a000h 会给我一个 4Kb block ,而 a001内存中的下一个 4Kb?
最佳答案
kbzombie的回答几乎是正确的。互联网上的各种资源实际上都犯了同样的错误,可能是因为一个复制了另一个。
设置粒度位后,限制确实左移 12 位,但需要注意的是插入了一位。因此,0xfffff
会导致 0xffffffff
的限制,0x00000
会导致 0x00000fff
的限制。
The 80386 Programmer's Reference Manual有这样说:
6.3.1.2 LIMIT CHECKING
The limit field of a segment descriptor is used by the processor to prevent programs from addressing outside the segment. The processor's interpretation of the limit depends on the setting of the G (granularity) bit. For data segments, the processor's interpretation of the limit depends also on the E-bit (expansion-direction bit) and the B-bit (big bit) (refer to Table 6-2).
When G= 0, the actual limit is the value of the 20-bit limit field as it appears in the descriptor. In this case, the limit may range from 0 to 0FFFFFH (220 - 1 or 1 megabyte). When G= 1, the processor appends 12 low-order one-bits to the value in the limit field. In this case the actual limit may range from 0FFFH (212 - 1 or 4 kilobytes) to 0FFFFFFFFH (232 - 1 or 4 gigabytes).
关于assembly - GDT 的粒度位对于寻址内存到底有什么变化?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26577692/
如果该位为零,那么内存是逐字节寻址的?如果是1,那么内存是按4Kb×4Kb寻址的? 例如,如果该位设置为 0,并且我寻址内存位置 a000h,那么我将寻址该字节在那个位置对吧?如果我寻址下一个位置a0
这是一个非常愚蠢的问题,但我似乎无法解决它。在我的操作系统中,GDT 是通过与内核链接的汇编代码设置的。当发生这种情况时,当然会在加载 GDT 时设置数据段和代码段。此信息在汇编代码中存储为 GDT_
前言 所谓工作模式,是指CPU的寻址方式、寄存器大小、指令用法和内存布局等。 实模式 段基址:段内偏移地址”产生的逻辑地址就是物理地址,即程序员可见的地址完全是真实的内存地址。 保护模式 在保护模式中
我有一个引导加载程序,它正在为我设置 GDT。是否可以找出这个 GDT 的地址以便我可以使用它? 最佳答案 当然,只需使用 sgdt 指示读取当前设置。 关于assembly - 是否有可能获得 GD
使用 lgdt 初始化 GDT 并将其加载到 GDTR 后,稍后如何更新 GDT? 如果我使用 sgdt 命令获取基地址,然后更新或添加条目,然后使用 lgdt 再次重新加载,我是否正确?还有其他方法
我目前正在使用 x86 Assember,以提高我的低级编程技能。目前,我在 32 位保护模式下的寻址方案遇到了一个小问题。 情况如下: 我在 0x7e0 加载了一个程序,它将 CPU 切换到保护模式
在bootasm.S .p2align 2 # force 4 byte alignment gdt: SEG_NULLASM
flush_gdt: lgdt [gdtr] jmp 0x08:complete_flush complete_flush: mov ax, 0x10 mov ds,
在bootasm.S .p2align 2 # force 4 byte alignment gdt: SEG_NULLASM
GDT如何反射(reflect)在进程的线性空间上(如果我没理解错的话,GDTR包含page和offset)。?或这个问题的另一个版本:GDTR 对于每个进程都是唯一的。? 最佳答案 只有一个 GDT
我正在开发一个小型操作系统,它将为每个进程使用单独的本地描述符表。我知道我需要使用 lldt从我的 GDT 加载 LDT 段的指令。我已经让我的内核以有效的 GDT 以保护模式运行,但我无法弄清楚我的
我主要使用 C++ 制作操作系统,但对于引导加载程序,我使用 FASM。当我尝试设置 GDT 时,Qemu 清除屏幕并在顶部重新打印“SeaBIOS”。它会继续这样循环,直到我关闭它。这是它的动图:
我正在编写一个简单的自制 64 位操作系统,通过 UEFI 启动它。这意味着当我的代码开始执行时,它已经处于长模式,并且启用了分页。 现在,退出 UEFI 引导服务后,我想用我自己的控制结构替换 UE
在我开始之前,这里提到的所有代码都在运行@ring0(内核模式)- OSX 10.9: 以下函数崩溃: UINT64 GetGdtBase() { UINT64 gdt = 0; as
我正在尝试使用 Eclipse (Neon) 在 C++ 中运行一个非常简单的 GUI 应用程序:程序启动,显示红色并在 10 秒后自行关闭。 为了实现这一点,我正在运行 Allegro 5.0.10
这个问题的灵感来自多年来许多人遇到的问题,尤其是在 x86 操作系统开发中。最近一个related NASM question被编辑撞了。在那种情况下,该人使用 NASM 并收到组装时间错误: shi
据我了解,这两个表都包含段描述符,提供每个段的访问详细信息,包括基地址、类型、长度、访问权限...等。 看着这个blog差异描述如下: 1. GDT在系统中只有一份,而LDT可以有多个 2. GDT在
我是系统架构的入门级学生,准确地说是intel x86。目前我正在阅读 Intel 的手册 (1,3a,3b,3c),但我被困在分段部分。 据我所知,在保护模式下,系统正在将逻辑内存转换为线性内存(或
I want to use gdb to see my GDTR/LDTR/TTR and segment register 不可见部分(x86) 所以在 gdb 中我输入“p/x $gdtr”...
我是一名优秀的程序员,十分优秀!