Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How at execution time address binding is done in OS?

I am readin Galvin's Operating System book. In memory management's address binding it said about 3 types of address binding. compile time, load time, execution time. And about Execution time address binding:" The physical address are computed at the time of execution." But my question is that these computations for the physical address is for the memory's base address to load the process into memory. To execute the process first it has to be loaded into memory. For that it requires some physical memory address. Then how at execution time these addresses are computed? I am confused.

Can some provide explanation for this.

Thanks

like image 464
poddroid Avatar asked Jun 01 '11 15:06

poddroid


People also ask

What is execution time or dynamic address binding?

Execution time or dynamic Address Binding : 1 It will be postponed even after loading the program into memory. 2 The program will be kept on changing the locations in memory until the time of program execution. 3 The dynamic type of address binding done by the processor at the time of program execution.

What is address binding in operating system?

This type of address binding will be done by the OS memory manager i.e loader. It will be postponed even after loading the program into memory. The program will be kept on changing the locations in memory until the time of program execution. The dynamic type of address binding done by the processor at the time of program execution.

When will the address binding be done in a program?

It will be done after loading the program into memory. This type of address binding will be done by the OS memory manager i.e loader. It will be postponed even after loading the program into memory. The program will be kept on changing the locations in memory until the time of program execution.

Which of the following is responsible for the load time address binding?

Loader is responsible for the load time address binding. Execution time address binding is done by processor. It generates physical address. It generates dynamic absolute address. Load time address binding is done after loading the program into memory. Execution time address binding is done at the time of program execution.


2 Answers

You are correct in your thinking. The difference between load-time and run-time binding is that in run-time every time there is a memory lookup it goes through a "relocation register" which is like the base register and then you add an offset.

In load-time binding it does the same thing but subsequent lookups don't require evaluation of this register. The addresses are set when it is first pulled into memory. Hence if the base address changes you need to re-load the whole process to fix up all the relocatable addresses.

In the case of run-time, you can move the process around in physical memory and not need to worry about re-loading it to fix the mapping up because every time there is an access to memory it maps it then.

Load-time binding results in matching logical/physical addresses but run-time results in differing logical/physical addresses.

I hope this is clearer for you. I've just started learning about Memory Management too :)

like image 123
I King Avatar answered Oct 07 '22 00:10

I King


When it says that the actual base address is generated at execution time it means that that the address in RAM (physical address) is determined at execution time from the virtual address using the MMU. This whole address conversion is done on the fly. For executing the process the starting virtual address has to be known. When the process is to be run its virtual page table is loaded in the MMU and then the MMU quickly calculates the physical address(in RAM) and the execution goes on with MMU generating physical addresses from page tables. Consider reading Tanenbaum's Modern Operating Systems. I find it better.

like image 41
lovesh Avatar answered Oct 06 '22 23:10

lovesh