关于实模式物理内存寻址
我和我的朋友正在集思广益,讨论一个有关实模式下物理内存寻址的问题,但我们无法解决这个问题。就这样吧。
在实模式下,16 与段选择器寄存器相乘,并与偏移寄存器相加,得到 20 位物理地址。因此,这导致了片段重叠的可能性。
EG "Segment Selector -> 0040 & Offset -> 0010" = "Segment Selector -> 0030 & offset -> 0110"
根据我们的理解,段选择器在添加到之前会移位 4 位。抵消。因此,为了避免这种分段,他们为什么不在将段选择器添加到偏移量之前将其移动 6(乘以 64)。我们认为这将消除内存重叠的可能性。
这是否与他们在那段时间面临的任何硬件限制有关,或者仅仅是一个设计决策。
Me and my friend were brainstorming about a question concerning physical memory addressing in real mode and we couldn't wrap our heads around it. Here goes.
In real mode 16 is multiplied to the segment selector register and added to the offset register to get the 20-bit physical address. This consequently leads to the possibility of overlapping segments.
E.G. "Segment Selector -> 0040 & Offset -> 0010" = "Segment Selector -> 0030 & offset -> 0110"
It is our understanding that the segment selector is shifted by 4 bits before being added to the offset. So in order to avoid this segmentation why didn't they just shift the segment selector by 6 (multiply it by 64) before adding it to the offset. In our view this would have eliminated the prospect of memory overlapping.
Does it have to do with any hardware limitations they faced during that time or is it simply a design decision.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是由于设计限制。他们有一个 20 位地址总线,最简单的事情就是让段寄存器选择该段落,然后向其添加偏移量(对于超过 20 位地址总线的部分,它会环绕到内存底部)。
It's due to the design constraints. They had a 20-bit address bus, the simplest thing to do was simply to have the segment register select the paragraph, then add the offset to it (and for the parts that exceed the 20-bit address bus, it wraps around into the bottom of memory).
移位 4 即可获得一整兆字节的地址空间。哇!
该设计是在 8 位系统配置 64 kB 的时候完成的,因为那些有钱的人可以购买这么多内存。并且有一个足够大的盒子来容纳所有这些内存板。
16 kB 的样子如下: http://www.s100computers.com/Hardware%20Folder/CCS/16K%20RAM/16K%20RAM.htm
如果您要安装 4 MB,则首先必须租用另一个存放内存板的空间!
Shifting by 4 gave you an address space of a whole megabyte. Wow!
The design was done at a time when the 8-bit systems were configured with 64 kB, for those rich enough to buy that much memory. And with a big enough box to fit all those memory boards.
Here's what 16 kB looked like: http://www.s100computers.com/Hardware%20Folder/CCS/16K%20RAM/16K%20RAM.htm
If you were to install 4 MB, you would first have to rent another room to store the memory boards!