Dynamic Relocation

What is Dynamic Relocation?

Dynamic relocation refers to a process where the data stored in the memory of the computer is moved to other parts of it while the program is still active and creating a more efficient memory storage.

Technically, in this specific type of relocation process mapping from the virtual to the physical address space typically happens at runtime and is performed by a specific type of hardware device called the Memory Management Unit or MMU.

Understanding Dynamic Relocation

What is Dynamic Relocation

In simple terms, dynamic relocation is the process of allocating new absolute addresses to the computer program in implementation.

It is an advanced method that involves the following:

Ideally, the registers, hardware and the CPU, all work together to facilitate the working process during dynamic relocation performing their respective tasks as explained below.

Ideally, the logical register, which contains the smallest physical addresses, protects the user processes from the varying codes and data of the operation system and also from each other.

Read Also:  What is Virtual Address Extension (VAX)? (Explained)

Also called the base register, it also helps the virtual address obtain the physical address.

Every address that is generated by the user process has the value in the relocation register added to them when these are sent to the memory.

Typically, in a dynamic relocation process, the operating system adds the value of the relocation register, which is generated by the compiler, and the register, in turn, makes the translation of the virtual address space into a physical address space.

The address is compared by the hardware with the limit address, which should be less than the base.

However, if it is not, then the CPU ignores the physical address by taking an address trap.

Advantages

Disadvantages

Static Vs Dynamic Relocation

Read Also:  ACPI (Advanced Configuration and Power Interface) Explained

Which Registers are Used by Dynamic Relocation?

Dynamic relocation typically uses two specific registers, such as the simple addition register and the simple comparison register.

The process also uses a relocation register.

Conclusion

The dynamic relocation process is a safe and efficient method of memory management.

Though it is a bit complicated process, the fact that it allows changing memory addresses dynamically during the runtime using simple and inexpensive registers makes it quite a fast and favored method for the linked lists.