Professional Documents
Culture Documents
Operating system is a system software that is extremely important to activate and co-
ordinate the activities of various hardware resources like the processor, input output devices etc. It
also controls the movement of information in the computer system.
It is the first program who loaded into the computer memory when we boot our computer
system. It provides a standard to its application software so that application software can talk to
operating system or each other easily.
The main functions of an operating system are...
(i) It assigns a processor to different tasks being performed by the computer system.
(ii) It allocates the main memory and other storage areas to the system programs as well as user
programs and data.
(iii) It carries out the input-output management and co-ordinates different input-output devices while
one or more program is being executed.
(iv)It manages file on various storage devices and their transfer from one to another devices. It also
allows modification through text editor or any other program.
(v) It establishes and enforces the job priority.
(vi)It automatically transfer control from one program to another as per control signal supply by
user.
(vii) It establishes and maintains data security and integrity.
(viii) It also produces error messages and other debugging codes.
(ix) It maintains log of users in multi-user operating system.
(x) It facilitates easy communications between the computer system and the computer operator.
Real - time Operating Systems work towards providing immediate processing and also
responding to user's commands in a very short time. Such an operating system is more
commonly used in chemical industry for process control and scientific processing like airplane
control and space vehicle control operations. Success of a real time system does not depend only
on the correctness of the result, but also on the timeliness of the result. A correct answer obtained
after the expiration of time limit is as bad as a wrong answer. Some examples of real time
operating systems are HP-RT and VT- works.
Network Operating System (NOS)
Network Operating System (NOS) is an operating system specifically designed to support
interconnection of several computers. NOS provide support for multiuser operations as well as
administrative, security and network management functions. Some examples of NOSs are
Novell's Netware, Microsoft's Windows NT, Artisoft's LAN tactic etc.
A network operating system has to acknowledge and respond to requests from many
workstations, managing network access, resource allocation and sharing, data protection as well
as error control. It provides for printer, file system, database and application sharing.
Distributed Operating system
A Distributed Operating System hides the existence of multiple computers
(interconnected by a network) from the user. That is, the user remains unaware of the fact that
many computers and being used to process the data. These computers may be located at many
places around the globe. Distributed Operating System provides single- system image to its
users. Each computer in a distributed computing system processes a part of the global distributed
operating system. All these computers work in close coordination with each other. Processes and
system resources are managed globally, and controlled from specific locations.
User views the complete system as a "virtual uni-processor" and not as a collection of
machines. The distributed operation system works towards generating this illusion.
Degree of autonomy of individual computers in an environment that uses network operation
system is very high whereas the degree of autonomy of individual computers in an environment
that uses distributed operation system is considerably low.
Multiprogramming
In a Batch Multiprogramming system, a series of jobs was loaded into the memory at the same
time, if sufficient memory space were available. While one job was held up waiting for an I/O
transfer, another job was started. A job was selected (from those ready to run), on the basis of an
operator assigned priority number. It was found advantageous to mix jobs which differed in the
balance of processor to I/O activity.
Some systems only handled two jobs at a time, which were referred to as the foreground and the
background jobs. The foreground job had the higher priority and was allowed to run if it was
able. The background job could only run if the foreground was awaiting an I/O transfer or was
otherwise inactive. Background running is inherently more suited to jobs requiring little
processor time, but with relatively more I/O activity. A specific example of such a job is referred
to as spooling.
Spooling
This acronym stands for Simultaneous Peripheral Operations On-Line. Essentially, this technique
absorbs surplus processor time by performing I/O transfers for other jobs. Input and output data
were routed via disk files, so that these jobs were only required to communicate with disk
systems with disk systems which are, of course, much faster.
Spooling was one of the earliest applications of multiprogramming. Jobs are read in via a card
reader and copied into a disk file. The operating system reads this file as if it were the card
reader. Printable output generated by the running programs is written to another disk file, while a
printing program constantly prints the data in this file (if any).
Another benefit of spooling is that access to the slow peripherals is restricted to the one program,
namely the spool print program. This facilitates the sharing of devices such as printers between
several running programs, avoiding the need for these programs to compete for possession of
the printer.
Memory Management, Process Management, Device Management, File Management
OPERATING SYSTEM SOFTWARE - Operating System is a set of programs that is
extremely important to activate and Co-Ordinate the activities of various hardware resources like
the processor and Input/Output devices. In other words, Operating System controls the
movement of information on in the Computer.
OS is the first program loaded into the computer's memory after the computer is switched
on. The operating system is an important component of the computer system, because it sets the
standards for application programs that run in it. All programs must be written to "talk to"
Operating System. The main functions of an OS are: -
(a) It assigns a processor to different tasks being performed by the computer system.
(b) It allocates the main memory and other storage areas to the system programs as well as
user programs and data.
(c) It carries out the input/output management and coordinates and assigns different input and
output devices while one or more programs are being executed.
(d) It manages files on various storages devices and the transfer of these files from one storage
device to another. It also allows all files to be easily changed and modified through the use
of text editors or other file manipulation software packages.
(e) It establishes and enforces the job priority. That is, it determines and maintains the order in
which jobs are to be executed in the computer system.
(f) It automatically transits from job to job as directed by special control statements.
(g) It is able to interpret commands and instructions.
(h) It co-ordinates and assigns compilers, assemblers, utility programs, and other software
packages to various users working on the computer system.
raj 4
(i) It establishes data security and integrity. That is, it keeps different programs and data in
such a manner that they do not interfere with each other. Moreover, it also protects data
from being destroyed by and other user.
(j) It also produces traces, error messages, and other debugging and error detecting codes.
(k) It maintains internal time clock and log of system usage for all users.
(l) It facilitates easy communication between the computer system and the computer operator
(human).
2.DISTRIBUTED OPERATING SYSTEM: ALGORITHM
Why Distributed
The evolution of computer communication technology let to the implementation of a
major computer network called ARPANET in the late sixties. It was funded by the Defense
Advance Projects Agency (DARPA) of the U.S. Department of Defense provided a large scale
operational experience and stimulated a lot of early research on computer networks. Ever since,
researchers and practitioners alike have liberated at realizing the promise of distributed
processing. It major potential benefits include:
Resource sharing and load balancing
Communication and information sharing
Incremental growth
Reliability, availability, fault tolerance
Performance
Resource sharing is one of the major potential advantages of distributed systems.
Temporary surpluses and shortages of resources such as processing power, storage capacity, and
information from databases may be balanced to improve cost-effectiveness and performance of a
distributed system.
On a greater scale, a distributed system effectively merges a number of previously
autonomous user populations, such as several different time-sharing systems and/or LANs, into a
larger union.
Similar savings have been realized in other industries, such as load sharing in power
utility systems. A large common distribution system makes it possible to pool the power and
meet the demand wherever it occurs.
raj 5
What Is Distributed
Distribution basically spans three dimensions:
Hardware
Control
Data
System resources generally fall into one of the two categories (1) physical resources, such
as processors and devices, and (2) logical resources, such as files and processes. Distributed
algorithm and processing often involve multiple processes that execute on different nodes.
Control includes resource management and coordination of activities that takes place on
individual nodes.
Centralization control requires delegation of an arbiter node that manages a set of system
resources. The central arbiter has complete information about the state of resources under its
jurisdiction and of pending requests for their use. The single-point failure problem may be
raj 6
alleviated by implementing algorithm for election of the successor node, at the cost of added
complexity, logging of outstanding requests, and potentially long transition delays.
Distribution of data may be partitioning, replication, or both. In some applications
judicious partitioning of data can contribute to performance and availability by placing
frequently used items close to their points of processing.
Computer Networks
Autonomous machines that execute application programs and constitute the
computational resource of a distributed system are usually called hosts. They are connected for
purposes of communication by means of a communication network or sub network. Depending
on the physical distance spanned by their communication sub-networks, computer networks are
usually classified as
Wide-area networks (WANs)
Local area networks (LANs)
Wide Area Networks:-
As indicated the communication subnet itself consists of a number of communication
processors connected by physical communication lines. Dedicated communication processors act
as switching elements between two or more communication lines. After the original ARPANET
implementation, the communication processors are often called interface message processors, or
IMPs for short.
A host processor wishing to communicate with another host typically presents its request
to the designated IMP. Usually each host is availed the services of a specific IMP, although a
single IMP may serve several hosts. The IMP-to-IMP communication channel may be of one of
the two board types:
Point to point
Broadcast
Point-to-point links are dedicated physical lines used to connect a specific pair of IMPs.
The actual number and topology of these links are determined by taking into
consideration factors such as cost, communication delays, and reliability. Common
topologies of physical circuits that connected IMPs are:
Star
Partially connected
Fully connected
Ring
Hierarchical or tree-structured network
The star has a fixed, two-hop host-to-host communication delay but suffers from the
single point of failure. Fully connected systems are fast and reliable but expensive since the
number of links grows as the square of the number of hosts. Partially connected and mesh
networks have direct links between some but not all nodes.
Single-link ring networks are low in cost but have variable and potentially long delays,
especially when a host wants to communicate with its immediate neighbor in the direction
opposite the ring flow. Rings are generally sensitive to link failures, especially in native
implementations, where each node must act as an active repeater for all traffic.
Hierarchical connections may be suitable for certain types of organizations and systems,
such as process control, where communication naturally flows in a hierarchical manner. This
configuration is poor in systems with frequent peer-to-peer interactions, since they must be
routed up and down the hierarchy.
Local Area Networks:-
raj 7
As indicated earlier, local area networks (LANs) are characterized by high bandwidth,
low-delay communication links. They often rely on a relatively high-speed common access
communication medium to carry the massage traffic. LAN communication speeds range from the
order of several Mbps to the order of a Gbps with special cabling or optical fibers.
The LAN communication medium itself is passive in the sense that it provides none of
the processing power, routing, or storage functions found in the store and forward
communication subnets. In LANs, communication functions and processing are provided by the
nodes (host machines), either directly or by their integral dedicated communication processors.
The network topology is usually a bus or a ring. A star topology may be found in special-
purpose systems and in some early designs.
In ring-based systems, messages circulate around the ring. They are then recognized and
copied by their addresses. Depending on the acknowledgement scheme in use, either the
destination or the source node may be charged with removing the consumed massage from the
ring.
Another common topology in local-area networks is the bus. In a typical bus technology,
a commonly accessible passive conduit carries the message traffic. All nodes tap the bus, listen to
all the traffic, and extract the massage addressed to them. Taps themselves are usually passive
and do not physically break the bus. As a result, bus-oriented LANs are reliable and able to
sustain communication between healthy parties in the presence of multiple node failures.
A token-bus is a LAN that attempts to combine the benefits of bus topology with the
bounded massage delays characteristic of rings. A token bus is a bus-based LAN whose nodes
from a logical ring in order to use tokens for access control. A token bus is used in MAP
(Manufacturing Automation Protocol) LAN.
Algorithm for Distributed Processing
In a distributed system, cooperating processing may reside on different nodes. Like their
single-site counterparts, distributed cooperating processes rely on inter process synchronization
and communication mechanisms to collectively and coherently accomplish a common mission.
These complexities are largely due to he differences between distributed and centralized systems
which include:
Absence of shared, commonly accessible memory
Internodes communication delays that can exceed internodes communication delays by
orders of magnitude
Global system states is not observable by component machines due to communication
delays, component failures, and absence of shared memory
A much richer set of failure modes and the desire to continue at least degraded operation
in the presence of partial failures
In certain respects, a centralized system may be viewed as a special case of a distributed
system in which inter component propagation (communication) delays are practically
negligible. As a result, algorithms and mechanism devised for the distributed case
generally function correctly when applied to the centralized uniprocessor case, but the
converse is not necessarily true.
Lamports Algorithm:-
Assuming the presence of the pipelining property and eventual delivery of all messages,
the solution requires time-stamping of all message, and it also assumes that each process
maintains a request queue, initially empty, that contains request message ordered by the relation
. The algorithm is defined by the following five rules.
raj 8
database concurrency control algorithms that avoid deadlocks. Each transaction is time-stamped
at its creation by the originating site. Each site maintains a lock queue for each of its publicity
available resources. Lock queues are ordered according to the time stamps of participating
transactions. A transaction at the head of a queue owns the resources. In case of conflicts, a node
where lock requests collide applies locally one of two rules:
Wait-die: If the requestor is older, than the transaction that owns the desired lock-the
requestor-waits. Otherwise, the requestor dies.
Wound-wait: If the requestor is older than the owner of the lock, the requestor wounds
the owner. Otherwise, the requestor waits.
Dying means that the affected process or transaction is aborted. For transactions, aborting
implies the undoing of all partial effects and the releasing of all locks acquired by the transaction
thus far. The aborted transaction is usually restarted at a later time. Wounding means that an
older transaction instructs the younger, conflicting one to die-that is, to abort, undo its partial
effects, and release the locks.
In the wait-die scheme, an older transaction is permitted to wait. This is safe because
circular waiting chains cannot be formed, since a younger transaction never waits for an older
one.
In the wound-wait scheme, an older transaction does not wait for younger ones. After
wounding, the transaction has to wait for the wound to take effect and for the younger transaction
to die and release the lock.
In a wait-die system, a transactions that dies and is restarted may again cause a conflict
with the same transaction and be forced to die again. On the positive side, wait-die systems have
the desirable property that a transaction is guaranteed not to restart ones it has accessed all its
required database entities for the first time. This property is not enjoyed by wound-wait systems.
Coping With Failures
One of the major potential benefits of distributed processing is resilience to failures and
increased system availability. Mere distribution of hardware and data does not automatically
yield an inherently more reliable system. In fact, due to its dependence on multiple nodes and
communication links, a distributed system may be less reliable than a single-site centralized
system. The promise of distributed systems can only be realized when the proper hardware
foundation is augmented with fault mechanisms and data redundancy provided and managed by
the systems software.
Failures in Distributed Systems:-
Common failures in distributed systems include:
Communication-link failures
Node failures
Lost messages
In order to function properly, the rest of the system must (1) detect failures; (2) determine
the cause, such as identifying the type of failure and the failed component; (3)
reconfigure the system so that it can continue to operate; and (4) recover when the failed
component is repaired.
A node engaged in a handshaking protocol of some kind usually experiences a
failure as the lack of expected response from its partner within a prescribed time limit.
The use of time-outs is a common technique for detecting missing responses or
acknowledgements. Too long time-out results on sloe detection of missing messages. On
the other hand, too short a time-out may trigger false alarms by declaring as missing
messages that are just delayed.
Given the possibility of lost messages, it is common to go through a few retries
before declaring a failure to communicate. After a predetermined number of retries fails
raj 10
10k job is
30k job is 8k and job is 16k. Applying fifes scheduling policy.
Process a, process b, process c can be allocated in memory. Process d
cannot be accommodated because. Only {60-(30+15+10)} =15k
memory rest. Show in fig.
raj 12
Let us assume process after some time process a is terminated, releasing 10k memory
space. This is shown in below fig.
3.FILE MANAGEMENT
Logically related data items on the secondary storage are usually organization into named
collection called files. User can rely on a single, uniform set of file-manipulation system
services for both file and I/O device management. Thus sometimes referred to as device-
independent I/O.
The common responsibility of the file management system includes the following:--
Mapping of access request from logical to physical file address space.
Transmission of the file element between main and secondary storage .
Management of the secondary storage, such as keeping track of the status allocation, and
deletion of space.
Support for protection and sharing of file and the recovery and possible restoration of file
after system crash.
File of a computer installation can be stored on a number of physical devices, such as disk drive,
magnetic tapes, or semiconductor memory.
According to the method of invocated of the service, users of file may be broadly divided into
two categories:
I. Command language user
II. System programmers
The formal category includes user who invoke file management service by means of the
operating system command language. In most system, such user can LIST content of a file
directory COPY file between volumes or devices CREATE, DELETE, and RENAME file. File
creation may be done by invoking the text editor, which in turn time CREATE_FILE service to
pass on the users request to the file management system.
File directory in computer in computer system usually belong to one of two categories: -
single level or hierarchical. A single level directory, often called a flag directory, contens all file
in the system or on a given volume .these problem can be alleviated by using hierarchical
directories. In a hierarchical directory system, user can group the related file into subdirectories.
All system file are then cataloged in a hierarchy of directories whose structure is similar to that
of a rooted tree. Access to files in a hierarchical system in principle requires user to indicate all
directories that must be searched in order to locate a given entry. Such a specification is often
called an access path or a path name.
Edit report
raj 14
Root
Jones Smith
disk
Drive select
Head select
Direction (in/out )
Step
Read
Write
Data out
Data in
Reset faultclear
Track00
Index ready
Faulty
Volume
miscellaneous
A typical disk driver basically allows reading and writing of disk sector specified by means of
the three component physical disk addresses of the form:
<Cylinder number, head number, sector number>
Some implementation requires READ and WRITE request to be preceded by head position
SEEK command. Some disk drive and controller are capable of transferring multiple sector or
even track, in response to a single command. An advantage of this mode of operation is that head
raj 16
are positioned once, so that the overhead of average access time may be amortized over many
sectors.
Disk access time, and consequently the speed of many operations of the file system that depend
on it, may be caching certain disk blocks in memory. This is similar to a memory cache. In
UNIX, cached disks blocks are managed more recently by software vendors for personal
computers, where it was initially implemented as an add or utility. A disk cache operates by
maintaining a pool of recently used disk blocks is main memory. The request result in a cache hit
, and it is satisfied from memory. If the requested disk block is not in the cache, a disk-cache
miss occurs, and the request is satisfied by accessing the disk.
Disk caching may be applied to both reads and writes. Some disk caches retain only
blocks that are read, and direct all writes to the disk. This approach is known as write-through
caching. It is generally less efficient than read/write caching. But not necessarily by a wide
margin, since a large majority of disk accesses are generally believe to be reads. The buffer
caches are a pool of blocks used to store a collection of recently used disk blocks. The size of the
buffer cache is typically determined during system configuration.
When a running process request a disk block, the operating system translate the reqesr
into the device and block number and applied the hash function to those in order to search the
buffer cache. The ensuring hash search may yield one of the following finding:-
1. The target block is on the free list.
2. The target block is in the buffer cache but is not free.
3. The target block is not in the buffer cache.
Improved effective disk access time by satisfying requests for the cache block
from memory.
Improve response time to application for cached block on read and optionally, on
delayed writes where the i/o requestor is not forced to wait for the completion of a
disk write.
Reduce server and networking loading with client disk caching in distributed
system.
Implement of the Berkley variety of UNIX claim elimination of 85% of disk accesses. The
primary disadvantage of disk caching is the potential corruption of the file system due to loss of
power or to system crashes if delayed write are allowed. Poorly implemented or parameterized
disk caching systems were also found to under perform nonrated under certain condition.
A GENERALIZATION OF FILE SERVICES
Device independent I/O provides both an ease of use and flexibility not attainable by most other
approach. Device independent is essentially a form of delayed binding of user programs to i/o
device. User programs are coded and prepared using an abstract of device, such as files, logical
I/O port, or logical unit number. Much different type of I/O devices it is customary to regard all
devices as files in the sense of having a name and allowing bytes to be read from or written into
them. A major division between byte-serial and block-structure devices is usually made. Some
systems refer to these as unstructured and structured I/O respectively. The formal class includes
device capable only of byte-serial transfer, such as printers and terminals. Although creations and
deletions are customary for file, devices are usually regarded as permanent object created at
system startup time. Depending on the type of device exclusive or share access may be granted
to requestor. This uniformity of treatment allows user to handle both file and device by means of
a single set of system calls. Advantage of device independence is that it facility the portability of
object code between system with different hardware configuration. Device specification can be
changed without reprogramming.
Some system uses an interposes communication mechanism call pipe. Which is similar to
messages but ncan be programmed using the standard set of file and I/O services. A pipe is a
virtual communication channel that can be used to connect two processes wishing to exchange a
stem of data. The two processes communication via a pipe can be written into at one end and
read from at the other. Implicit synchronization between the processes communicating via a pipe.
The differences are that the pipe facility does not require explicit synchronization between
communicating it is handled at the system call level in exactly the same way as file and device
independent i/o. A pipe can be created or accessed if it already exists, by means of an OPEN
call. A writer process normally produces streams of data that it writes into the pipe. A reader
process consume data
AT&T, together with numerous variants of the system provided by the other vendors. Several
specified versions of UNIX, such as the Programmers Workbench, UNIX/PWB, and Writers
Workbench, UNIX/WWB, are also available.
Some of the major features of UNIX are:-
Portability
Multi-user operation
Device independence
Tools and tool-building utilities
Hierarchical file system
Silent feature of UNIX are:-
(i) Multi-user capability in this system the same computer resources like hard-disk,
memory, printer, floppy disk drive (FDD), optical disk are accessible to many user. There are lots
of terminal connected to a main computer called Host computer or Server. All the
terminals are called Clients. All terminals are connected to main computer whose resources
are available by all users. So users at any of the terminal can use not only the computer but also
any peripheral that may be attached safe for instance printer. One can easily how economical
such as setup is then having as many computers as then are users and also how much more
convenient when some data is to be shared by all. At the heart of UNIX installation is the host
machine is known as Console/Server. The numbers of terminal that can be connected to the
host machine dependent on the numbers of ports that are present in its controller card. For
example part controller cards in host machine can support for terminal. There are several types of
terminals:-
(a) Dumb terminals: Consists of keyboard and VDU(Visual display unit) with no
memory. It can never act independent machine.
(b) Terminal emulation: Having its on microprocessor memory and disk drive. By
attaching this PC to the host through capable and running software from this PC.
We can emulate it to work as if it is a dump terminal. It can not be any processing
own its. Its transmit its processing job to the host. The job software makes the PC
work like dump terminal is called terminal emulation. Ex: VTERM, XTALLIC.
(c) Dial in terminal: It is connected through telephone line with host using modem
called Dial in terminal.
(i) Multitasking capabilities: It is capable of carry of more than one job
at the same time it allows due to type in a program in its editor. While
its simultaneously execute some other command you might have
given easily, say to surd and copy a use file.
(ii) Communication: UNIX has extended provision for communicating
with fellow user. The communication may be within the network of a
single main computer or between two or more such computer
networks. The user can be easily exchange mail, data, programs which
such as networks.
(iii) Security: Using allows sharing of data but not indiscriminately.
UNIX has three inherent positions for processing data.
The first is providing accessing password and login name
to individual user in security that not anybody can come
and have accesses to your work.
At the file level there are read, write, and execute
permission to each file which decide who excess a
particular file.
raj 19
1. / bin: -
This
processor of the UNIX operating system. Shell acts as an user interface. The three major type of
Shell are:-
(a) Bourne Shell: - It is developed by Steve Bourne. It is most popular shell properly thats
why it is bounded with every UNIX system.
(b) Korn Shell: - It is developed by David G. Korn. It has many more capabilities and is
more powerful and efficient than Bourne Shell.
(c) C Shell: - This shell is a bit with those who are seriously into UNIX programming. It was
created by Bill Joy. It has two advantages over the Bourne shell. Firstly it allows aliasing
of commands that is you can decide what name you want to call a command by. This
proves very useful when lengthy commands which are used time and again are removed
by you.
UNIX users invoke commands by interacting with a command language interpreter called the
Shell. In addition to interpreting user requests and invoking the corresponding system services,
the shell is also a programming language suitable for construction of elaborate command files,
called shell scripts. The shell is written as a user process, as opposed to being built into the
kernel. When a user logs in, the system invokes a copy of the shell to handle interactions with the
related user. Although the shell is the standard system interface, it is possible to invoke any each
particular user. This allows dedicated interfaces developed for users of specialized applications,
such as clerical workers using text processing facilities, to coexist with the shell and thus provide
quite different views and working environment for different users of the same system.
Features of Shell: - Some important features and benefits of shell are:-
(a) Communication between user and UNIX system takes place through the shell.
(b) Shell allows background processing of time-consuming and non-interactive tasks.
(c) A frequently used sequence of commands can be stored in a file called Shell script. The
name of the file can then be used to execute the sequence of commands, automatically.
(d) Shell includes features which allow it to act as a programming language.
(e) A user can select a group file for processing with a single command.
(f) Input of one command can be taken from the output of another command or output of one
command can be diverted to the input of file or printer, using the input output redirection
operators (>,<, >>). Pipes (|) can be used to connect simple commands in order to
perform complex functions.
Pipes (Connecting Commands): -The pipe (|) operator is used to indicate to the shell to take
input from another command or give output to another command. For this one method is to first
list all the files using ls command and then manually count the number.
Another method is to save the output of ls into a file (using <) and then count the number of
lines in the file using wc-l command. This method, though it works, requires an intermediate file.
The third and the best method is to connect the two commands, so that one can take input
from the other. This is can be done using the pipe (|) operator as follows:
$ ls sales | wc -l
Here the output of ls has been passed directly to the input of wc. That is, ls is said to be
piped to wc.
Shell Programming: - It is also called Shell script.
When to use Shell script/program:-
(i) Customizing your work environment. For example Every time you login it you want to
see the current date, a welcome message and the list of users who have logged on.
(ii) Automating your daily task. For example You may went to back up all of your
programs at an end of the day.
(iii) Automatic repetitive task. For example The repetitive task of compiling C
program, linking it which some libraries and executing the executable coexist.
raj 21
(iv) Preforming same operation on any files. For example You may want to replace a string
my printf in all the c program present in the directory.
Rules for creating shell program: -
(i) Open a new file with unique name and related too.
(ii) Write the sequence of instruction using set of UNIX commands.
(iii) After writing the instruction save the file and exit to the prompt shell.
Run Shell program: - Write he file name and run like:
.sh <file name>
Vi simple
$ .sh simple
Commands:-
(i) read:-
purpose: - To accept value from standard input device
(keyword).
Syntax: read var1 var2.
Example: read a b
(ii) echo:-
Purpose: - To display the contents on console.
Syntax: echo string
The System Kernel
The Kernel is at the core of UNIX system. This is loaded into the main memory as soon as the
system starts up. It manages memory, files and peripherals devices. It also maintains date and
time, launches applications and allocates system resources.
The different functions performed by the kernel are:
(a) Managing memory, namely allocating and deallocating memory area including address
space to each process.
(b) Scheduling, enabling each user to work efficiently.
(c) Organizing data transfer between I/O devices and memory.
(d) Accepting instructions from the shell and carrying them out.
(e) Enforcing security measures.
Kernel provides the basic full-time software connection to the hardware. The structure of
kernel is shown in the figure. The kernel handles memory management, input and output
requests, process scheduling etc. To help it with its work, the kernel also executes daemon
programs which stay alive as long as the machine is switched on and help perform tasks such as
printing or serving web documents. The kernel, thus controls and provides access to memory,
processor, input/output devices, disk files and provides special services to user programs.
The basic UNIX kernel can be broken into four main subsystems:
(a) process Management
(b) Memory Management
(c) I/O Management
(d) File Management
VI - EDITOR
Editor: It is a program that provides facility to read/write/modify/manipulation of
data/document/text etc. is known as Editor. Ex- EDIT in DOS, VI-EDITOR(UNIX) etc.
raj 22
(ii) Insert mode: - This mode permits insertion of new editing or existing text or replacement
existing text. Each of these operations can be performed only after changing over from
the command mode to insertion mode using appropriate command. The insertion mode is
also known as Input text mode.
(iii) Ex- Command mode: - This mode permits us to give command at the command line.
The button line of the VI-screen is called the command line. VI-User the command
line to display message and commands. All command enter in the EX-command
mode are display in command line. This mode is show cause the command given in
this mode is comfortable for the commands of EX-editor.
Purpose: To create file/edit files/modify files.
Syntax: VI <file name>
(1)
Command for
}
Let us nam the file as mess.c. This program can be compiled and executed as follows:
$ cc mess.c
$ a.out
The output is shown in the figure:-
The program is compiled with the cc command, which creates a file a.out, if the
programming code is correct. Just typing a.out will run the program.
To get your program into a file other than a.out, you can do either of the following two
things:
(a) rename a.out into any other filename you want.
(b) Use o option with the cc command. For example, the following command runs the C
compiler and places the executable code in a file called output:
$ cc o output mess.c
Now to run this program, you have to just give the filename output, as follows
$ output
$
$ vi mess.c
$ cc mess.c
$ ./a .out
$ Simple C Program
$
$ cc o output mess.c
$ ./output
$ Simple C Program
$
$ cc c main.c
$ cc c rect.c
$ cc c circle.c tri.c
$
$ cc o output main.o rect.o circle.o tri.o
$ ./output
1: Rectangle
2: Circle
3: Triangle
Case study
Windows belongs to the category of software called a GUI (Graphical User Interface).
The user interface determines how you interact with your computer. The hardware part of the
interface consists of your screen monitor, the keyboard and the mouse. The software part of the
interface determines what things look like on the screen and how you give commands to your
raj 26
therefore was quite cumbersome. With the advent o Windows environment many of every day
computer tasks - such as running programs, opening files, choosing commands etc. are done
using a graphical approach that is very intuitive to new users o computers. Further, Windows
programs use the same command structure and graphical items on the screen, so if have mastered
one Windows program, learning others becomes very easy.
At the primary stage Windows was developed as a Operating Environment; a add on
DOS when it had version 3.1 or 3.11. But later it developed as a Operating System. Windows'95,
98 or later versions of Windows is self Operating System.
When we switch on our PC, Windows 95 or 98's logo appears on the screen and after
some time it become ready to accept our instruction. Windows 98 offers three views and you can
work in any of these three views. These are: -
1. Classic View - This is default view in which to select an icon or file, you have to click the
object once and to run a program or open a file you have to double-click the icon or filename.
2. Web Style View - This view is looks like a web page. To select an icon or a file you have to
position the mouse pointer on the object. To run a program or open a file, you have to click the
icon or file name once.
3. Custom View - This view gives you the flexibility to control the appearance as per your
convenience and the ease of working.
WINDOWS TERMINOLOGY
Choose : Executes a command.
Select : Selects an item to activate it so that it can be changed. Selecting a command or option
turns it on but does not complete it. Selected Text or menu names/items appear in reverse type or
a different colour. Selected options show a dot (.) or an (x). Also the selected graphics appear
enclosed by a dashed line or enclosed in boxes known as handles.
Point : Move the mouse so that the arrow pointer is on the desired menu name, command name
or graphic object.
Pointer : Pointer is the on-screen symbol controlled by the mouse. The pointer changes shape to
indicate the current status and the type of functions and selections available.
I-beam : When the mouse pointer is in a text area that you can edit, the pointer appears as a
vertical I-beam.
Mouse Buttons : Microsoft mouse has two buttons and other makes may have three. Clicking
the left button completes an action and clicking the right most button brings up the shortcut
menu. Sometimes third button (if available) works as double-click of left button.
Mouse and their Actions
The mouse is a very convenient hand-held pointing device which is used to control the
position of the on-screen pointer. As you move the mouse on your desk or mouse pad, the pointer
moves on the screen corresponding to the mouse movement. Using the mouse, you can select
menus, commands, text, graphic objects or windows.
The Main actions of mouse are as follows :-
Click - Press and release the left mouse button quickly as you point to an item. Clicking is used
to reposition the insertion point in text, select a menu, choose a command from a menu, or select
an option from a dialog box.
Double-click - As you point to the pointed item on the screen, press and release the left mouse
button twice quickly. By double-clicking an icon or file name, you can open an application or
window related to that icon or filename.
Right click - Position the tip of the mouse pointer in the desired location on a document or
toolbar and then click the right mouse button.
Dragging - Dragging is moving objects on the monitor's screen. To do so first position the
mouse pointer on the object. Next, you "Pick up" the object by pressing and holding down the
raj 27
left mouse button. While you are still holding down the mouse button, move the mouse pointer to
where you want to "Drop" the object, and then release the moue button.
ELEMENTS OF WINDOWS SCREEN
The opening screen of Windows 95/98 has following elements: -
1. The Desktop - The Desktop is your work area while working in Windows. It is called Desktop
because Windows uses your whole screen in a way that is similar to the way you use the top of a
desk.
2. Icons and their types - An icon is a graphic object that represents something on our computer
screen. It has three types as follows :-
System Icon - System icons are displayed along left edge of the screen. These objects are
created automatically by Windows 98 during its installation. Among them following five are
generally shows :-
My Computer This icon lets you browse through the resources
connected to your computer.
My Documents This icon represents a folder that is used by many
programs as a default location for starting the documents.
Internet Explorer This icon starts a Web Browser named Internet Explorer.
Network Neighborhood This icon shows the names of each server or computer in
your own work group.
Recycle Bin This icon provides temporary storage for files and folders
that you delete.
Shortcut Icons - A shortcut provides easy access to some objects on your system, such as
program, a document or a printer etc. The shortcut icon only contains information about the
location o the object but not the object itself. Thus deleting a shortcut does not delete the
program from the hard disk for that shortcut. These are the icons with small arrows in the lower
left corner.
Program, Folder and Document Icons - These are non-system icon without arrows and
represent the actual objects they describe. Thus if you delete such an icon you are deleting the
object itself, from the hard disk.
3. The Taskbar - It situated at the bottom of the screen and it has generally following four
parts :-
Start Buttons - It is located at the left end of the taskbar. It invokes Start menu, the
Gateway of Windows.
Toolbars - Toolbars represent a set of related icons for easy mouse access.
Task Buttons - Task buttons are displayed in the Centre portion of the Taskbar. A button
Appears for each program you have started or each document you have
Opened.
Notification Area - The right corner of the Taskbar has the notification area in which
Windows provides information about the status of your system
including Clock.
Types of Windows
There are three types of Windows :-
1. Application Window : It contains executing Windows programs, and are sized, moved,
opened and closed on the desktop.
2. Document Window: an application window generates Document windows. A document
window cannot be sized or moved outside the confines of its parent application window.
3. Folder Windows : Opening My computer, or any of the folder you move to the desktop
produces a folder window.
raj 28
Elements of a Window
Borders - The four edges that define the perimeter of a window are called borders. Borders also
provide a way to change the size of the window.
Title Bar - This bar shows the name of the open application, sometimes with open document
name. It has generally three more buttons at the right side of it, i.e.
a) Minimize Button - When we click on it, the application become minimize, i.e. a
button appears in the taskbar and the screen become blank, or another window appears in
front.
b) Maximize Button - After clicking on it the window spreads full of the screen. After
maximizing the window, the maximize button converts into Restore button. When we
click on it, the window comes back to its original size.
c) Close Button - If we click on it, the window, either application or document, will be
close.
Control Box - It is a small icon located on the left side of the Title Bar. When we click on it,
Control Menu appears with so many options.
Scroll Bars, Scroll Boxes and Scroll Buttons - If a window is not long enough to display its
contents completely, vertical scroll bar appears along the right edge. If the window is not wide
enough, a horizontal scroll bars appears along the bottom of the window.
Scroll Bars have some rectangular boxes called Scroll Box. Size of Scroll box is become
proportional of the size of the whole file and displayed content on the screen.
Scroll buttons appear along the top and bottom edges of the vertical scroll bar and along
the left and right edges of the horizontal scroll bar.
The Menu Bar - The row of words just below the Title bar constitute the Menu bar. Each word
in the Menu bar represents a menu, which opens up when you click it. Generally it comes with
an application window, not with a document window.
Toolbar - It consists generally below of the Menu bar. A toolbar has so many small buttons who
represents a command.
Work Area - This is working area of the application. Depend upon the program it may be a
drawing area, a typing area etc.
START
When we click on this button we get following options :-
Shut Down This option is used to turn off the computer smoothly. While we work in
Windows'9x or later, Windows automatically opens so many temporary
files in background. If it will mot turn off through this option, then it is
possible that some error may be appear in Harddisk. Here we get three
options generally - Shut Down to turn off the computer, Restart to
warm boot and Restart in MS-DOS mode to start the system in DOS
mode, so we can work further in DOS environment.
Run This option is used to run any program by simply typing its command
line. We can also search Program through Browse button.
Help This option provides help about Windows.
Find This option is used to find any file or folder among different disks on our
computer or on network. We can search any file or folder by its name,
text containing by it, its size etc.
Settings This options is used to configure the hardware of the computer system,
taskbar etc.
The Control Panel - Select it from Start->Settings->Control Panel. This option is used to
configure the system. Here we get lot of icons. From them someone are :-
raj 29
Accessibility Options - The Accessibility Properties dialog box lets you configure
Windows keyboard, sound, display, and mouse and other options for people with
disabilities. This icon appears only if you installed Accessibility options when you
installed Windows.
Add New Hardware - This Wizard configures Windows when you add new
hardware to your computer system.
Add/Remove Programs - This Program's dialog box helps us to install new programs or
uninstall programs, which was already installed and no longer use.
Date & Time - This option provides two tabs - First one is Date & Time and second
is Time Zone. Date & Time option is used to change the current date and time, and
Time zone is used to select the place from world map from where user work.
Display - The display Properties dialog box controls the appearance, resolution,
screen saver and other settings for your display monitor.
Fonts - When we click on it, a window will appear in which we can see name of all
the fonts installed in our computer. We can see detail of any font by simply double-
clicking on it. To install more fonts Choose Add New Fonts options from File Menu.
Then give the path for fonts name. Windows will automatically install it.
Internet - This dialog box contains settings for your web browser and Internet
connection.
Keyboard - This dialog box contains settings that control your keyboard and the
cursor.
Mouse - This dialog box lets you define the buttons on your mouse. It lets you
choose how fast you need to double click, what your mouse pointer looks like on-
screen, and whether moving the mouse leaves a trial.
Multimedia - This dialog box contains settings for the audio, video, MIDI, and
audio CD settings of your computer.
raj 30
Network - The network dialog box contains settings, you use when configuring a
local area network. It also contains settings for connecting to the Internet.
Passwords - This dialog box lets you set a password for using Windows on your
computer, user profiles if more than one person will use the computer, and other
security settings.
Power Management - This dialog box contains controls to be set when Windows 98
automatically turns off your monitor, hard disks, and other computer components to
save electricity.
Printer - This icon is used to open the Printer window from where we can Add,
Remove or configure the printer.
Regional Settings - It lets you tell Windows 98 the time zone, currency, number
format, and date format you prefer to use.
Sounds - It lets you assign a sound to each Windows event, or events in other
programs. For example, you can set your computer to play a fanfare when your e-
mail program receives new messages.
System - It lets you use the Device manager to change advanced settings for each
hardware component of your computer. You can also optimize the performance of
your computer.
Telephony - The Dialing Properties dialog box contains settings that control how
Windows 98 dials the phone using your modem.
Users - The Enable Multi-user Settings Wizard helps you set up user names and
passwords so your computer can be used by more than one person. Each person's
user name can store that person's desktop settings.
Printer- this option is used to open the Printer window from where we can Add, Remove
or configure the printer.
Taskbar & Startmenu - This option is used to set the taskbar options, i.e. autohide, show
clock, small icons in windows and also items which will be included or excluded in Start
Menu or its Sub-menus.
Folder Options - This options is used to set the options about folders, i.e. which types of
filenames should be shown in different folder window or in explorer.
Active Desktop - This option is used to set the Desktop settings, i.e. whether the desktop
will be shown as web page or normal.
Documents This option contains last used document's list, so user can open it again
quickly from here.
raj 31
Programs This is the gateway to start any program in windows. There is lot of
group or application icons can access through this option.
Windows Accessories:
We can choose Start -> Programs -> Accessories to work on elements of accessories.
2. Games: When we slide our mouse at Accessories->Games then we get four games, i.e.
Solitaire, Mine- sweeper, Heart and Free-cell.
4. Calculator : When we click on it, a calculator will be open where we can do any type of
sum.
The Standard Calculator can be used to add, subtract, multiply, divide, take square root,
calculate percentage etc. The Scientific Calculator is considerably larger, more powerful and it
has many functions related to engineering, science etc. that can be used depending on our needs.
+ - Addition
- - Subtraction
* - Multiplication
/ - Division
5- Calendar: This option shows the calendar of a month or a particular day. We can also
change the month or year to see their calendar through choosing the Date option from
raj 32
Show Menu. User can also write their appointment within it when they are in Day View
(View-Day). We can also set alarm through the option Alarm-Set.
6. Cardfile: You can use Windows Cardfile to organize and manage information, such as
names, addresses, and phone numbers.
Adding More Cards
Cardfile adds new cards in the correct alphabetic order and scrolls to display the new card
at the front.
To add a new card to a file
1 From the Card menu, choose Add.
2 Type the text you want to appear on the index line.
3 Choose the OK button.
4 In the information area type text.
To Delete the card select Card-Delete and to make a little changes in a card choose Card-
Duplicate option. We can also AutoDial if our system is connected with phone with modem
through Card-AutoDial.
7. Imaging: Scanners, Digital Cameras, Clip Art CDs and the Internet give computer users
access to countless images, Which you can print, insert into your documents. The impact of
a picture can be improved by the addition of a few words, some highlighting and drawing
lines. Imaging for Windows is a tool for this.
8. Notepad: This program allows us to simply type anything in the text mode as in Edit.
File - New, Open, Save, Save as, Page Setup, and print and Exit.
Edit - Undo, Cut, Copy, Paste, Delete, Select All, Time/Date, Word Wrap.
Search - Find, Find Next (F3)
A very useful feature of Notepad is that it can automatically place a time-and-date
stamp in a document as and when it is opened. To do so move the insertion points to the
left margin of the first line in the Notepad and in capital letter type ".LOG". Save the file
and reopen the file and type the required notes. Save and close it again and once again
reopen it. We can see that how many times we reopen this file, we get automatic time and
date at the bottom of the earlier notes.
9. Wordpad: This is a Simple editor used to create, edit or print a document. It is more
powerful than Notepad and support format of Word 6.0, Write as well as Text format.
File - New, Open, Save, Save as, Page Setup, Print, Print Preview
Edit - Undo, Cut, Copy, Paste, Paste Special, Clear, Select All, Find, Find Next, Replace,
Links, Object Properties, and Object.
View - Toolbar, Format Bar, Ruler, Status Bar, Options-Shows options to Configure the
Wordpad i.e. options about measurement system and name of items appear during different
mode.
Insert - Date and Time, Object
Format - Font, Bullet Style, Paragraph, and Tab.
You can move in WordPad document using the mouse or the keyboard. Some of them are
following: -
With Cursor Key - Move one line up, down or one Character left or right.
With CTRL + Cursor Key - Move beg. Of paragraph, end of paragraph, one word left or
right.
With Pgdn/Pgup - Down one windowful/Up one windowful
raj 33
With CTRL + Pgdn/Pgup - To the End/Beginning of the last/first line the current window.
With Home/End - First/Last character in the current line.
With CTRL + Home/End - Beginning/End of the document.
10. Paint: This is a simple Drawing program, used to create, save, modify and print a graphics
image. This program is useful for creating pictures, icons etc. When we select this program
from Accessories, than an Application Window come.
The Paint screen can be divided into three parts: -
a) Toolbox: - It contains symbols representing drawing actions the cursor can perform.
b) Palette: - It contains a grid showing the various colors you can select and use.
c) Drawing Area: - This is the workspace where you create your Paint drawings.
Toolbox:
There are following types of tools at the toolbox:
a) Freeform Select b) Select c) Eraser d) Fill with color
e) Pick Colour f) Magnifier g) Pencil h) Brush
i) Air Brush j) Text k) Line l) Curve
m) Rectangle n) Polygon o) Ellipse p) Rounded Rectangle
Commands of Menus -:
File - New, Open, Save, Save As, Print Preview, Page Setup, Print, Set as Wallpaper
(Tiled), Set as Wallpaper (Centre).
Edit - Undo, Repeat, Cut, Copy, Paste, Clear Selection, Select All, Copy To, Paste From.
View - Toolbox, Color Box, Status Bar, Zoom, View Bitmap, Text Toolbar.
Image - Flip/Rotate, Stretch/Skew, Invert Colours, Attributes, Clear Image, Draw Opaque
Pasting Is the process o pasting whatever is on the clipboard into the destination
document.
Windows based application is generally written in coordination with other Windows
based application. This is very different from the way of DOS based applications work
where each application has its different file formats and file conversions that ware
required to transfer data form one application to another. With windows coming in
integrated documents can be prepared where say graphics are taken from paintbrush
document, charts from Excel documents and text from Word document. It is here that
clipboard comes in to play. The information from one application is first transferred to the
clipboard and thus forms the clipboard to the destination document.
Q. Differentiate between CUI and GUI? List the advantages of using GUI.
Ans. The CUI is an acronym for Character Using Interface or Character User Interface. It is a
type of display format used with most of the DOS based application packages that
enables a user to choose commands and see list of files and other option by pointing to
drop down menus using mouse or keyboard keys. The familiar example is the CUI used
with FoxPro package for DOS.
GUI (pronounced gooey) is an acronym for Graphical User Interface. It is a
type of display format that enables the user to choose commands start programs, and see
list of files and other options by pointing to pictorial representations (icons) and lists of
menu items on the screen. Choices can generally be activate either with the keyboard or
with a mouse. GUI offers an environment of what you see what you get.
For application developers, GUI offers an environment that takes care of the
direct interaction with the computer. This frees the developer to concentrate on the
application without getting bogged down in the details of screen display or mouse and
keyboard input. As the interface changes to support new input an output devices, such as
a large-screen monitor or an optical storage device, the applications can also, without
modification, use those devices.
Q. How do you change the settings of the mouse in WINDOWS? Is it possible to swap
the right and left buttons of the mouse?
Ans. To customize the mouse settings do the following:
1. Click Start
2. Select Settings
3. Open Control Panel by double clicking its icons.
4. From the Control Panel double click the mouse icon.
The mouse property box that appears offers the following customization features.
(a) Button This changes the function of the left and the right button.
(b) Pointers Creates a shadow of the mouse pointers movement on the screen.
(c) Motions The speed at which the mouse pointer moves relative physical to the
movement of the mouse.
(d) General Select the type of mouse used.
Q. What is a compound document and explain how it can be created.
Ans. A compound document is a single document made up of parts created in more than one-
application packages. For example, a report may contain a table created in Excel, and a
Logo created in a Clipart package. While finalizing the report in Word for Windows, you
can import table and the Logo from the different packages using Clipboard facility
available in Windows 98.
You can crate compound documents using the Edit menu's Paste Special option in the
application package in which you are assembling the document. In the application from
which you wish to link data, you select the data and place it on the clipboard using the
standard Cut or Copy commands. When the data to be linked is on the clipboard, use the
raj 35
paste Special option from the Edit menu to insert the information at the insertion point
and create the link. In the Paste Special dialog box click on the Paste Link option button
and then click on OK to create the link. After the link has been created, the information
will be updated into the receiving document whenever it is changed in the originating
document. As a result, you can build compound documents that assemble data from a
variety of resource applications and stay continuously updated. In a compound document
you do not have to manually move data form one applications the applications can now
handle that for you.
Ques. What does one mean by Cascading WINDOWS and Tiling Windows?
Ans. Windows offers two ways of arraigning the widows are open. These are:
(a) Cascading This causes all the open windows to be seized and staggered in such a
way that the tittle bars and edge or corner of every window is visible.
(b) Tiling Tile causes all the windows to be sized and lined up like tiles on a
bathroom wall.
Ques. What is screen saver and explain its utility?
Ans. Screen saver when set ON will blank the monitor screen or display a moving
image or pattern if the mouse or the keyboard is not used for a predetermined period of
time.
The use of screen saver is:
(a) Screen saver prevents damage to the screen by displaying a changing pattern.
(b) It also prevents the other viewers, from seeing what is on the screen when the user is
not working.
Q. Explain what do you understand by the term True Type of fonts.
Ans. True type of font gets their name from the fact that their appearance on the screen
is the same as the printer prints them. Prior to the introduction true type fonts computer
users needed separate screen fonts for display on the monitor and printer font, i.e.
printing on the printer. This is because printers and monitors have very different
resolution.
With the introduction of True Type fonts, however, a single font outline fulfills
both the roles. The True Type outline scales to any resolutions screen resolution, dot
matrix resolution, laser printer, or high quality type setting resolutions.
True Type fonts therefore offer two major advantages over the other fonts.
(a) These fonts are scalable, so only one picture of each character is needed instead of an
image for each character in each size.
(b) These fonts are independent, so only one version of the font must reside in the
Windows.
Q. Explain the term BITMAP.
Ans. A bitmap is the representation of an image by an array of bits. In a bitmap
characters or images are generated by writing the bit pattern to be displayed into the
associated storage, each bit of which is mapped to a pixel on the display surface.
In general, a bitmap image is a data structure that describes a bit image being held in
memory, such as its location in memory and its size.
Bit- mapped font
It is a set of characters in a particular size and style, in which each character is described
as a unique bit map (pattern of dots).
Bit-mapped graphics
These are the graphics that are stored and held as collections of bits in memory locations
corresponding to pixel on the screen. Bit- mapped graphics are typical of paint programs,
which treat images as collections of dots rather than as shapes. Within a computers
memory, a bit-mapped graphic is represented as an array (group) of bits that describe the
raj 36
MULTIPROCESSING SYSTEMS
Multiprocessing system : A mode of operation that provides for parallel processing by two or
more processors of a multiprocessor. It can be used for speedup and for improving and
throughput of computer systems. Potential benefits of multiprocessing include increased
performance and computing power, fault tolerance, flexibility and modular growth. One of the
main design challenges of multiprocessor systems is to minimize interprocessor interactions and
to provide an efficient mechanism for carrying them out when necessary.
Advantages of Multiprocessors : The main advantages of multiprocessors are : - 1).
Performance and computing power; 2). Fault tolerance; 3). Flexibility; 4). Modular
growth; 5). Functional specialization & 6). Cost/performance.
1). Performance and computing power: Significant speedup of an application may be
possible by devoting multiple processors to it. Problems with higher or more frequent
interprocessor interactions can be solved more quickly than in a distributed system
because the interprocessor communication bandwidth is higher.
2). Fault tolerance: The inherent redundancy in multiprocessors can be employed to
increase availability and to eliminate single points of failure.
3). Flexibility: A multiprocessor system can be made to dynamically reconfigure and
tailor itself so as to optimize different objectives for different application.
4).Modular growth: A modular system design can be adapted to the needs of a specific
installation by adding exactly the type of component most likely to alleviate a major
bottleneck.
5). Functional specialization: It processors can be added to improve performance of particular
applications.
6). Cost/performance: Off-the-shelf microprocessors with a cost performance ratio order of
magnitude below that of supercomputers may be structure into multiprocessors that are cost-
effective for a wide range of applications.
Multiprocessor Classification : Several classification of multiprocessor system are presented
here. First of all based on relationship between instructions & data. This is given by
Flynn(1966).In this basis computer system can be characterized as SISD, SIMD, MISD, &
MIMD.
SISD: Single instruction stream, single data stream. This category encompasses
conventional serial computers.
raj 37
SIMD: Single instruction stream, multiple data streams. These are typically vector
processors & array computers.
MISD: Multiple instruction stream, single data stream. This is seldom-used organization
in which multiple instructions operate on a single data stream in parallel.
MIMD: Multiple instruction stream, multiple data streams. Simultaneous execution of
multiple instructions that operate on data streams.
nd
2 based on relationship between processors & memory, multiprocessors can be classified
as Tightly coupled & Loosely coupled.
Tightly coupled: Multiprocessors contain globally shared memory that all processors
have access to.
Loosely coupled: Individual processors have private memories, & there is no shared
globally memory.
On the basis of memory architecture & access delays :- UMA & NUMA. Sometimes a third
category in this basis is called NORMA.
Multiprocessor Interconnections: The nature of the multiprocessor interconnections path
has a dominant influence on the bandwidth & saturation point for systems communications.
The basic architecture of a representative group of common multiprocessor types are : 1).
Bus-Oriented system; 2). Crossbar-connected systems; 3). Hypercubes; 4). Multistage
switch-based systems.
1. Bus-Oriented system : One of the simplest ways to construct a multiprocessor is to use a
shared bus to connect processors & memories. A multitude of processors can
communicate with each other & with the globally shared memory over a shared bus. Two
primary points of connection in shared bus systems are the shared bus itself & the shared
memory. (1) cache is associated with the shared memory, & processors access it over the
bus; (2) cache is associated with each individual processor.
The existence of multiple caches creates problems when shared writable data are cached. In this
case, cache coherence must be maintain so that multiple physical copies of single logical datum
are consistent with each other in the presence of update activity.
2. Crossbar-connected systems : The crossbar itself has no contention. It allows simultaneous
access of N processors to N memories, provided that each processor access a different memory.
Thus, the cross bar is antithesis of the bus. The cross point switch is the only sorce of delay
between a processor and a memory. If processors have no private memories , the resulting
system is a UMA multiprocessor.for example successive elements may be placed in successive
memory modules. The cross bar requires N square crosspoint switch is to fully connect N end
points to N other end points, such as processor and memory. The quadratic growth of its
complexity with the number of components makes cross bar expensive and limits the scalability
of the resulting system.
2. Hypercubes: Various cube type multiprocessor topologies address the scalability & cost
issues by providing interconnections whose complexsity grows logarithmically with the
increasing number of nodes. The system topology is a three dimensional hypercube, with
a node placed at each vertex. Hypercube have a number of interesting mathematical
properties. Hypercubes are recursive structures in the sense that higher dimensional
hypercubes contain the lower dimensional hypercubes as their proper subsets.
Hypercubes provide a good basis for scalable, since their complexity grows
logarithmically with the number of nodes.
raj 38
The serial portion of the program must be executed serially, so speedup is limited to the
parallel sections. This relationship was pointed out early on by Gene Amdahl s = 1/((1-f)
+f/k). where S is the speedup(s>1) relative to the standard case that resultd from
introduction of a k times faster component(k>1) i.e used a fraction of time f (F>1).
An example of Parallel programming: Matrix Multiplication
Program matrixmul; { parallel matrix multiplication}
Const N= ; { # of rows }
Var
I : integer; { private, in parents space}
A :array[1.. N,1..N] of integer;
[shared global variables]
b : array[1...N,1..N] of integer;
c : array[1..N,1..N] of integer;
done: semapher; {general}
process p_I(I : integer); { N such processes executed}
var
j,k,s : integer; {private local variables}
begin
for j := 1 to N do
begin
s:=o;
for k:=1 to Ndo s:=s+a[I,k]*b[k,j];
c[I,j]:=s
end; {for j}
signal(done)
end: {process P_I}
begin {parent-intialization}
done:=-(N); {needs N singles to become free}
for I := 1 to N do initiate p_i (i);
wait(done);
modification of data. *Data correctness is a more general notion than security, because it often
implies additional provisions such as reliability of data entry and freedom from error in
manipulation. As related to security, data availability is usually interpreted in the narrow sense of
providing freedom from the denial of service due to external influence. Security is a measure of
confidence in how well the stated goals are met.
Penetration attempts:- There are numerous ways and entry points in which penetration of
a computer system may be attempted. Some of the better-known ones are:- 1. Logged-on
terminal:- The terminal is left unattended by the user. An intruder can access the system with
full access to all data available to the legitimate user whose identity is assumed. 2.
Passwords:- passwords used to authenticate users may be obtained by intruders for the purposes
of illegal access in a number of ways, including guessing, stealing, trial and error, or knowledge
of vendor-supplied passwords used for systems generation and maintenance. 3. Browsing:-
often, users may be able to uncover information that they are not authorized to access simply by
browsing through the system files. In many systems there are files with improperly or overly
permissively set access controls. 4. Trop doors:- These are the secret points of entry without
access authorization. They are sometimes left by software designers, presumably to allow them
to access and possibly modify their programs after installation and production use.5. Electronic
eavesdropping:- This may be accomplished via passive or active wire-taps or by means of
electromagnetic pickup of screen radiation. 6. Computer worms:- These programs can invade
computers, usually via a network and deny service to legitimate users by using inordinate
amounts of processing and communication resources for self-propagation. 7. Computer
viruses:- Viruses are pieces of code that infect other programs and often perform harmful acts,
such as deletion of files or corruption of the boot block.
Security policies and mechanisms:- security policies specify what is desired in terms of
protection and security. Security mechanisms specify how to effect the security policies and
enforce them in a given system. *security policies:- security policies have probably
been around since the accumulation of the first valuables that needed guarding. They usually
encompass procedures and processes that specify: 1. How information can enter and
exit the system. 2. who is authorized to access what information and
under what conditions. 3. what are the permissible flows of information
within the system. * Additional limitations, such as restricting database
queries about too large or too small sets, can be imposed to reduce the danger of deducing data
by statistical interference. * Mechanisms:- security measures include control and
monitoring of physical access to the computer premises as well as the internal, computer-system
security . External or physical security includes the standard techniques of fencing, surveillance,
authentication, and attendance monitoring.
Authentication:- This section discusses one-way authentication of users. * The primary
goal of authentication is to allow access to legitimate system users and to deny access to
unauthorized parties. The two primary measures of authentication effectiveness are (1). The false
acceptance ratio, that is, the percentage of illegitimate users erroneously admitted, and (2) the
false rejection ratio, that is, the percentage of legitimate users who are denied access due to
failure of the authentication mechanism. One-way authentication is usually based on:-
1. Possession of a secret(password) 2.Possession of an artifact. 3. Unique
physiological or behavioral characteristics of the user. * Protection and access
control:- The original motivation for protection mechanisms came with the advent of
multiprogramming. The intent was to confine each users program to its assigned area of
memory and thus prevent programs from trespassing and harming each other. With the increased
desire for sharing of objects in primary and secondary memory, more complex mechanisms for
access control were devised. Protection in computer systems:- protection in primary storage is
usually adjunct to address translation. Its objective is to allow concurrent and potentially
raj 41
mutually suspicious resident processes to share the common physical address space, primary
memory. When the program is loaded, the limit or the bound registers are set to delineate the
extent of its legitimate address space. At run time, each memory reference is prechecked to
verify that it is within the bounds. Access-matrix model of protection:- The use of
seemingly quite different protection mechanisms for primary and secondary memory can
sometimes obscure the basic underlying issues and principles. This section introduces the access-
matrix model of protection, which serves as a useful abstraction for reasoning about protection
mechanisms in computer systems. Access Hierarchies:- A simple form of access hierarchy is
provided by the duel, user/supervisor, mode of operation found in many computer systems. In
that model, a restricted range of operations is available in the user mode, which is a default for
program execution. Access lists:- Access lists are one way of recording access rights in a
computer system. They are frequently used in file systems. In principle, an access list is an
exhaustive enumeration of the specific access rights of all entities that are authorized access to a
given object. *Formal models of protection:- The need for protection arises when
subjects share information. Isolation and separation of users facilitates protection. However, the
inability to share information denies some of the major benefits of computerized information
processing. The protection problem is exacerbated in situations when the service needs to
retain some of the users data, say, for statistical or accounting purposes. This problem is known
as the selective-confinement problem. Formal models of protection provide an apparatus
for precise formulation and for reasoning about the correctness and completeness of the various
security policies and mechanisms. In this section we describe four formal models of protection.
The first two models, the access-control matrix and take-grant, formalize protection
systems based on discretionary access control. The primary concern hare is the Trojan-horse type
of attack. The two other models, Bell-Lapadula and the lattice model, deal with flow control and
mandatory access control. *Cryptography:- One way to strengthen security in computer
systems is to encrypt sensitive records and messages in transit and in storage. The basic model of
a cryptography system is illustrated in fig. The original unenciphered text is called the plaintext
or the clear text. It can be encrypted using some encryption method parameterized by a key. The
result is called ciphertext.
intestines of infected humans and other vertebrates. Two major safeguards against computer
worms are:- 1. making penetration of each machine difficult. 2. Hindering worm
spreading. Computer viruses:- A computer viruses is code that attaches itself to other
programs in order to alter their behavior, often in a harmful way. A computer virus, like its
biological counterpart, cannot operate on its own and must enter a host program in order to be
activated. The existence of a computer virus typically encompasses four stages: 1. Dormancy.
2. Propagation. 3. Triggering. 4. Damage.