31 address binding, dynamic loading

myrajendra 6,466 views 32 slides Jan 17, 2013
Slide 1
Slide 1 of 32
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32

About This Presentation

No description available for this slideshow.


Slide Content

1
Address binding, Dynamic loading
Storage Management

9CM402.31 2
HOME PREVIOUS TOPIC NEXT
PREVIOUS QUESTION PAPERS FOR OS
CPP TUTORIALS

3
Recap
In the last class, you have learnt
•Recovery from Deadlock

4
Objectives
On completion of this period, you will be able to
Know about
•Storage management
•Address binding
•Dynamic loading

5
Primary Memory
•Primary memory is of two types RAM and ROM
•RAM – Random Access Memory
– Volatile Memory
– Can be directly accessibly by the CPU
– Speed of RAM is compatible to Processor speed
– Capacity is in GB’s
•ROM – Read Only Memory
–Non Volatile

6
Storage Management
•Memory is a large array of words or bytes with its
own addresses
•In Single user operating system entire memory
belongs to a single process
Ex. DOS
•In multi user operating system many processes
share the memory
Ex. UNIX, Windows NT, Windows 2003 server
etc.

7
Storage Management
What is meant by storage management?
•Allocate memory to multiple processes and
prevents them from overlapping
•Memory is utilized in an efficient manner

8
Instruction Execution Cycle
•Instruction is fetched from memory
•Decoded and may cause operands to be fetched
from memory
•After executing the instruction on the operands
the results are stored back in memory
Start Fetch Execute
Halt
Fig - 1

9
Multistep Processing of User Program
Fig - 2

10
Address Binding
•Program must be brought into memory and placed
with in a process for it to be run
•Collection of processes on the disk that are waiting
to be brought into memory for execution - Input
queue
•A user program will go through several steps before
being executed as shown in Fig - 2

11
Address Binding
•Address is represented in different ways during this
steps
•Address in source program is symbolic (Ex. COUNT)
•Compiler bind these symbolic addresses to
relocatable addresses such as
–14 bytes from the beginning of this module

12
Address Binding
•Relocatable means that the program image can
reside anywhere in physical memory
•A linkage editor or a loader bind relocatable
addresses to absolute addresses ( such as
74014 )
•Each binding is a mapping from one address
space to another

13
Address Binding
•Binding of instruction and data to memory
address can be done at
–Compile time
–Load time
–Execution time

14

15

16

17
Dynamic Loading
•Routine is not loaded until it is called
•All routines are kept on disk in a relocatable
load format
•Main program is loaded and executed
•A routine needs to call another routine

18
Dynamic Loading
•The relocatable linking loader is called to load
the desired routine
•Control is passed to newly loaded routine
•Routine is called into memory only when it is
needed

19

20
routine( )
{
------- ;
------- ;
------- ;
}
Memory
•main( )
{
---- ;
---- ;
routine( );
---- ;
}
// routine is called dynamically
Dynamic Loading - Example
Secondary storage

21
Advantages
•Better memory utilization
•Unused routine is never loaded
•Useful when large amounts of code are needed
to handle infrequently occurring cases
–Ex. Error routines
–Although the total program size may be large, the
portion i.e., used is much smaller
Dynamic Loading

22
•No special support from the operating
system is required
• Implemented through program design
•Operating system provides library
routines to implement dynamic loading
Dynamic Loading
Advantages

23
Summary
In this class, you have learnt
• Storage Management
• Address binding
•Dynamic loading
•Advantages of dynamic loading

24
Frequently Asked Questions
•What is address binding?
•What is meant by Dynamic loading?
•Explain the concepts of Dynamic loading
•What are the advantages of Dynamic loading?

25
Quiz
1. Memory is a large array of
a) Words
b) Registers
c) Bits
d) None

26
Quiz
2. Address in source program is address
a) Relocatable
b) Symbolic
c) Absolute
d)None

27
Quiz
3. Compiler binds symbolic address to _________
address
a) Absolute
b) Symbolic
c) Relocatable
d) None

28
Quiz
4. Loader binds relocatable address to ________
address
a) Absolute
b) Symbolic
c) Relocatable
d) None

29
Quiz
5. All routines are kept on disk in a ______ load
format
a) Relocatable
b) Symbolic
c) Absolute
d) None

30
Quiz
6. Special support from the operating system is
required
a) Yes
b) NO

Other subject materials
•Web designing
•Micro processors
•C++ tutorials
•java
home

32
Quiz
7. Routine is not called until it is required in
dynamic loading
a) True
b) False
Tags