Overlay advantages and disadvantages in programs?

Hello Friends, In this blog post(Overlay advantages and disadvantages in programs) we are going to discuss Overlay advantages and disadvantages in programs.

Many years ago people were first confronted with programs that were too big to fit in the available memory. The solution to this problem is usually adopted to split the program into pieces, they are also called overlays(Overlays advantages and disadvantages in programs).

Overlay() would start running first. When it is done, it would be called another overlay, the idea of the overlay is to keep only those instructions and data in memory that are needed at the given time|Overlay advantages and disadvantages in programs|

When other instructions are needed, they are loaded into the space occupied previously by instructions that are no longer needed. Some overlay systems were highly complex, allowing multiple overlays in memory at once.

The overlays were kept on the disk and swapped in and out of memory by the operating system, dynamically as needed.

As an example, consider a two-pass assembler. during pass1, it constructs a symbol table, then during pass2, it generates machine language code. we may be able to partition such an assembler into pass1 code, pass2 code, the symbol table, and common support routines used by both pass1 and pass2.

Assume that the size of these components is as follows-

Pass1 70KB
Pass2 80KB
Symbol table \20KB
Common routines 30KB

We need 200KB of memory to load everything at once. If there are only 150KB available, we can not run over the process. However, notice that pass 1 and pass2 do not need to be in memory at the same time.

We thus define two overlays- overlay A is a symbol table, common routines, and pass1, and overlay B is the symbol table, common routines, and pass2.

Overlay A needs only 120 KB and overlay B needs 130 KB as shown in Fig1 below. we can now run over the assembler in the 150KB of memory.

It will load somewhat faster because fewer data need to be transferred before execution starts. But, it will run somewhat slower, due to the extra I/O to read the code for overlay B over the code for overlay A.

overlay-content
Overlays: Overlay advantages and disadvantages in programs

The code for overlay A and overlay B are kept on disk as absolute memory images and are read by the overlay driver as needed. special relocation and linking algorithms are needed to construct the overlays.

The programmer, on the other hand, must design and program the overlay structure properly. This task can be a major undertaking, requiring complete knowledge of the structure of the program, its code, and its data structures.

Since by definition the program is large – small programs do not need to be overlaid -obtaining a sufficient understanding of the program may be difficult.

For these reasons, the use of overlay is currently limited to a microcomputer and other systems that have a limited amount of memory.

You can also go through a few more amazing blog links below related to operating systems:

disk scheduling क्या होती है…
FAT32 Advantages and Disadvantages…
Overlay advantages and disadvantages in programs…
What is the use of Cache Memory…
What is Linker? Why is it required?…
types Of File Operations…
What are the file Organisation and its types…
Dijkstra: Bankers Algorithm For Deadlock Avoidance…
What is a thread in the operating system with an example…
Cache Memory In Hindi…
Linker In Hindi…
What Are Multithreading Models in Hindi…
Dynamic Storage Problem In OS In Hindi…
Process states in the Operating system in Hindi…
FAT32 Advantages And Disadvantages In Hindi…
Critical Section Problem With a Simple Example…
Critical Section Problem In OS In Hindi…
Dijkstra Algorithm In Hindi|Banker’s Algorithm In Hindi…
What Is Dynamic Storage Problem…
What are the Fork and Exec system calls…
Multithreaded Process: Benefits & Models…
The Process States In Operating System…

In the case of any queries, you can write to us at a5theorys@gmail.com we will get back to you ASAP.

Hope! you would have enjoyed this post Overlay advantages and disadvantages in programs.

Please feel free to give your important feedback in the comment section below|Overlay advantages and disadvantages in programs|

Have a great time! Sayonara!

Anurag

I am a blogger by passion, a software engineer by profession, a singer by consideration and rest of things that I do is for my destination.