Monday 5 August 2013

system software , linkers and loaders

CS2304 system software , linkers and loaders

 unit – III

1.      What are the processes related to loading  a process?
There are three processes:
1. Loading: which brings the object program into memory for execution.
2. Relocation: which modifies the object program so that it can be loaded at an
    address different from the location originally specified.
3. Linking: which combines two or more separate object programs and supplies the
    information needed to allow references between them.

2.      What is an absolute loader?
An absolute loader is a simple loader which performs loading process and need not to perform linking and program relocation processes.

3.      What is bootstrap loader?
The bootstrap loader loads the first program to be run by the computer, usually it is an operating system.

4.      How is the loader itself loaded into memory?
The bootstrap loader helps the operating system to load the loader.

5.      Define the term bootstrap.
If the loading process requires more instructions that can be read in a single record, this first record causes the reading of others, and these in turn can cause the reading of still more records – hence the term bootstrap. 

6.      Define the term bootstrap loader. Or Write short notes on Bootstrap loader.
If the loading process requires more instructions that can be read in a single record, this first record causes the reading of others, and these in turn can cause the reading of still more records – hence the term bootstrap. The first record or these records are generally referred to as a bootstrap loader.

7.      List out the machine dependent loader features.
    1. Program Relocation
    2. Program Linking
    3. Linking loader algorithm

8.      Define: Program Relocation.
Program relocation is the process of modifying the addresses used in the address sensitive instructions of a program such that the program can execute correctly from the designated area of memory.

9.      What is a relocating loader or relative loader?
Loaders that allow for program relocation are called relocating loader or relative loaders.

10.  What are the two methods for implementing program relocation during loading process?
There are two methods,
    1. Modification record method
    2. Relocation bit method.


11.  What is the purpose of the Relocation bit in object code of relocation loaders? or what is a relocation bit?
There are no modification records. Text records are the same as before except that there is a relocation bit associated with each word of object code. The relocation bits are gathered together into a bit mask.
If the relocation bit corresponding to a word of object code is set to ‘1’, the program’s starting address is to be added to this word when the program is relocated. If it is set to ‘0’, no modification is required.

12.  Define: Program Linking or Linking.
Linking is the process of binding an external reference to the correct link time address. An external reference is said to be unresolved until linking is performed for it. It is said to be resolved when its linking is completed.

13.  What is an external reference? Or How the external symbols are resolved?
An external reference is said to be unresolved until linking is performed for it. It is said to be resolved when its linking is completed.

14.  Define: Binary programs.
A binary program is a machine language program comprising a set of program units SP such that Pi SP.

15.  What is a Loader?
Loader is a system program which performs the loading process ie., brings the object program into memory for execution. Many loaders also supports relocation and linking.

16.  What is load on call?
A scheme that postpones the linking function until execution time; a subroutine is loaded and linked to the rest of the program when it is first called. This type of function is usually called dynamic linking, dynamic loading or Load-on-Call.

17.  Distinguish linking loader from linkage editor.



Linking Loader

Linkage Editor

  1. Performs linking and relocation at load time.
  2. Loads the linked program directly into the memory.
  3. Linking loader has less flexibility and control

  1. Linking is done prior to load time.
  2. Writes a linked version of program, which is later executed by relocating loader
  3. Linkage editors offer more flexibility and control

18.  Mention the use of FIXUPP records.
It is a record type os MS-DOS Linker object module. It is used for refering the relocation and linking information. It resolves the external referneces and it is similar to modification record in SIC loader.

19.  What is the function of MS-DOS LINK?
MS-DOS LINK is a linker program. It is a linkage editor that combines one or more object modules to produce a complete executable program with extension .EXE.


20.  What is the function of a linkage editor?
A linkage editor performs linking and some relocation; however, the linked program is written to a file or library instead of being immediately loaded into memory. 

21.  What are the advantages of dynamic linking?
    1. Share one copy of subroutine or library files by several executing programs.
    2. Savings of time and memory space
    3. It avoids the loading of entire library for each execution.

22.  List out any two Loader options with example?
Loder options with syntax,
    1. INCLUDE program-name(library-name)
    2. DELETE csect-name
    3. CHANGE name1,name2
Examples,
1.      INCLUDE READ(UTLIB)
2.      INCLUDE WRITE(UTLIB)
3.      DELETE RDREC,WRREC
4.      CHANGE RDREC,READ
5.      CHANGE WRREC,WRITE

23.  Define: Automatic Library Search.
An automatic library search is a process for handling external references that allows a programmer to use standard subroutines without expilicitly including them in the program to be loaded.

24.  What is the advantage of using refernece number in modification record?
The main advantage of this refernece number mechanism is that it avoids multiple searches of ESTAB for the same symbol during the loading of a control section.

25.   What are the data structure and variables used in Linking loader algorithm?
The main data structure used in linking loader,
                        External Symbol Table [ESTAB]
Other variables are,
1.      PROGADDR
2.      CSADDR
          3.      CSLTH