Professional Documents
Culture Documents
COMPILER
Translate high-level language programs into Assembly language
programs.
ASSEMBLER
Converts assembly language program into object files.
Object files contain a combination of machine instructions , data and
information.
LINKER
Tool that combines two or more separate objects programs
LOADER
Part of OS that brings an executable file residing on disk into
memory and starts it running.
WHAT IS A LOADER ?
In computer system a LOADER is the part of the
OS which takes the object code as input prepare it
for execution and loads the executable code into
memory.
All the OS that support program loading have
loaders.
2. Linking
3. Loading
Object
Source Object
Translator
program program2
Loader
program
Main
Memory
STEPS INVOLVED IN LOADING
1. Read Executable file’s header to determine the size
of text and data segments.
2. Create the new address space for the program
3. Instructions and data are copied into address space
4. Arguments passed to the program are copied on
the stack
5. Initialized the machine registers including the
stack pointer
CONT…
1. Easy to implement
2. No extra procedure
1. Absolute loader
2. Bootstrap loader
3. Relocating loader(Relative loader)
4. Linking loader
ABSOLUTE LOADER
Absolute loader loads the file into memory at the specified location.
And if that memory is already in use , execution can’t proceed, and
the user must wait until the requested memory becomes free.
Proper address is assigned to different parts.
A small changes to one subroutine requires re-assembly of the entire
program.
BOOTSTRAP LOADER
Power on
Load BOOTSTRAP LOADER from ROM to memory
BOOTSTRAP LOADER loads LOADER from disk
LOADER loads OS from disk
Transfer control from loader to OS
Memory
Bootstrap loader ROM
Disk
Loader
(Loader)
OS (OS)
RELOCATING LOADERS
Loaders that allow for program relocate are called
Relocating or Relative loaders.
It avoids reassembling of all the subroutines when a single
subroutine is changed.
LINKING LOADERS
Linking loaders first links , loads and then
Relocates segments.
A linking loaders is known as general Relocatable
loader or Direct-linking loaders.