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
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.
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.
Relocation register is also called as base register.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With