System Software Loaders
System Software Loaders
System Software Loaders
H.D.Phaneendra
Assistant Professor
Department of CS&E
The National Institute of Engineering
Mysore – 570023
[email protected]
System Software
•The subject introduces the design and
implementation of system software
•System software consists of a variety of programs that
support the operation of a computer
•operating system, compiler, assembler, macro processor, loader
or linker, debugger, text editor, database management systems,
software engineering tools, ….
Chapter On…
Translator – Assembler/Compiler
Memory
Role of Loader
Source Object
Object
Assembler Loader program
Program ready for
Program execution
Memory
Role of Loader and Linker
Memory
Source
Object
Assembler Linker
Program
Program Object
program
ready for
Executable execution
Code
Loader
We know…
• Source Program – Assembly Language
• Object Program - From assembler
- Contains translated instructions and data
values from the source program
• Executable Code - From Linker
• Loader - Loads the executable code to
the specified memory locations and code
gets executed.
We need…three processes
•Loading - which allocates memory location and
brings the object program into memory for
execution - Loader
•Linking- which combines two or more separate
object programs and supplies the information
needed to allow references between them - Linker
•Relocation - which modifies the object program so
that it can be loaded at an address different from
the location originally specified - Linking Loader
Basic Loader Functions
•
A Loader is a system program that
performs the loading function
•It brings object program into
memory and starts its execution
Type of Loaders
•absolute loader
•bootstrap loader
•relocating loader (relative loader)
•direct linking loader
Absolute Loader
•Operation is very simple
•The object code is loaded to
specified locations in the memory
•At the end the loader jumps to the
specified address to begin
execution of the loaded program
Role of Absolute Loader
1000
Object Absolute Object
Program Loader program
ready for
execution
2000
Memory
Absolute Loader
•Advantage
- Simple and efficient
•Disadvantage
- the need for programmer to
specify the actual address
- difficult to use subroutine
libraries
• We have algorithm – next slide
Begin
read Header record
verify program name and length
read first Text record
while record type is <> ‘E’ do
begin
{if object code is in character form, convert into
internal representation}
move object code to specified location in memory
read next object program record
end
jump to address specified in End record
end
Object Program
Space for
2 inch x 2 inch
size Picture
Format-1(a) (in PowerPoint)
Object Code Representation
•Each byte of assembled code is given using its
hexadecimal representation in character form
•Easy to read by human beings
•Each byte of object code is stored as a single
byte
•Most machine store object programs in a
binary form
•We must be sure that our file and device
conventions do not cause some of the program
bytes to be interpreted as control characters
A Simple Bootstrap Loader
•When a computer is first tuned on or
restarted, a special type of absolute
loader, called bootstrap loader is
executed
•This bootstrap loads the first program to
be run by the computer -- usually an
operating system
Example (SIC bootstrap loader)