0% found this document useful (0 votes)
62 views

Ssos - U1-23

Uploaded by

fayazahamed024
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views

Ssos - U1-23

Uploaded by

fayazahamed024
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 62

BISHOPAPPASAMY COLLEGE OFARTS & SCIENCE ,COIMBATORE

DEPARTMENT OF COMPUTER SCIENCE – BCA


II BCA FOURTH SEMESTER

SYSTEM SOFTWARE AND OPERATING SYSTEM – 43A

Handled By
Dr.N.SUDHA
ASSOCIATE PROFESSOR
DEPARTMENT OF COMPUTER SCIENCE
SYSTEM SOFTWARE AND OPERATING SYSTEM – 43A

TEXT BOOKS

1. Leland L. Beck , System Software : An Introduction to System


Programming , Pearson , Third Edition.

2. H.M. Deitel , Operating Systems , 2nd Edition , Pearson ,2003.

Course Study :
Consists of 5 Units : Unit 1 & 2 – System Software
Unit 3 to 5 – Operating Systems
Max.Marks : 100 Marks
Internal : 50 Marks
External : 50 Marks
UNIT – I

Introduction – System Software and machine architecture . Loader and Linkers


: Basic Loader Functions – Machine dependent loader features – Machine Independent
loader features – Loader design options.
SOFTWARE
Software comprises the entire set of programs, procedures, and routines associated with
the operation of a computer system. A set of instructions that directs a computer's hardware to
perform a task is called a program or software .

A software plays a key role of a mediator between the user and the computer hardware.
In the absence of software, a user essentially can’t perform any task on a computer.
Types Of Software
Software can be broadly divided into two categories
* System Software
* Application software
* System Software
System software is software designed to provide a platform for other software. System
Software In case of a system software, it helps the user as well as the hardware to function and
even interact with each other easily. Essentially, it is a software which is used to manage the
behavior of the computer hardware in order to offer basic functionalities which are needed by the
user. In simpler word, it can be said that system software is essentially an intermediater or even a
A system software essentially runs in the background, and it isn’t actually utilized by
the end-users. Due to this reason, the system software is also known popularly as low-level
software.
Examples of system software include operating systems like macOS, GNU/Linux ,
Android and Microsoft Windows, computational science software, game engines, industrial

automation, and software as a service applications.


*Application Software
Application software essentially lie above the system software. They are actually used
by the end-user as well as have specific functionality or tasks which they are designed to perform.
These software are often developed through custom software development, based on the
requirements of the users. They are also popularly known as end-user programs or even
productivity programs which assist the user in completing various tasks like conducting online
research, making notes, designing graphics, maintaining accounts, carrying out calculations or
even playing computer games.
SYSTEM SOFTWARE AND MACHINE ARCHITECTURE

System software defers from application software in machine dependency. System


programs are intended to support the operation and the use of computer itself rather than
particular applications. Thus we much included real machines and real piece of software in our
study.
It is difficult to distinguish between those features of the software that are truly
fundamental. To avoid this problem the fundamental function of each piece of software is
presented through Simplified Instructional Computer (SIC). The SIC is a hypothetical computer
that includes the hardware futures most often found on real machines while avoiding unusual are
irrelevant complex cities.

SIC
SIC comes in two versions
• Standard model
• XE version (Extra Equipment’s)
Therefore these two version have been design to be upward compatible
SIC Machine Architecture – Standard Model
It consist of memory, registers, data formats, instruction formats , addressing modes ,
instruction set, input and output.

Memory
There are 215 bytes in the computer memory, that is 32,768 bytes , 3 consecutive bytes
form a word , each location in memory contains 8-bit bytes.

Registers
There are five registers, each 24 bits in length. Their mnemonic, number and use are
given in the following table.
Mnemonic Number Use
A 0 Accumulator; used for arithmetic operations
X 1 Index register; used for addressing
L 2 Linkage register JSUB(Jumps to subroutines )
instruction stores the return address in the register.
PC 8 Program counter contains the address of the next
instruction to be fetched for execution.
SW 9 Status word contains many types of information
including CC (condition code).
Data Formats
Integers are stored as 24-bit binary numbers , 2’s complement representation is used
for negative values, characters are stored using their 8-bit ASCII codes, No floating- point
hardware on the standard version of SIC.

Instruction Formats
8 1 15
Opcode x Address

All machine instructions on the standard version of SIC have the 24-bit format as
shown above. The flag bit x is used to indicate the indexed addressing modes.
Addressing Modes
Mode Indication Target address calculation
Direct x=0 TA = address
Indexed x=1 TA = address + (x)
There are two addressing modes available, indicated by the setting of the x bit in the
instruction as shown in the above table. Parentheses are used to indicate the contents of a register
or a memory location.
Instruction Set
SIC provides a basic set of instructions that are sufficient to perform the tasks. It
includes load and store instructions (LDA, LDX, STA, STX, etc.). Integer arithmetic
operations (ADD, SUB, MUL, DIV, etc.). All arithmetic operations involve register A and a
word in memory, with the result being left in the register.
COMP compares the value in register A with a word in memory, this instruction sets a
condition code CC to indicate the result(< , > , ==). Conditional jump instructions (JLT, JEQ,
JGT), these instructions test the setting of CC and jump accordingly. Two instructions are
provided for subroutine linkage. JSUB jumps to the subroutine placing the return address in
register L, RSUB returns by jumping to the address contained in register L.

Input and Output


Input and Output are performed by transferring 1 byte at a time to or from the
rightmost 8 bits of register A (accumulator). Each device is assigned a unique 8 bit code . There
are 3 I/O operations each of which specifies the device code as an operand.
The Test Device (TD) instruction tests whether the addressed device is ready to send or
receive a byte of data. The Condition code is used to indicate the result of this test.(A setting of
< means the device is ready to send or receive, = means the device is not ready.
A program needing to transfer the data must wait until the device is ready and then
execute Read Data (RD), Write Data (WD) are used for reading or writing the data.

SIC / XE MACHINE ARCHITECTURE


It consists of memory , registers, data formats , instruction formats , instruction sets,
addressing modes , input and output same as standard architecture .
Memory
Maximum memory available on a SIC/XE system is 1 Megabyte (220 bytes) .
Registers
Additional B, S, T, and F registers are provided by SIC/XE, in addition to the registers
of SIC .
Mnemonic Number Special use
B 3 Base register
S 4 General working register
T 5 General working register
F 6 Floating-point accumulator (48 bits)
Data Formats
In addition to the standard format there is a 48-bit floating-point data type
1 11 36
s exponent fraction
The fraction is interpreted as a value between 0 and 1 . The assumed binary point is
immediately before the high-order bit. The high order bit for the fraction must be 1. The exponent
is interpreted as a unsigned binary number between 0 and 2047. If the exponent has a value e and
the fraction has a value f the absolute value of the number is represented as F*2(e- 1024) .

Instruction Formats
The new set of instruction formats fro SIC/XE machine architecture are as follows.
Format 1 (1 byte): contains only operation code (straight from table).

op
Format 2 (2 bytes): first eight bits for operation code, next four for register 1 and
following four for register 2. The numbers for the registers go according to the numbers indicated
at the registers section (ie, register T is replaced by hex 5, F is replaced by hex 6).

8 4 4
op r1 r2
Format 3 (3 bytes): First 6 bits contain operation code, next 6 bits contain flags, last 12
bits contain displacement for the address of the operand. Operation code uses only 6 bits, thus the
second hex digit will be affected by the values of the first two flags (n and i). The flags in order
are n, i, x, b, p, and e. The last flag e indicates the instruction format (0 for 3 and 1 for 4).

6 1 1 1 1 1 1 12
op n i x b p e disp

Format 4 (4 bytes): same as format 3 with an extra 2 hex digits (8 bits) for addresses
that require more than 12 bits to be represented.
6 1 1 1 1 1 1 20
op n i x b p e address
Addressing modes & Flag Bits
Five possible addressing modes plus the combinations are as follows.
Direct (x, b, and p all set to 0):
operand address goes as it is. n and i are both set to the same value, either 0 or 1. While
in general that value is 1, if set to 0 for format 3 we can assume that the rest of the flags (x, b, p,
and e) are used as a part of the address of the operand, to make the format compatible to the SIC
format.

Relative (either b or p equal to 1 and the other one to 0):


the address of the operand should be added to the current value stored at the B register
(if b = 1) or to the value stored at the PC register (if p = 1)
Immediate (i = 1, n = 0):

The operand value is already enclosed on the instruction (ie. lies on the last 12/20 bits
of the instruction)
Indirect (i = 0, n = 1):
The operand value points to an address that holds the address for the operand value.
Indexed (x = 1):
value to be added to the value stored at the register x to obtain real address of the
operand. This can be combined with any of the previous modes except immediate.
The various flag bits used in the above formats have the following meanings e –
e = 0 means format 3,

e = 1 means format 4
Bits x,b,p:
Used to calculate the target address using relative, direct, and indexed
addressing Modes

Bits i and n:
Says, how to use the target address
Two new relative addressing modes are available for use with instructions assembled
using format 3.
Mode Indication Target address calculation
Base relative b=1,p=0 TA=(B)+ disp (0≤disp ≤4095)
Program-counter relative b=0,p=1 TA=(PC)+ disp (-2048≤disp ≤2047)
Instruction Set
SIC/XE provides all of the instructions that are available on the standard version. In
addition we have, Instructions to load and store the new registers LDB, STB, etc.
Floating-point arithmetic operations ADDF, SUBF, MULF, DIVF.
Register move instruction RMO

Register-to-register
arithmetic operations ADDR, SUBR, MULR, DIVR
Supervisor call instruction ( SVC).

Input and Output


There are I/O channels that can be used to perform input and output while the CPU is
executing other instructions. Allows overlap of computing and I/O, resulting in more efficient
system operation. The instructions SIO, TIO, and HIO are used to start, test and halt the operation
of I/O channels.
LOADERS AND LINKERS
A loader is a system program that performs the loading function. A loader reads the
executable code into memory, does some address translation and tries to run the program
resulting in a running program or an error message. Many loaders also support relocation and
linking.
Source program Assembler Linker
Object code

Executable code
Loader

A linker combines one or more object files and possible some library code into either
some executable, some library or a list of error messages. Some systems have a linker to perform
the linking operations and a separate loader to handle relocation and loading
Three fundamental processes
Loading – brings the object program into memory for execution.
Relocation – modifies the object program so that it can be loaded at an address
different from the location originally specified.
Linking – combines two or more separate object programs and supplies the
information needed to allow references between them.
BASIC LOADER FUNCTIONS
The most fundamental functions of a loader is bringing an object program into
memory and starting its execution.

DESIGN OF ABSOLUTE LOADER


For a simple absolute loader, all functions are accomplished in a single pass as follows
1)The Header record of object programs is checked to verify that the correct program has been
presented for loading.

2) As each Text record is read, the object code it contains is moved to the indicated address in
memory. No need to perform program linking and relocation
3)When the End record is encountered, the loader jumps to the specified address to begin
execution of the loaded program.
Advantage
o Simple and efficient
Disadvantages
• The need for programmer to specify the actual address at which it will be loaded
into memory

• Difficult to use subroutine libraries efficiently


Loading of an absolute program

a. object program

b. Program loaded in memory


Algorithm for an absolute Loader

Example :
convert the pair of characters “14” (two bytes) in the object program to a single byte
with hexadecimal value 14
A SIMPLE BOOTSTRAPLOADER
loader
When a computer is first turned on or restarted, a special type of absolute
called a bootstrap loader is executed. This bootstrap loads the first program to be run by the
computer usually an operating system.
The bootstrap itself begins at address Zero in the memory of the machine.
It loads the operating system or the other programs starting at address 80.
Because this loader is used in unique situation i.e the initial program load for the
system.
The object code from the device F1 is always loaded into consecutive bytes of memory
starting at address 80. There is no header record , end record or control information
such as address.
The work of a bootstrap loader is performed by the subroutine GETC. This subroutine
reads one character from the device and converts its from ASCII Character code to the
value of hexadecimal digit that is represented by the character.
The subroutine GETC jumps to the address 80 when end of file is read from the device.
Its skips all the other input characters that have ASCII character less then hexadecimal 30. This
cause bootstrap to ignore any control bit that are read.
The main loop of bootstrap keeps the address of the next memory location to be loader
in the register X. GETC is used to read and covert a par of character of from the device F1. These
two hexadecimal digit value are combined into single byte by shifting the first one left four bit
position and adding the second to it .
The resulting byte is stored at the address currently in the register X using STCH
instructions that refers to the location 0 using index addressing . The TIXR instruction is then
used to add one value in the register X.
Bootstrap loader for SIC/XE

Begin
X=0x80 ; the address of the next memory location to be loaded
Loop
A GETC ; read one char. From device F1 and convert it from the ;ASCII
character code to the value of the hex digit
save the value in the high-order 4 bits of S

A GETC
A (A+S) ; combine the value to form one byte
store the value (in A) to the address represented in register X
X X+1

end
MACHINE DEPENDENT LOADER FEATURES

When the program is assembled the actual address at which it will be loaded in to the
memory is one of the most obvious need of the programmer. There is only one room to run one
program at a time the starting address for this single user program is known in advance.

Writing obsolete program makes it difficult to use subroutine libraries efficiently. The
need for program relocation is a indirect consequence of the change to large and more powerful
computers. The way relocation is implemented in the loader is also dependent upon machine
characteristics.

- Relocation
- Program linking
- Algorithm and data structure for linking a loader
- Relocation
It discusses the dependencies by examining different implementation techniques.
Loaders that allow for program relocation are called relocating loaders are relative
loaders.

Line Loc
Source Object code
Statement

5 0000 COPY START 0 17202D


10 0000 FIRST STL RETADR 69202D
12 0003 LDB #LENGTH 4B101036
13 0006 CLOOP BASE LENGTH 032026
15 000A +JSUB RDREC 290000
20 000D LDA LENGTH 332007
25 0010 ENFIL COMP #0 B10105D
30 0013 JEQ ENDFIL 3F2FEC
35 0017 +JSUB WRREC 032010
40 001A EOF J CLOOP 0F2016
45 001D RETADR LDA EOF 010003
50 0020 LENGTH STA BUFFER 0F200D
55 0023 BUFFER LDA #3 B10105D
60 0026 STA LENGTH 3E2003
65 002A +JSUB WRREC 454F46
70 002D J @RETADR
80 0030 BYTE ‘C’ EUF
90 0033 RESW 1
100 0036 RESW 1
105 RESW 4096

Relocatable program for the standard machine


Two methods for specifying relocation as a part of the object program.
A modification records is used to describe each part of the object code that must be
changed when the program is relocated. Most of the Instructions use relative are
immediate addressing. Each modifications record specifies the starting address, the
length of the feet who value is to be altered. The modification records scheme is a
conventional means for specifying program relocation how ever it will not be well
suited for use with all machine architecture.
The text records are the same as before except that there is a relocation bit associated
with each word of the object code. The relocation bits are gathered together into a bit
mask following the length indicator in each text record. If the relocation bit
corresponding to the word of the 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
that no modification is necessary.
Thus the bit mask FFC in the first Text record specifies that all 10 words of the object
are to be modified during relocation. The mask E00 in the second Text record specifies that the
first three words are to be modified. The remainder of the object code in this record represents
data constants and thus it does not require any modification.

Relocation bit is 0 : no modification is needed


bit is 1 : modification is needed

object program with relocation bit mask


- Program Linking
Sample program illustrating Linking and relocation
memory
address contents

programs after linking and loading


Relocation and linking operation for REF4 from PROGA
LOADER DESIGN OPTIONS
* Linkage Editors
* Dynamic Linking
* Bootstrap Loaders

* LINKAGE EDITORS
* DYNAMIC LINKING

Implementation of Dynamic Linking


Loading and calling subroutine using Dynamic Linking
* BOOT STRAPLOADER
MACHINE INDEPENDENT LOADER FEATURES
Automatic Library Search
Loader Options

Common Loader Options – Command Language

You might also like