SlideShare a Scribd company logo
Storage Management

•   Dynamic linking
•   Overlays




                                       1
HOME     PREVIOUS TOPIC NEXT
PREVIOUS QUESTION PAPERS FOR OS
CPP TUTORIALS




                                  2
Recap

In the last class, you have learnt

•   Address binding

•   Concepts of Dynamic loading

•   Advantages of Dynamic loading




                                     3
Objectives


 On completion of this class, you will be able to
  know

• Dynamic linking

• Overlays




                                                    4
Dynamic Linking

• Concept of dynamic linking is similar to dynamic
  loading
• Instead of loading, linking is postponed till
  execution
• This feature is used with system libraries

• A stub is included in the image for each library
  routine reference
                                                  5
Dynamic Linking

• A stub is a small piece of code that indicates
  how to load the library routine
• Stub is executed

• It replaces itself with the address of the routine
  and executes the routine
• Next time when that code segment is reached
  the library routine is executed directly
                                                       6
Dynamic Linking
                                Secondary storage
                                   printf( )
     Memory
                                   {
• main( )
                                     ------- ;
  {                                  ------- ;
     ---- ;                          ------- ;
     ---- ;                        }
     printf( );       // stub is linked dynamically
     ---- ;
   }

                                                      7
Dynamic Linking


 Advantages

• Better memory utilization

• Without this facility the system libraries must

  be included in the executable image

• A library may be replaced by a new version
                                                    8
Dynamic Linking


 Advantages

• All programs that reference the library will

  automatically use new version

• Can allow multiple processes to access the

  same memory address

                                                 9
Dynamic Linking


  Disadvantages

• Cannot detect the needed routine in another

  process memory space

• Support from the operating system is required



                                                  10
Overlays

• Overlay is needed when a process is larger
  than, the amount of memory allocated to it
• Keep in memory only those instructions and
  data that are needed at any given time
• Other instructions and data are loaded into the
  memory space
  – occupied by the instructions that are no longer
    needed
                                                      11
Overlays

Example 1:
• Consider a two pass assembler
• Pass1 : Constructs symbol table             ( 70K )
• Pass2 : Generates machine language code ( 80K )
• Common subroutines                          ( 30K )
• Symbol table                                 ( 20K)
• To load every thing at once we require 200K of
  memory
                                                   12
Overlays

• But only 150K of memory is available
• Pass1 and Pass2 need not be in memory at
  same time
• So define two overlays:
• Overlay A: Symbol table, Common routines
  and Pass1 (120K )
• Overlay B: Symbol table, Common routines
  and Pass2 (130K)
                                             13
Overlays for a Two-Pass Assembler
             Example 1




              Fig - 1
                                    14
Example: 2




             15
Secondary Storage
             Overlays
       Main Memory          Overlay 1
0K

       Main Program
                            Overlay 2
5k
      Overlay Manager
7k

       Overlay Area
        Overlay 1
                3
                2           Overlay 3

12k
                                            16
Overlays

• Overlay driver / manager reads the overlays
  into the memory
• We can load the given two pass assemblers
  into memory and execute them




                                                17
Overlays

  Advantages

• No special support is required from the operating
  system

• Can execute programs larger than the size of the
  memory allocated to it

• Implemented by user

                                                18
Overlays

Disadvantages
• Programming design of overlay structure is
  complex
• Process execution is slower due to extra I/O

• Special relocation and linking algorithms are
  needed to construct overlays
• Overlays are limited to microcomputers
                                                  19
Summary

    In this class, you have learnt
•     Dynamic linking
       -advantages and disadvantages
•    Overlays
      -advantages and disadvantages




                                       20
Frequently Asked Questions

•   What is meant by dynamic linking?

•   Explain the concept of dynamic linking

•   What are the advantages & disadvantages of dynamic
    linking?

•   What is meant by overlay?

•   Explain the concepts of overlays

•   What are the advantages & disadvantages of overlays?
                                                         21
Quiz

1. Concept of Dynamic linking is similar to

  a) Dynamic loading

  b) Address binding

  c) Both

  d) None


                                              22
Quiz

2. _________is postponed till execution in
  dynamic linking

  a) Linking

  b) Loading

  c) Both

  d) None


                                             23
Quiz

3. _________ is a small piece of code that
  indicates how to load the library routine

  a) Address

  b) Program

  c) Stub

  d) None

                                              24
Quiz

4. Support from the operating system is required

  a) True

  b) False




                                                   25
Quiz

5. _________is needed when process is larger
  than amount of memory allocated to it
  A) Address binding

  b) Dynamic loading

  c) Overlays

  d) Dynamic linking


                       9CM402.32               26
Quiz


6. ________reads the overlays into the memory

  a) Linking driver

  b) Operating system

  c) Overlay driver

  d) None


                      9CM402.32                 27
Other subject materials

•   Web designing
•   Micro processors
•   C++ tutorials
•   java

home
Quiz

7. Programming design of overlay structure is

  _______

  a) Simple

  b) Complex

  c) None



                      9CM402.32                 29
Quiz

8. Overlays are limited to _____________

  a) Minicomputers

  b) Microcomputers

  c) Mainframe computers

  d) None




                      9CM402.32            30

More Related Content

PPTX
Macro Processor
PPTX
Software Project Management - Staffing
PPTX
System Programming- Unit I
PPTX
System Programing Unit 1
PPTX
Compilers
PPT
Assemblers: Ch03
PPTX
Unit 3 sp assembler
PPTX
Loaders ( system programming )
Macro Processor
Software Project Management - Staffing
System Programming- Unit I
System Programing Unit 1
Compilers
Assemblers: Ch03
Unit 3 sp assembler
Loaders ( system programming )

What's hot (20)

PPT
Pass 1 flowchart
PPTX
Segmentation in operating systems
PPTX
Code Optimization
PPT
PPT
Multi Head, Multi Tape Turing Machine
PPTX
Instruction Execution Cycle
PPT
Instruction Set Architecture (ISA)
PPTX
A Role of Lexical Analyzer
PPTX
Unit 4 sp macro
PPTX
Peephole optimization techniques in compiler design
PPS
Virtual memory
PPTX
System calls
PPTX
Assemblers
PPTX
Linking in MS-Dos System
PPTX
Introduction to loaders
PPTX
Single pass assembler
PPTX
System software - macro expansion,nested macro calls
DOC
PPT
Instruction cycle
PPTX
Computer system architecture
Pass 1 flowchart
Segmentation in operating systems
Code Optimization
Multi Head, Multi Tape Turing Machine
Instruction Execution Cycle
Instruction Set Architecture (ISA)
A Role of Lexical Analyzer
Unit 4 sp macro
Peephole optimization techniques in compiler design
Virtual memory
System calls
Assemblers
Linking in MS-Dos System
Introduction to loaders
Single pass assembler
System software - macro expansion,nested macro calls
Instruction cycle
Computer system architecture
Ad

Viewers also liked (20)

PPT
31 address binding, dynamic loading
PDF
Memory management
PPTX
Presentation 20111102
PPTX
Tool bar
PPT
Preserving Customizations with Overlays & Custom Objects in AR System 7.6.04
PPT
Windows presentation foundation
PPTX
Advanced VB: Object Oriented Programming - DLLs
PPT
Chapter 14
PDF
Address Binding Scheme
DOCX
Window programming
PPT
Active x control
PPTX
Windows programming
PPTX
Sdi & mdi
PPT
Linkers And Loaders
PPT
VC++ Fundamentals
PPTX
Mobile Operating Systems
PPT
Os Swapping, Paging, Segmentation and Virtual Memory
DOCX
Environment impact assessment
PPTX
31 address binding, dynamic loading
Memory management
Presentation 20111102
Tool bar
Preserving Customizations with Overlays & Custom Objects in AR System 7.6.04
Windows presentation foundation
Advanced VB: Object Oriented Programming - DLLs
Chapter 14
Address Binding Scheme
Window programming
Active x control
Windows programming
Sdi & mdi
Linkers And Loaders
VC++ Fundamentals
Mobile Operating Systems
Os Swapping, Paging, Segmentation and Virtual Memory
Environment impact assessment
Ad

Similar to 32 dynamic linking nd overlays (20)

PPTX
memorymanagementoperatingaystemsconvepys.pptx
PPTX
UNIT 3-EXPLAINING THE MEMORY MANAGEMENT LOGICAL AND AND PHYSICAL DATA FLOW DI...
PPTX
Memory management
PDF
Dsohowto
PDF
Memory management- Swapping Contiguous Memory Allocation
PDF
Memory
PDF
operating system (everthing about machines)
PPTX
Week 12 Operating System Lectures lec 2.pptx
PPTX
Linkers
PDF
ASPLOS2011 workshop RESoLVE "Effect of Disk Prefetching of Guest OS "
PDF
Process' Virtual Address Space in GNU/Linux
PPTX
Windows memory management
PDF
Strategies to improve embedded Linux application performance beyond ordinary ...
PPT
Memory Management in OS
PPT
Operating systems- Main Memory Management
PDF
Memory Management.pdf
PDF
Buffer manager
PPTX
Operating System_2.1_Memory Management.pptx
PDF
Operating Systems - memory management
PPTX
Cache performance considerations
memorymanagementoperatingaystemsconvepys.pptx
UNIT 3-EXPLAINING THE MEMORY MANAGEMENT LOGICAL AND AND PHYSICAL DATA FLOW DI...
Memory management
Dsohowto
Memory management- Swapping Contiguous Memory Allocation
Memory
operating system (everthing about machines)
Week 12 Operating System Lectures lec 2.pptx
Linkers
ASPLOS2011 workshop RESoLVE "Effect of Disk Prefetching of Guest OS "
Process' Virtual Address Space in GNU/Linux
Windows memory management
Strategies to improve embedded Linux application performance beyond ordinary ...
Memory Management in OS
Operating systems- Main Memory Management
Memory Management.pdf
Buffer manager
Operating System_2.1_Memory Management.pptx
Operating Systems - memory management
Cache performance considerations

More from myrajendra (20)

PPT
Fundamentals
PPT
Data type
PPTX
Hibernate example1
PPTX
Jdbc workflow
PPTX
2 jdbc drivers
PPTX
3 jdbc api
PPTX
4 jdbc step1
PPTX
Dao example
PPTX
Sessionex1
PPTX
Internal
PPTX
3. elements
PPTX
2. attributes
PPTX
1 introduction to html
PPTX
Headings
PPTX
Forms
PPT
PPTX
Views
PPTX
Views
PPTX
Views
PPT
Starting jdbc
Fundamentals
Data type
Hibernate example1
Jdbc workflow
2 jdbc drivers
3 jdbc api
4 jdbc step1
Dao example
Sessionex1
Internal
3. elements
2. attributes
1 introduction to html
Headings
Forms
Views
Views
Views
Starting jdbc

32 dynamic linking nd overlays

  • 1. Storage Management • Dynamic linking • Overlays 1
  • 2. HOME PREVIOUS TOPIC NEXT PREVIOUS QUESTION PAPERS FOR OS CPP TUTORIALS 2
  • 3. Recap In the last class, you have learnt • Address binding • Concepts of Dynamic loading • Advantages of Dynamic loading 3
  • 4. Objectives On completion of this class, you will be able to know • Dynamic linking • Overlays 4
  • 5. Dynamic Linking • Concept of dynamic linking is similar to dynamic loading • Instead of loading, linking is postponed till execution • This feature is used with system libraries • A stub is included in the image for each library routine reference 5
  • 6. Dynamic Linking • A stub is a small piece of code that indicates how to load the library routine • Stub is executed • It replaces itself with the address of the routine and executes the routine • Next time when that code segment is reached the library routine is executed directly 6
  • 7. Dynamic Linking Secondary storage printf( ) Memory { • main( ) ------- ; { ------- ; ---- ; ------- ; ---- ; } printf( ); // stub is linked dynamically ---- ; } 7
  • 8. Dynamic Linking Advantages • Better memory utilization • Without this facility the system libraries must be included in the executable image • A library may be replaced by a new version 8
  • 9. Dynamic Linking Advantages • All programs that reference the library will automatically use new version • Can allow multiple processes to access the same memory address 9
  • 10. Dynamic Linking Disadvantages • Cannot detect the needed routine in another process memory space • Support from the operating system is required 10
  • 11. Overlays • Overlay is needed when a process is larger than, the amount of memory allocated to it • Keep in memory only those instructions and data that are needed at any given time • Other instructions and data are loaded into the memory space – occupied by the instructions that are no longer needed 11
  • 12. Overlays Example 1: • Consider a two pass assembler • Pass1 : Constructs symbol table ( 70K ) • Pass2 : Generates machine language code ( 80K ) • Common subroutines ( 30K ) • Symbol table ( 20K) • To load every thing at once we require 200K of memory 12
  • 13. Overlays • But only 150K of memory is available • Pass1 and Pass2 need not be in memory at same time • So define two overlays: • Overlay A: Symbol table, Common routines and Pass1 (120K ) • Overlay B: Symbol table, Common routines and Pass2 (130K) 13
  • 14. Overlays for a Two-Pass Assembler Example 1 Fig - 1 14
  • 16. Secondary Storage Overlays Main Memory Overlay 1 0K Main Program Overlay 2 5k Overlay Manager 7k Overlay Area Overlay 1 3 2 Overlay 3 12k 16
  • 17. Overlays • Overlay driver / manager reads the overlays into the memory • We can load the given two pass assemblers into memory and execute them 17
  • 18. Overlays Advantages • No special support is required from the operating system • Can execute programs larger than the size of the memory allocated to it • Implemented by user 18
  • 19. Overlays Disadvantages • Programming design of overlay structure is complex • Process execution is slower due to extra I/O • Special relocation and linking algorithms are needed to construct overlays • Overlays are limited to microcomputers 19
  • 20. Summary In this class, you have learnt • Dynamic linking -advantages and disadvantages • Overlays -advantages and disadvantages 20
  • 21. Frequently Asked Questions • What is meant by dynamic linking? • Explain the concept of dynamic linking • What are the advantages & disadvantages of dynamic linking? • What is meant by overlay? • Explain the concepts of overlays • What are the advantages & disadvantages of overlays? 21
  • 22. Quiz 1. Concept of Dynamic linking is similar to a) Dynamic loading b) Address binding c) Both d) None 22
  • 23. Quiz 2. _________is postponed till execution in dynamic linking a) Linking b) Loading c) Both d) None 23
  • 24. Quiz 3. _________ is a small piece of code that indicates how to load the library routine a) Address b) Program c) Stub d) None 24
  • 25. Quiz 4. Support from the operating system is required a) True b) False 25
  • 26. Quiz 5. _________is needed when process is larger than amount of memory allocated to it A) Address binding b) Dynamic loading c) Overlays d) Dynamic linking 9CM402.32 26
  • 27. Quiz 6. ________reads the overlays into the memory a) Linking driver b) Operating system c) Overlay driver d) None 9CM402.32 27
  • 28. Other subject materials • Web designing • Micro processors • C++ tutorials • java home
  • 29. Quiz 7. Programming design of overlay structure is _______ a) Simple b) Complex c) None 9CM402.32 29
  • 30. Quiz 8. Overlays are limited to _____________ a) Minicomputers b) Microcomputers c) Mainframe computers d) None 9CM402.32 30