Address Binding, Logical v/s Physical Address Space & Dynamic Loading
Most important thing Is to determine the number of legal addressees that the process may access and to ensure that the process only use two registers:
- Base Register: holds the smallest legal physical memory addresses.
- Limit Register: Specifies the size of the range.
Address Binding
The binding of instruction and data to memory addresses can be done at any step along the way.
- Compile time: if we know during the compile time where the process will reside in memory, then absolute code can be generated. In further stages if the starting location changes then it is necessary to recompile this code.
- Load Time: if it is not known at compile time where the process will reside in memory the compiler must generate relocatable code. Final binding is delayed until runtime.
- Execution Time: If the process can be moved during execution from one memory segment to another, then binding must be delayed until run time.
Dynamic Loading
- For better memory utilization
- A routine is not loaded until it is called
- All routine are kept on disk in a relocatable load format.
- The main program is loaded into memory and is executed
- When routine needs to call another routine the calling routine first checks to see whether the other routine has been loaded.
- Routine loaded only when needed.
- Useful when large amount of code are needed to handle infrequently occurring cases.