Thakur Karthik
Thakur Karthik

Reputation: 3518

Different types of address binding in OS?

There are different ways by which OS know how to locate a particular piece of code in the physical storage.How does it convert the logical memory to physical location?

Upvotes: 0

Views: 10514

Answers (2)

Meenu SInha
Meenu SInha

Reputation: 11

Found very good explanation here.

Summarising below:

Logical memory/address is converted to physical location/address using following types of address binding (depending upon when is the binding/conversion happening):

  1. Compile time binding
  2. Load time binding
  3. Execution time binding

If program's final location in physical memory is known at compile time then binding can happen at compile time itself, only caveat is that program needs to be recompiled anytime its physical memory location changes.

If program's final location in physical memory is "not" known at compile time then compiler generates relative addresses or relocatable address in terms of offsets from the starting location of the program(for e.g., 32 bytes from starting location). This relocatable address is then bound by loader to absolute addresses in physical memory when it loads the program into any process into the main memory. Now if the starting location changes then program does not need to be "recompiled" but only needs to be "reloaded".

Execution time binding happens only in the cases where process can move from one physical memory segment to another at execution time.

Upvotes: 1

Thakur Karthik
Thakur Karthik

Reputation: 3518

The binding is necessary to link the logical memory to the physical memory.To know where the program is stored is necessary in order to access it.The binding may be of three different types.

  1. Compile Time Binding:Address where the program is stored is known at compile time.
  2. Load Time Binding:Address is not known at compile time but known at loading of program i.e,before running.
  3. Run Time Binding:Address is known at running of executable program.

Upvotes: 2

Related Questions