31 address binding, dynamic loading
DESCRIPTION
TRANSCRIPT
![Page 1: 31 address binding, dynamic loading](https://reader033.vdocuments.us/reader033/viewer/2022061120/546d0e7daf79595e658b8349/html5/thumbnails/1.jpg)
1
Address binding, Dynamic loading
Storage Management
![Page 2: 31 address binding, dynamic loading](https://reader033.vdocuments.us/reader033/viewer/2022061120/546d0e7daf79595e658b8349/html5/thumbnails/2.jpg)
9CM402.31 2
HOME PREVIOUS TOPIC NEXTPREVIOUS QUESTION PAPERS FOR OSCPP TUTORIALS
![Page 3: 31 address binding, dynamic loading](https://reader033.vdocuments.us/reader033/viewer/2022061120/546d0e7daf79595e658b8349/html5/thumbnails/3.jpg)
3
Recap
In the last class, you have learnt
• Recovery from Deadlock
![Page 4: 31 address binding, dynamic loading](https://reader033.vdocuments.us/reader033/viewer/2022061120/546d0e7daf79595e658b8349/html5/thumbnails/4.jpg)
4
Objectives
On completion of this period, you will be able to
Know about
• Storage management
• Address binding
• Dynamic loading
![Page 5: 31 address binding, dynamic loading](https://reader033.vdocuments.us/reader033/viewer/2022061120/546d0e7daf79595e658b8349/html5/thumbnails/5.jpg)
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
![Page 6: 31 address binding, dynamic loading](https://reader033.vdocuments.us/reader033/viewer/2022061120/546d0e7daf79595e658b8349/html5/thumbnails/6.jpg)
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.
![Page 7: 31 address binding, dynamic loading](https://reader033.vdocuments.us/reader033/viewer/2022061120/546d0e7daf79595e658b8349/html5/thumbnails/7.jpg)
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
![Page 8: 31 address binding, dynamic loading](https://reader033.vdocuments.us/reader033/viewer/2022061120/546d0e7daf79595e658b8349/html5/thumbnails/8.jpg)
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
![Page 9: 31 address binding, dynamic loading](https://reader033.vdocuments.us/reader033/viewer/2022061120/546d0e7daf79595e658b8349/html5/thumbnails/9.jpg)
9
Multistep Processing of User Program
Fig - 2
![Page 10: 31 address binding, dynamic loading](https://reader033.vdocuments.us/reader033/viewer/2022061120/546d0e7daf79595e658b8349/html5/thumbnails/10.jpg)
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
![Page 11: 31 address binding, dynamic loading](https://reader033.vdocuments.us/reader033/viewer/2022061120/546d0e7daf79595e658b8349/html5/thumbnails/11.jpg)
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
![Page 12: 31 address binding, dynamic loading](https://reader033.vdocuments.us/reader033/viewer/2022061120/546d0e7daf79595e658b8349/html5/thumbnails/12.jpg)
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
![Page 13: 31 address binding, dynamic loading](https://reader033.vdocuments.us/reader033/viewer/2022061120/546d0e7daf79595e658b8349/html5/thumbnails/13.jpg)
13
Address Binding
• Binding of instruction and data to memory
address can be done at
– Compile time
– Load time
– Execution time
![Page 14: 31 address binding, dynamic loading](https://reader033.vdocuments.us/reader033/viewer/2022061120/546d0e7daf79595e658b8349/html5/thumbnails/14.jpg)
14
![Page 15: 31 address binding, dynamic loading](https://reader033.vdocuments.us/reader033/viewer/2022061120/546d0e7daf79595e658b8349/html5/thumbnails/15.jpg)
15
![Page 16: 31 address binding, dynamic loading](https://reader033.vdocuments.us/reader033/viewer/2022061120/546d0e7daf79595e658b8349/html5/thumbnails/16.jpg)
16
![Page 17: 31 address binding, dynamic loading](https://reader033.vdocuments.us/reader033/viewer/2022061120/546d0e7daf79595e658b8349/html5/thumbnails/17.jpg)
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
![Page 18: 31 address binding, dynamic loading](https://reader033.vdocuments.us/reader033/viewer/2022061120/546d0e7daf79595e658b8349/html5/thumbnails/18.jpg)
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
![Page 19: 31 address binding, dynamic loading](https://reader033.vdocuments.us/reader033/viewer/2022061120/546d0e7daf79595e658b8349/html5/thumbnails/19.jpg)
19
![Page 20: 31 address binding, dynamic loading](https://reader033.vdocuments.us/reader033/viewer/2022061120/546d0e7daf79595e658b8349/html5/thumbnails/20.jpg)
20
routine( ){ ------- ; ------- ; ------- ;}
Memory• main( )
{
---- ;
---- ;
routine( );
---- ;
}
// routine is called dynamically
Dynamic Loading - Example
Secondary storage
![Page 21: 31 address binding, dynamic loading](https://reader033.vdocuments.us/reader033/viewer/2022061120/546d0e7daf79595e658b8349/html5/thumbnails/21.jpg)
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
![Page 22: 31 address binding, dynamic loading](https://reader033.vdocuments.us/reader033/viewer/2022061120/546d0e7daf79595e658b8349/html5/thumbnails/22.jpg)
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
![Page 23: 31 address binding, dynamic loading](https://reader033.vdocuments.us/reader033/viewer/2022061120/546d0e7daf79595e658b8349/html5/thumbnails/23.jpg)
23
Summary
In this class, you have learnt
• Storage Management
• Address binding
• Dynamic loading
• Advantages of dynamic loading
![Page 24: 31 address binding, dynamic loading](https://reader033.vdocuments.us/reader033/viewer/2022061120/546d0e7daf79595e658b8349/html5/thumbnails/24.jpg)
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?
![Page 25: 31 address binding, dynamic loading](https://reader033.vdocuments.us/reader033/viewer/2022061120/546d0e7daf79595e658b8349/html5/thumbnails/25.jpg)
25
Quiz
1. Memory is a large array of
a) Words
b) Registers
c) Bits
d) None
![Page 26: 31 address binding, dynamic loading](https://reader033.vdocuments.us/reader033/viewer/2022061120/546d0e7daf79595e658b8349/html5/thumbnails/26.jpg)
26
Quiz
2. Address in source program is address
a) Relocatable
b) Symbolic
c) Absolute
d)None
![Page 27: 31 address binding, dynamic loading](https://reader033.vdocuments.us/reader033/viewer/2022061120/546d0e7daf79595e658b8349/html5/thumbnails/27.jpg)
27
Quiz
3. Compiler binds symbolic address to _________
address
a) Absolute
b) Symbolic
c) Relocatable
d) None
![Page 28: 31 address binding, dynamic loading](https://reader033.vdocuments.us/reader033/viewer/2022061120/546d0e7daf79595e658b8349/html5/thumbnails/28.jpg)
28
Quiz
4. Loader binds relocatable address to ________
address
a) Absolute
b) Symbolic
c) Relocatable
d) None
![Page 29: 31 address binding, dynamic loading](https://reader033.vdocuments.us/reader033/viewer/2022061120/546d0e7daf79595e658b8349/html5/thumbnails/29.jpg)
29
Quiz
5. All routines are kept on disk in a ______ load
format
a) Relocatable
b) Symbolic
c) Absolute
d) None
![Page 30: 31 address binding, dynamic loading](https://reader033.vdocuments.us/reader033/viewer/2022061120/546d0e7daf79595e658b8349/html5/thumbnails/30.jpg)
30
Quiz
6. Special support from the operating system is
required
a) Yes
b) NO
![Page 31: 31 address binding, dynamic loading](https://reader033.vdocuments.us/reader033/viewer/2022061120/546d0e7daf79595e658b8349/html5/thumbnails/31.jpg)
Other subject materials
• Web designing
• Micro processors
• C++ tutorials
• java
home
![Page 32: 31 address binding, dynamic loading](https://reader033.vdocuments.us/reader033/viewer/2022061120/546d0e7daf79595e658b8349/html5/thumbnails/32.jpg)
32
Quiz
7. Routine is not called until it is required in
dynamic loading
a) True
b) False