You are on page 1of 20

CONTENTS

 Components Of System softeware – A walkthrough.


 Introducing loader
 Basic Loader functions
 Steps involved in loading
 Loader Schems
 Types of Loaders
COMPONENTS OF SYSTEM SOFTWARE

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.

BASIC LOADER FUNCTION


1. Allocation

2. Linking

3. Loading
Object

Source Translator Exceutable


program
object code
Program1 Loader

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…

6. The control is transferred to a start-up routine


and calls the program’s main routine.
LOADING SCHEMS
 Compile-and-Go
 General loader scheme
COMPILE-AND-GO SCHEME
 The Assembler run in one part of memory.
 After loading process is complete ,then assembler
transfer to the first instruction of the program.
Advantages of COMPILE-AND-GO SCHEME

1. Easy to implement

2. No extra procedure

Disadvantages of COMPILE-AND-GO SCHEME

3. A portion of memory is wasted.

4. A code is Re-assemble every time for it is to be run.

5. It becomes difficult to handle large no. of segments.


GENERAL LOADER SCHEME
 Source program is converted to object program by translator
or assembler.
 Loader accepts the assembled machine instruction in object
format and puts them in an executable form at their assigned
memory.
Advantages of GENERAL LOADER SCHEME
1. Saves memory because loader is smaller than
assembler so there is no wastage of memory.
2. There is no need the Re-translate the program each time.
3. The Source program can be written with multiple programs
and multiple languages.

Disadvantages of GENERAL LOADER SCHEME


4. Some portion of the memory is occupied by the loader.
5. Loader is more complicated and needs to manage multiple
object files.
TYPES OF LOADER

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.

You might also like