System Software - Unit III - Question Bank
1. Define
loader?
A loader is a system program that performs the loading
function. Many loaders also support relocation and linking. Some systems have a
linker to perform the linking operation and a separate loader to handle
relocation and loading.
2. What is meant by loading in
system software?
Loading
means brings the object program into memory for execution.
3. Define relocation?
Relocation
modifies the object program so that it can be loaded at an address different
from the location originally specified.
4. Define linking?
Linking
means combines two or more separate object programs and supplies the
information needed to allow references between them.
5. What is an absolute loader?
All
functions of absolute loader are performed in a single pass. The header record
is checked to verify that the correct program has been presented for loading.
As each Text record is read, the object code it contains is moved to the
indicated address in memory. When the End record is encountered, the loader
jumps to the specified address to begin execution of the loader program.
6. How the object code for STL
instruction is loaded into memory?
Each
pair of bytes from the object program record must be packed together into one
byte during loading. For example, the machine operation code for an STL
instruction would be represented by the pair of characters “1” and “4”. When
the loader reads these, they will occupy two bytes of memory. However this
operation code must be stored as one byte during loading.
7. Write the algorithm for an absolute loader?
Begin
Read
Header record
Verify
program name and length
Read
first Text record
While
record type
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
jump to address specified in End record
end
8. What is a Bootstrap loader?
When
a computer is first turned on or restated, a special type of absolute loader,
called a bootstrap loader, is executed. This loads the first program to be run
by the computer-usually an operating system.
9. Write a subroutine using SIC/XE to read one
character from input device and convert it from ASCII code to hexadecimal and
is returned in a register A.
GETC TD
INPUT
JEQ GETC
RD INPUT
COMP #4
JEQ 80
COMP #48
JLT GETC
SUB #48
COMP #10
JLT RETURN
SUB #7
JEQ GETC
RD INPUT
COMP #4
JEQ 80
COMP #48
JLT GETC
SUB #48
COMP #10
JLT RETURN
SUB #7
RETURN RSUB
INPUT BYTE X’ F1’
END LOOP
INPUT BYTE X’ F1’
END LOOP
10. What are
relocating loader?
Loaders that allow for program relocation are called relocating
loader or relative loaders. There are two methods for relocating. a) A
modification record is used to describe each part of the object code that must
be changed when the program is relocated.
b) A machine that
uses direct addressing and has a fixed instruction format, it is more efficient
to specify relocation. Along with the Text record a relocation bit is
associated with each word of the object code.
11. Write notes on
relocation bit?
A machine that uses direct addressing
and has a fixed instruction format, it is more efficient to specify relocation.
Along with the Text record a relocation bit is associated with each word
of the object code.
If the relocating bit corresponding to a word of object
code is set to 1, the programs starting address is to be added to this word
when the program is relocated. A bit value of 0 indicates no relocation is
needed. If a Text record contains fewer than 12 words of object code, the bits
corresponding to unused words are set to 0.
12. What are the data structures used for a linking loader?
The various data structures used are
ESTAB -External
symbol table b) PROGADDR – Beginning of address in memory where the linked
program is to be loaded. c) CASADDR -Contain the starting address assigned to
the control section currently being scanned by the loader.
13. What are the contents of
ESTAB?
It is
used to store the name and address of each external symbol in the set of
control section being loaded. The table also often indicates in which control
section the symbol is defined. A hashed organization is typically used for this
table.
14. What is the content of
CSADDR during pass 1?
CSADDR
– It contains the starting address assigned to the control section currently
being scanned by the loader. This value is added to all relative addresses
within the control section to convert them to actual addresses.
15. What are the functions of
pass 1 of loader?
During
the first pass, the loader is concerned only with Header and Define record
types in the control sections. The control section name from the Header record
is entered into ESTAB, with value given by CSADDR. All external symbols
appearing in the Define record for the control section are also entered into
the ESTAB. When the End record is read, the control section length CSLTH is
added to CSADDR.
16. What the function of pass 2
of loader?
Pass 2 performs the actual loading, relocation and linking
of the program. CSADDR contains the actual starting address of the control
section currently being loaded. As each Text record is read, the object code is
moved to the specified address. When Modification record is encountered, the
symbol whose value is to be used to modification is looked up in ESTAB. This
value is added or subtracted from the indicated location in memory. The last
step is to transfer the control the loaded program to begin execution.
17. Define load map?
At
the end of Pass1, ESTAB contains all external symbols defined in the set of
control sections together with the address assigned to each. Many loaders
include as an option the ability to print a load map that shows these symbols
and their addresses.
18. What is meant by automatic
library call?
Many
linking loaders automatically incorporate the routines from a subprogram
library into the program being loaded. This feature allows the programmer to
use subroutines from one or more libraries as if they were part or the
programming language. On some systems, this feature is referred to as automatic
library call or library search.
19. What are the commands used
for the selection of alternative sources of input in loaders, delete external
symbols and to change the external symbol?
One
typical loader option allows the selection of alternate sources of input.
Ex:-INCLUDE program-name(library-name) Might direct the loader to read the
designated object program from a library and treat it as if it were part of the
primary loader input Other commands allow the user to delete external symbols
or entire control sections. Ex DELETE Csect-name Might instruct the loader to
delete the named control section from the set of programs being loaded. The
command
CHANGE
name1,name2 might cause the external symbol name1 to be changed to name 2.
20. What is a linkage editor?
A linkage editor produces a linked version of the
program, which is written to a file or library for later execution. The linkage
editor performs relocation of all control sections relative to the start of the
linked program. This means that the loading can be accomplished in one pass
with no external symbol table required. The linked program produced by a
linkage editor is generally in a form that is suitable for processing by a relocating
loader.
21. What is a linking loader?
A linking
loader performs all linking and relocation operations, including automatic
library search, and loads the linked program directly into the memory for
execution. A linking loader searches libraries and resolves external references
every tine the program is executed.
22. Write the block diagram of processing of an object program using a
linking loader?
23. Write the block diagram of
processing of an object program using a linkage editor?
24. What is meant by dynamic
linking?
This
scheme 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.
25. Define binding?
When dynamic linking is used, the association of an actual
address with the symbolic name of the called routine is not made until the call
statement is executed. Another way of describing this is to say that the binding
of the name to an actual address is delayed from load time until execution
time.
Issues: Code Generation
ReplyDeleteJDBC Architecture
JSON Parsing with Example
General Model for Sequential or State Machine
Generic Model: Digital Signature
Good leader Qualities
Color and Greyscale Levels
Hamiltonian Problem
Hash Functions: Cipher Block Chaining