什么是搬迁登记册 [英] What is a Relocation Register

查看:52
本文介绍了什么是搬迁登记册的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读Operating system 9th edition这本书,并且在第8章中提到了操作系统中名为地址绑定的主题.在阅读该主题时,我通过了一个主题重定位寄存器,但我仍然对以下问题感到困惑,因为这本书没有包含一个很好的描述来澄清这个概念.我的问题是

I am reading the book Operating system 9th edition and in chapter 8 is mentioned a topic called Address Binding in Operating System. While reading the topic I came through a topic relocation register, but I'm still confused concerning the following questions as the book didn't include a fine description to clarify the concept. My questions are

  • 什么是重定位寄存器?
  • 它如何用于从逻辑地址到物理地址的地址映射?

推荐答案

CPU 生成的地址是主内存不知道的逻辑地址.物理内存或主内存只知道物理地址.

The address generated by the CPU is a logical address which is not known to the Main Memory. The Physical memory or the Main Memory knows only the Physical address.

因此 CPU 生成的地址(逻辑地址)与限制寄存器进行比较,如果该值较低,则将其与重定位寄存器中的值相加以产生物理地址.

Therefore the address generated by the CPU(Logical Address) is compared with a Limit Register and if the value is low, It is added to the value in Relocation Register to yield a Physical Address.

简单来说,

1) CPU 生成逻辑地址(比如 345)

1) CPU generates Logical address(say 345)

2) 345 与限制寄存器中的值进行比较.

2) 345 is compared with value in Limit Register.

3) 如果 345 > 限制寄存器则 TRAP

3) If 345 > Limit Register then TRAP

4) 如果 345 <限制寄存器然后将值与重定位寄存器(例如 300)相加以获得物理地址.即:345+300 = 645(物理地址)

4) If 345 < Limit Register then value is added with Relocation Register(say 300) to get physical address. ie: 345+300 = 645(Physical address)

因此,如果 CPU 可以生成 0 到 345 范围内的逻辑地址,那么相应的物理地址可以从 R+0 到 R+345 范围内,其中 R 是重定位寄存器中的值.

Therefore if CPU can generate logical address in the range 0 to 345, then the corresponding physical address can range from R+0 to R+345 where R is the value in Relocation Register.

因此,用户看到的地址和 RAM 看到的访问数据的地址是不同的.

So, the address a user sees and the address a RAM sees to access a data are different.

这篇关于什么是搬迁登记册的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆