Linking Overlay Structured Programs
- An overlay is part of a program (or software package) which has the same load origin as some other part of the program.
- The overlay is used to reduce the main memory requirement of a program.
Overlay structured program | Linking Overlay Structured Programs
We refer to a program containing overlays as an overlay structured program. Such a program consists of
A permanently resident portion called the root.
A set of overlays.
Execution of an overlay structured program proceeds as follows:
To start with, the root loaded in memory and given control for the purpose of execution.
Other overlays loaded as and when needed.
Note that the loading of an overlay overwrites a previously loaded overlay with the same load origin.
This reduces the memory requirement of a program.
It also makes it possible to execute programs whose size exceeds the amount of memory which can allocate to them.
The overlay structure of a program is designed by identifying mutually exclusive modules that is, modules which do not call each other.
Such modules do not need to reside simultaneously in memory.
Execution of an overlay structured program | Linking Overlay Structured Programs
For linking and execution of an overlay structured program in MS DOS the linker produces a single executable file at the output, which contains two provisions to support overlays.
First, an overlay manager module included in the executable file.
This module is responsible for loading the overlays when needed.
Second, all calls that cross overlay boundary replaced by an interrupt producing instruction.
To start with, the overlay manager receives control and loads the root.
A procedure call which crosses overlay boundaries leads to an interrupt.
This interrupts processed by the overlay manager and the appropriate overlay loaded into memory.
When each overlay structured into a separate binary program, as in IBM mainframe systems, a call which crosses overlay boundaries leads to an interrupt which attended by the OS kernel.
- Control now transferred to the OS loader to load the appropriate binary program.