0% found this document useful (0 votes)
6 views

Operating System Lecture14

Uploaded by

anmol2ranjan
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Operating System Lecture14

Uploaded by

anmol2ranjan
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Operating System

Memory Management: Lecture 14

Designed by
Mr. Prithwish Das
Assistant Professor
CSE, NSEC
Address Binding
Address binding is a mapping from one address space to another. There are three
types of address binding
1. Compile time address binding
2. Load time address binding
3. Execution time address binding
1. Compile time address binding
During the compilation the absolute address will get embedded in the executable code. That is the
program knows from which address it is actually to get loaded and from where it is actually get executed.
( logical and physical both addresses are same)
Minimum setup time is the one of the advantage of compile time address binding.
The disadvantage of this address binding is if the target memory space is preoccupied by any other
program. Collision will take place . The current program will overwrite the previous program.
2. Load time address binding
When the program will get compiled then all the addresses will be in relocatable addressing format. Take
an example suppose in compile time the starting address of a program is 0 and ending address is 3000
(logical address). During the loading time the memory address from 2000 onwards are available. So 0
will be mapped into the memory address 2000 (0+2000) and 3000 will be mapped into 5000
(2000+3000). Actual loading addresses (Physical address) are from 2000 to 5000.
The advantage of this address binding is here never overlap will be occurred because of mapping into
free memory address space.
The disadvantage is it is slower than compile time address binding.
Address Binding contd.
3. Execution time address binding
During the execution the program can be moved from one memory block to another memory
block if it is allowed. After getting the physical address space in load time address binding it can
be moved to another free physical address space during runtime.
The advantage of this address binding is it is more dynamic.
The disadvantage it takes much more time.
Multistep processing of a user program
Source
program

compiler or Compile
assembler time

Object
Other Module
object
modules
Linkage editor

Load
System load time
library Module

Dynamically loader
loaded system
library
In-memory binary Execution
Dynamic
memory image time (run
linking
time)
Dynamic loading
• Programs are divided into different modules.
• To execute the program all the modules are not
required at the same time.
• Before the module is called there is no need to load
the module into the primary memory.
• Dynamic loading says that load the main module first
• Load the other modules when they will be required.
• Those modules will be required in near future they will
be loaded (dynamically) into the primary memory
when they will be called.
Dynamic Linking
• Modules of the program requires many functions.
• The body of the system defined functions are stored into the system libraries.
• When the respective function will be called then only the respective library
routine will be loaded into the memory for executing the body of the function.
• The library routine is not loaded into primary memory prior until and unless
the modules are executing the body of the function.
• The particular segment of code is called stub which will hold the required
information for executing the body of a function which library routine is
required and where does this library routine is located.
• Suppose there is a conditional statement. If condition is true then execute
function1 else function2.
• There is no need to link both function at the same time.
• Depending upon the out come of the conditional statement required library
function will be linked.
Overlays
For a assembly language program
Symbol table 20K
to generate machine level
language assembler is required.
Take an example where two stage
Common
30K assembler (pass 1 and pass 2) is
routines
required. The size of the
components are as follows:
Overlay driver 10K
Pass 1 70 KB
Pass 2 80 KB
Symbol table 20 KB
70K pass1 pass2 80K
Common routines 30 KB

Overlays for a two pass assembler


• To load everything at once total 200 KB (70+80+20+30) memory would be required.
• Pass1 and Pass2 do not need to be in the memory at the same time
• Define two overlays- Overlay A and Overlay B.
• One Overlay driver (10 KB) is extra required to manage the Overlays.
• Overlay A includes Symbol table, common routine and Pass 1. That is total 120 KB(20+30+70).
• Overlay B includes Symbol table, common routine and Pass 2. That is total 130 KB(20+30+80).
• Suppose 150 KB memory space is available.
• To run Overlay A 130 KB and for Overlay B 140 KB memory space are required.( 10 KB is extra required for
overlay driver)
• Using Overlay the memory space is required 140 KB ( max of (130,140)). Since 150 KB memory space is
available so it can run properly.
• Without using overlay it can not be possible to execute because of 200 KB memory space will be required.
Thank You

You might also like