Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a Relocation Register

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

  • What is relocation register?
  • How it is used in address mapping from logical to physical address?
like image 711
rashidali Avatar asked May 14 '16 19:05

rashidali


People also ask

What is relocation register used for?

Relocation and limit registers are used to protect user processes from each other. Relocation register contains value of the smallest part of the physical address. Limit register contains range of logical addresses, each logical address must be less than the limit register.

What is relocation register in memory management?

Relocation register contains value of smallest physical address whereas limit register contains range of logical addresses. Each logical address must be less than the limit register.

Which register is known as relocation register?

Relocation register is also called as base register.

What is meant by relocation in operating system?

Relocation is the process of assigning load addresses for position-dependent code and data of a program and adjusting the code and data to reflect the assigned addresses.


2 Answers

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.

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.

In simple,

1) CPU generates Logical address(say 345)

2) 345 is compared with value in Limit Register.

3) If 345 > Limit Register then TRAP

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

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.

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

like image 186
user3718000 Avatar answered Oct 21 '22 21:10

user3718000


Relocation is a base register which hold the smallest physical address and the limit register is the range of logical address or size of range.

like image 27
Sunny Avatar answered Oct 21 '22 19:10

Sunny