Different Types of Loading Schemes
Different Types of Loading Schemes
A Header record showing the load origin, length and load time execution start
address of the program.
A sequence of binary image records containing the program’s code. Each binary
image record contains a part of the program’s code in the form of a sequence
of bytes, the load address of the first byte of this code and a count of the
number of bytes of code.
A table analogous to RELOCTAB table giving linked addresses of address
sensitive instructions in the program.
Linking Loaders
A modern program comprises several procedures or subroutines together with
the main program module.
Special system program called linking loader gathers various object modules,
links them together to produce single executable binary program and loads
them into the memory.
This category of loaders leads to a popular class of loaders called direct-
linking loaders.
These linking loaders, which link the necessary library functions and symbolic
references.
Essentially, linking loaders accept and link together a set of object programs
and a single file to load them into the core.
That means the assembler runs in one part of memory and the assembled
machine instructions and data directly put into their assigned memory
locations.
After the completion of loading process, the assembly process assigns the
starting address of the program to the location counter.
The typical example is WATFOR-77, it’s a FORTRAN compiler which uses such
“Compile-and-go” scheme.
Advantages
This scheme is simple to implement because assembler is placed at one part of
the memory and loader simply loads assembled machine instructions into the
memory.
Disadvantages
There is wastage in memory space due to the presence of the assembler.
The execution time will be more in this scheme as every time program is
assembled and then executed.
General Loader Schemes
In this loader scheme, the source program is converted to object program by
some translator (assembler). The loader accepts these object modules and puts
the machine instruction and data in an executable form at their assigned
memory.
The loader usually combines the object codes and executes them by loading
them into the memory, including the space where the assembler had been in
the assemble-and-go scheme.
Rather than the entire assembler sitting in the memory, a small utility
component called loader does the job.
Disadvantages:
The loader is more complicated and needs to manage multiple object files.
Secondary storage is required to store object files, and they cannot be directly
placed into the memory by assemblers.
Absolute Loaders
The absolute loader is a kind of loader in which relocated object files are
created, loader accepts these files and places them at a specified location in
the memory.
This type of loader is called absolute loader because no relocating information
is needed, rather it is obtained from the programmer or assembler.
Disadvantages
The programmer must know and clearly specify to the translator (the
assembler) the address in the memory for linking and loading of the
programs. Care should be taken so that the addresses do not overlap.
Relocating Linking Loaders
Relocating linking loaders combines together the relocating capabilities of
relocating loaders and the advanced linking features of linking loaders and
presents a more robust loading scheme.
This necessarily eliminates the need to use two separate programs for linking
and loading respectively.
These loaders can work efficiently with support from the operating system
and utilize the memory and other resources efficiently.
Thank You