UNIT - I
UNIT - I
Chapter – 1
Introduction to Operating System
1. It provides user interface in the form of command line interface (CLI), batch
interface and graphical user interface (GUI).
2. It supports program execution by loading the contents of program file into memory.
3. System provides I/O resources that may include files and I/O devices required by a
running program.
4. It supports file-system manipulation. There are many operations that are performed
for file creation, deletion, allocation, and naming.
5. It performs communications by message passing between systems that require
messages to be turned into packets of information, sent to the net-work controller,
transmitted across a communications medium, and reassembled by the destination
system.
6. It supports error detection: Error detection occurs at both the hardware and software
levels. At the hardware level, all data transfers must be inspected to ensure that data
have not been corrupted in transit. At the software level, media must be checked for
data consistency.
7. Computer system supports accounting of computers that keep track at which users
use how much and what kind of computer resources.
8. System allocates and deallocates resources to the process. When there are multiple
users or multiple jobs running at the same time, resources must be allocated to each of
them code.
9. It provides protection and security for owners of information stored in multiuser or
networked computer system may want to control use of the information in the form of
password or access permissions.
A clustered system is a collection of connected computers working together as one unit. In this
system, any member of the cluster is capable of supporting the processing functions of any other
member. Each computer in a cluster is referred to as a node.
Characteristics:-
Clustering allows two or more system to share storage closely linked via a local area network.
A cluster has a redundant n+k configuration, where n processing nodes are actively processing the
application and k processing nodes are in a standby state, serving as peers. In the event of a failure of
an active node, the application that was running on the failed node is moved to one of the standby
nodes. The simplest redundant configuration is active/standby, in which one node is actively
processing the application and the other node is in a standby state.
Other common cluster configurations include simplex (one active node, no spare), n+1 active
nodes (n active nodes, 1 spare), and nactive nodes. In a configuration with n active nodes, the
applications from the failed node are redistributed among the other active nodes using a pre-specified
algorithm.
It provides excellent fault tolerance.
Describe first generation of operating system with its advantages and disadvantages.
With neat diagram, explain real time system. List its any four application.
A real time system has well defined fixed time constraints. Processing should be done
within the Defined constraints.
Types of real time system
Hard and Soft real time system.
Satellite Application of real time OS: Satellite application of real time OS The satellite
connected to the computer system sends the digital samples at the rate of 1000 samples
per second. The computer system has an application program that stores these samples in a file. The
sample sent by the satellite arrives every millisecond to the application. So computer must store or
respond the sample in less than 1 millisecond. If the computer does not respond to the sample within
this time, the sample will lost.
Applications:
1. Flight Control System
2. Simulations
3. Industrial control
4. Military applications
Disadvantages:
The computers were very larger in size
They consumed a large amount of energy.
They heated very soon due to thousands of vacuum tubes.
They were not very reliable.
Air conditioning is required.
Constant maintenance was required.
Not-portable.
Costly commercial production.
Very slow speed.
Limited programming capabilities.
Used machine language only.
Used punch card for input.
Not versatile and less accurate.
Multiprogramming organizes jobs (code and data) so CPU always has one to execute.
• A subset of total jobs in system is kept in memory.
• One job selected and run via job scheduling.
• When it has to wait (for I/O for example), OS switches to another job.
Multiprogramming is a technique used to utilize maximum CPU time by running multiple programs
simultaneously. The execution begins with the first program and continues till an instruction waiting
for a peripheral is reached, the context of this program is stored, and the second program in memory
is given a chance to run. The process continued until all programs finished running.
Multiprogramming has no guarantee that a program will run in a timely manner. Usually on a
mainframe - the computer has a number of programs loaded into memory and the operating system
switches quickly between them, processing a little bit of each one in turn. The high speed of the
processor makes it seem like more than one program is being run at the same time. On a PC it is
usually called multitasking. If the machine has the capability of causing an interrupt after a specified
time interval, then the operating system will execute each program for a given length of time, regain
control, and then execute another program for a given length of time, and so on. In the absence of
this mechanism, the operating system has no choice but to begin to execute a program with the
expectation, but not the certainty, that the program will eventually return control to the operating
system. If the machine has the capability of protecting memory, then a bug in one program is less
likely to interfere with the execution of other programs. In a system without memory protection, one
program can change the contents of storage assigned to other programs or even the storage assigned
to the operating system. The resulting system crashes are not only disruptive, they may be very
difficult to debug since it may not be obvious which of several programs is at fault. If memory can
hold several programs, then CPU can switch to another one whenever a program is awaiting for an
I/O to complete.
In above figure, the user 5 is active but user 1, user 2, user 3, and user 4 are in waiting state whereas
user 6 is in ready status.
Advantages:
Increased throughput: Increase in number of processors requires less
time for more work. Number of processes completing their task for a
particular duration is more.
Economy of scale: Cost is less than multiple single processor systems.
If several programs operate on the same set of data, then it is cheaper
to store those data on one disk and to have all the processors share
them.
Increase reliability: Functions can be distributed properly among
several processors and then the failure of one processor will not halt
the system.
Explain distributed Operating System with advantages and disadvantages
A distributed system consists of a collection of autonomous
computers, connected through a network and distribution
middleware, which enables computers to coordinate their activities
and to share the resources of the system, so that users perceive the
system as a single, integrated computing facility.
In such system the processors do not share memory or a clock;
instead each processor has its own local memory.
In such systems, if one machine or site fails the remaining sites can
continue operation.
So these types of systems are the reliable systems.
The processors communicate with one another through various
communications lines, such as a high speed buses or telephone lines.
These systems are usually referred to as Loosely Coupled Systems or
Distributed Systems
The structure shown in figure contains a set of individual computer
systems and workstations connected via communication systems.
By this structure we cannot say it is a distributed system because it is
the software, not the hardware, that determines whether a system is
distributed or not.
The users of a true distributed system should not know, on which
machine their programs are running and where their files are stored.
Advantages:
With resource sharing facility, a user at one site may be able to use
the resources available at another.
Speedup the exchange of data with one another via electronic mail.
If one site fails in a distributed system, the remaining sites can
potentially continue operating.
Better service to the customers.
Reduction of the load on the host computer.
Reduction of delays in data processing.
Disadvantages:
Security problem due to sharing
Some messages can be lost in the network system
Bandwidth is another problem if there is large data then all network
wires to be replaced which tends to become expensive
Overloading is another problem in distributed operating systems
If there is a database connected on local system and many users
accessing that database through remote or distributed way, then
performance become slow
The databases in network operating is difficult to administrate then
single user system
Describe multiprogramming and multitasking.
Multiprogramming: In multiprogramming, more than one program lies in the memory.
The scheduler selects the jobs to be placed in ready queue from a number of programs. The
ready queue is placed in memory and the existence of more than one program in main
memory is known as multiprogramming. Since there is only one processor, there multiple
programs cannot be executed at a time. Instead the operating system executes part of one
program, then the part of another and so on. Example of multiprogramming: user can open
word, excel, access and other applications in a system.
Multitasking:
A multitasking operating system is any type of system that is capable of running more than
one task at a time. It also maintains the synchronization between I/O devices and processes
so that user can use different application in background and current application in
foreground. In multitasking the resources are made continuously working. The CPU
switches from one task to another for reading and processing. Thus idle time of peripherals
gets reduced. In multitasking Operating System the code as well as data of several
processes is stored into main memory. For example, when you are printing a document of
100 pages, you can do other jobs like typing a new document. So, more than one task is
performed.
Explain time sharing operating system and state its advantages and disadvantages.
The main idea of time sharing systems is to allow a large number of users to interact
with a single computer system concurrently. In time sharing system, the CPU executes
multiple jobs by switching among them. The switches occur so frequently that the users
can interact with each program while it is running.
A time sharing system allows many users to share the computer resources
simultaneously. Since each action or command in a time shared system tends to be short,
only a little CPU time is needed for each user. As the system switches rapidly from one
user to the next, each user is given the impression that the entire computer system is
dedicated to his use, even though it is being shared among many users. The time sharing
systems were developed to provide an interactive use of the computer system.
Most time sharing systems use time-slicing (Round Robin) scheduling. A program
executing longer than the system defined time slice is interrupted by the operating system
and place at the end of the queue of waiting programs for execution.
In above figure the user 5 is active but user 1, user 2, user 3, and user 4 are in waiting state
whereas user 6 is in ready status. As soon as the time slice of user 5 is completed, the
control moves on to the next ready user i.e. user 6. In this state user 2, user 3, user 4, and
user 5 are in waiting state and user 1 is in ready state. The process continues in the same
way and so on.
Advantages of Time Sharing System
Each user can get CPU time.
Efficient CPU utilization.
Time sharing systems were developed to provide interactive use of a computer
system at a reasonable cost.
A time shared operating system uses CPU scheduling and multi programming to
provide each user with a small portion of a time-Shared Computer.
Disadvantages of Time Sharing System:
The time-shared systems are more complex than the multi-programming systems.
Context switching occurs frequently. i.e. Multiple processes are managed
simultaneously which requires an adequate management of main memory so that
the processes can be swapped in or swapped out within a short time.
The structure shown in figure contains a set of individual computer systems and
workstations connected via communication systems. By this structure we cannot say it is a
distributed system because it is the software, not the hardware, that determines whether a
system is distributed or not. The users of a true distributed system should not know, on
which machine their programs are running and where their files are stored.
Describe real time system. State any one example of its application.
A real time system has well defined fixed time constraints. Processing should be done
within the defined constraints.
A primary objective of real-time systems is to provide quick event response time and thus
meet the scheduling deadlines.
Types of real time system:
1. Hard real time:-Hard real time means strict about adherence to each task deadline.
When an event occurs, it should be serviced within the predictable time at all times in a
given hard real time system.
2. Soft real time:-Soft real time means that only the precedence and sequence for the task
operations are defined, interrupt latencies and context switching latencies are small.
There can be few deviations between expected latencies of the tasks and observed time
constraints and a few deadline misses are accepted.
Example – Flight Control System
All tasks in that system must execute on time.
Example: Satellite application of real time OSThe
satellite connected to the computer system sends the digital samples at the rate of 1000
samples per second. The computer system has an application program that stores these
samples in a file. The sample sent by the satellite arrives every millisecond to the
application. So computer must store or respond the sample in less than 1 millisecond. If the
computer does not respond to the sample within this time, the sample will lost. Some of the
examples of Real time systems are: A web server, A word processor, An audio/video
media center, A microwave oven, A chess computer.
Define UNIX operating system.
Unix is a portable, multitasking, multiuser, time sharing operating system originally developed in
1969 by a group of employees at AT& T.
The Unix operating system is a set of programs that act as a link between the computer and the
user. The computer programs that allocate the system resources and coordinate all the details of
the computer's internals is called the operating system or the kernel.
Users communicate with the kernel through a program known as the shell. The shell is a
command line interpreter; it translates commands entered by the user and converts them into a
language that is understood by the kernel
Applications:
1. Flight Control System
2. Simulations
3. Industrial control
4. Military applications
Explain Batch Monitoring functions. 4
A batch operating system normally reads a stream of separate jobs (from a card reader. For
example,), each with its own control cards that predefine to prevent errors and improper use of
the computer. It is concerned with the operation and control if I/O devices.
A batch system is one in which jobs are bundled together with the instruction necessary to allow
them to be processed without intervention. Often jobs of a similar nature can be bundled together
to further increase economy.
Common input devices were card readers and tape drives. The basic physical layout of the
memory of batch job computer is shown in fig.
The OS was simple; its major task was to transfer control from one job to the next. The job was
submitted to the computer operator in form of punch cards. At some later time, the output
appeared.
The OS was always resident in memory. Often magnetic tapes and drums were used to store
intermediate data and compiled programs.
Example: Payroll system, stock control and billing systems.