Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

UNIT-1

INTRODUCTION

Operating system is a program that manages the computer hardware. It also provides a basis for
application programs and acts as an intermediary between a user of a computer and the computer
hardware. An operating system is an important part of almost every computer system. A computer
system can be divided roughly into four components:
 The hardware – the central processing unit (CPU), the memory, and the input/output (I/O)
devices provides the basic computing resources.
 The operating system - controls and coordinates the use of the hardware among the various
application programs for the various users.
 Application programs – such as word processors, spreadsheets, compilers, and web
browsers define the way in which these resources are used to solve the computing problems
of the users.
 Users.

MAINFRAME SYSTEMS

Mainframe computer systems were the first computers used to tackle many commercial and
scientific applications.

1.Batch Systems
The user did not interact directly with the computer systems. They prepared a job which consisted
of the program, the data, and some control information about the nature of the job and submitted
it to the computer operator. After some days the output appeared. The output consisted of the result
of the program. The major task was to transfer control automatically from one job to next.
To speed up processing, operators batched together jobs with similar needs and ran them
through the computer as a group. Thus the programmers leave their programs with the operator.
The operator would sort programs into batches with similar requirements and, as the computer
became available, would run each batch. The output from each job would be sent back to the
appropriate programmer.

2.Multiprogrammed Systems

Multiprogramming increases CPU utilization by organizing jobs so that the CPU always has one
to execute.
The concept of multiprogramming is that the operating system keeps several jobs in memory
simultaneously. This set of jobs are kept in the job pool. The OS picks up and execute one of the
jobs in the memory.
 In non-multiprogramming system, the CPU would sit idle.
 In multiprogramming system, the OS simply switches to, and executes, another job. When
that job needs to wait, the CPU is switched to another job, and so on. The first finishes
waiting and gets the CPU back. As long a at least one job needs to execute, the CPU is
never idle.
Multiprogramming operating systems are used for decisions for the users. All the jobs that enter
the system are kept in the job pool. This pool consists of all processes residing on disk awaiting
allocation of main memory. If several jobs are ready to be brought into memory, and if there is not
enough room for all of them, then the system must choose among them. Making this decision is
job scheduling. If several jobs are ready to run at the same time, the system must choose among
them, this decision is CPU scheduling.

3.Time – Sharing Systems

Time sharing or multitasking is a logical extension of multiprogramming. The CPU executes


multiple jobs by switching among them, but the switches occur so frequently that the users can
interact with each program while it is running.
An interactive (or hands-on) computer system provides direct communication between the user
and the system. The user gives instructions to the operating system or to a program directly, using
a keyboard or a mouse, and waits for immediate results.
A time-shared operating system allows many users to share the computer simultaneously.
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 her use, even though it is being
shared among many users.
A time-shared operating system uses CPU scheduling and multiprogramming to provide
each user with a small portion of a time-shared computer. Each user has atleast one separate
program in memory. A program loaded into memory and executing is commonly referred to as a
process. When a process executes, it typically executes for only a short time before it either
finishes or needs to perform I/O.

DESKTOP SYSTEMS

Personal computers PCs appeared in the 1970s. During their first decade, the CPUs in PCs lacked
the features needed to protect an operating system from user programs. PC operating systems
therefore were neither multiuser nor multitasking. The MS-DOS operating system from Microsoft
has been produced multiple flavors of Microsoft Windows, and IBM has upgraded MS-DOS to
OS/2 multitasking system. UNIX is used for its scalability, performance, and features but retains
the same rich GUI. Linux, a UNIX operating system available for PCs, has also become popular
recently.
OS has developed for mainframes. Micro computers were able to adopt some of the
technology developed for larger OS. On the other hand, the hardware costs for micro computers
are sufficiently low that individuals have sole use of the computer, and the CPU utilization is no
longer a prime concern.
Earlier file protection was not necessary on a personal machine. But these computers are
now often tied into other computers over local-area networks or other Internet connections. When
other computers and other users can access the files on a PC, file protection becomes essential
feature of the operating system. The lack of such protection has made it easy for malicious
programs to destroy data on the systems such as MS-DOS and the Macintosh operating system.
These programs are self-replicating, and may spread rapidly via worm or virus mechanism.
MULTIPROCESSOR SYSTEMS
Multiprocessor systems have more than one processor or CPU. Multiprocessor systems also
known as parallel systems. Such systems have more than one processor in close communication,
sharing the computer bus, the clock, and sometimes memory and peripheral devices.

Advantages of the multiprocessor systems are:

1. Increased throughput: By increasing the number of processors, get more work done in
less time. When multiple processors cooperate on a task, a certain amount of overhead is
incurred in keeping all the parts working correctly.
2. Economy of scale: Multiprocessor systems can save more money than multiple singe-
processor systems, because they can share peripherals, mass storage, and power supplies.
If several programs operate on the same set of data, it is cheaper to store those data on one
disk and to have all the processors share them, than to have many computers with local
disks and many copies of the data.
3. Increased reliability: If functions can be distributed properly among several processors,
then the failure of one processor will not halt the system, only slow it down.
The most common multiple-processor systems now use symmetric multiprocessing (SMP), in
which each processor runs on identical copy of the OS, and these copies communicate with one
another as needed. Some systems use asymmetric multiprocessing, in which each processor is
assigned a specific task. A master processor controls the system, the other processors either look
to the master for instruction or have predefined tasks. This scheme defines a master-slave
relationship. The master processor schedules and allocates work to the slave processors.

Figure: Symmetric multiprocessing architecture

CPU CPU
CPU

memory
SMP means that all processors are peers, no master-slave relationship exists between processors.
Each processor concurrently runs a copy of the operating system. The benefit of this model is that
many processes can run simultaneously - N processes can run if there a N CPUs- without causing
a significant performance. Since the CPU are separate, one may be sitting idle while another is
overloaded, resulting in inefficiencies. A multiprocessor system will allow processors and
resources-such s memory to be shared among the various processors.

DISTRIBUTED SYSTEMS

A network, in the simplest terms, is a communication path between two or more systems.
Distributed systems depend on networking for their functionality. Distributed systems are able to
share computational tasks, and provide a rich set of features to users. Networks are typecast based
on the distance between their nodes.
 Local area network: exists within a room, a floor, or a building.
 Wide area network: exists between building, cities, or countries. A global company may
have a WAN to connect its offices, world wide.
 Metropolitan are network: could link buildings within a city.

1.Client – Server Systems:

client client client client

server

Terminals connected to centralized systems are now being supplanted by CPU. Centralized
systems today act as server systems to satisfy requests generated by client systems.
Server systems can be broadly categorized as compute servers and file servers.
 Compute-server systems: provide an interface to which clients can send requests to
perform an action, in response to which they execute the action and send back results to
the clients.
 File-server systems: provide a file-system interface where clients can create, update, read
and delete files.

2.Peer-to-Peer Systems

The growth of computer networks especially the Internet and WWW has a profound influence on
the recent development of OS. When PCs were introduced in 1970s they were developed as stand
alone systems, but with the widespread public use of the Internet in 1980s for electronic mail, ftp,
PCs became connected to computer networks.
Modern PCs and workstations are capable of running a web browser for accessing
hypertext documents on the web. The PCs now include software that enables a computer to access
the Internet via a local area network or telephone connection. These systems consist of collection
of processors that do not share memory or a clock. Instead each processor has its own local
memory. The processors communicate with another through various communication lines, such as
high speed buses or telephone line.
OS has taken the concept of network and distributed systems for network connectivity. A
network operating systems is an OS that provides features such as file sharing across the network,
and that includes a communication scheme that allows different processes on different computers
to exchange messages.
OPERATING SYSTEM STRUCTURES

An operating system may be viewed from several points.


1. By examining the services that it provides.
2. By looking at the interface that it makes available to users and programmers.
3. By disassembling, the system into its components and their interconnections.

OPERATING SYSTEM COMPONENTS:

The various system components are:


1. Process management
2. Main-memory management
3. File management
4. I/O-system management
5. Secondary-storage management
6. Networking
7. Protection system
8. Command-Interpreter system

1. Process Management
A Process is thought as a program in execution. A program does nothing unless its
instructions are executed by a CPU. Example, a compiler is a process, a word processing
program run by an individual user on a PC is a process, a system task, such as sending
output to a printer is also a process.
A process needs certain resources including CPU time, memory, files and I/O
devices to accomplish its task. These resources are either given to the process when it is
created or allocated to it while it is running. A program is a passive entity, such as the
contents of the file stored on disk, whereas a process is an active entity, with a program
counter specifying the next instruction to be executed. The execution of the process must
be sequential. The CPU executes one instruction of the process after another, until the
process completes.
A process is the unit of work in a system. Such a system consists of collection of
processes, some of which are operating system processes and the rest are user processes.

The OS is responsible for the following activities in process management:


 Creating and deleting both user and system processes
 Suspending and resuming processes
 Providing mechanisms for process synchronization
 Providing mechanisms for process communication
 Providing mechanisms for deadlock handling
2. Main-Memory Management

Main memory is a repository of quickly accessible data shared by the CPU and I/O
devices. The central processor reads the instructions from main memory during the
instruction fetch cycle, and it reads instructions from main memory during the data fetch
cycle.
The main memory is the only larger storage device the CPU able to address and
access directly. For a program to be executed, it must be mapped to absolute addresses
and loaded into memory. As the program executes, it accesses program instructions and
data from memory by generating theses absolute addresses. To improve the CPU
utilization and the speed of the computer’s response to its users, we must keep several
programs in memory.

The OS is responsible for the following activities in memory management:


 Keeping track of which parts of memory are currently being used and by whom
 Deciding which processes are to be loaded into memory when memory space
becomes available.
 Allocating and deallocating memory space as needed.

3. File Management

A File is a collection of related information defined by its creator. Files define programs
and data. Data files can be numeric, alphabetic and alphanumeric. Files may be of free
form, or may be formatted rigidly. A file consists of sequence of bits, bytes, lines or
records whose meanings are defined by their creators. Files are organized into directories
to ease of their use. Files can be opened in different modes to be accessed, they are :
read, write, append.

The OS responsibilities for the following activities for file management :


 Creating and deleting files
 Creating and deleting directories
 Supporting primitives for manipulating files and directories
 Mapping files onto secondary storage
 Backing up files on stable, nonvolatile storage media
4. I/O System Management

One of the purposes of an operating system is to hide the attributes and characters of
specific hardware devices for the user.

The I/O subsystem consists of:


 A memory-management component that includes buffering, caching, and
spooling
 A general device-driver interface
 Drivers for specific hardware devices

The device drivers alone know the characteristics of the specific device to which it is
assigned.

5. Secondary-Storage Management

The main purpose of the computer system is to execute the programs. These programs,
with the data they access, must be in main memory, or primary memory, during
execution. Because the main memory is too small to hold all the data and programs, and
as the data it holds is lost when the power is lost, the computer must provide secondary
storage to back up main memory. Programs such as compilers, assemblers, routines,
editors and formatters are stored in the disk until loaded into main memory.

The OS responsibility for the following activities for disk management:


 Free-space management
 Storage allocation
 Disk scheduling

6. Networking

A distributed system is a collection of processors that do not share memory, peripheral


devices, or a clock. Each processor has its own local memory and clock, and the processors
communicate with one another through various communication lines, such as high-speed
buses or networks. The processors in distributed system vary in size and function. They
include small micro-processors, workstations, minicomputers and large, general purpose
computer systems.
A distributed system collects physically separate, and many heterogeneous systems into a
single coherent system, providing user with access to the various resources that the system
maintains. The shared resources allows computation speedup, increased functionality,
increased data availability, and reliability.
Different protocols are used in the network system, such as file-transfer protocol (FTP),
Network file-system (NFS), hypertext transfer protocol (HTTP) , for use in
communication between a web server and a web browser. A web browser then just needs to
send a request for information to a remote machines web server. And the information is
returned.

7. Protection System

If a computer system has multiple users and allows the concurrent execution of multiple
processes, then the various processes must be protected from the other process.
Protection is any mechanism for controlling the access of programs, processes, or users
to the resources defined by a computer system. This mechanism must provide means for
specification of the controls to be imposed and means for enforcement.
Protection can improve reliability by detecting latent errors at the interfaces between
component subsystems. Early detection of interface errors can often prevent contamination of
a healthy subsystem by another subsystem. Unprotected system can be used by unauthorized
users.

8. Command-Interpreter System

Command interpreter is an interface between the user and the operating system. Many
commands are given to the operating system by control statements. When a new job is started
in a batch system, or when a user logs on to a time-shared system, a program that reads and
interprets control statement is executed automatically. This program is sometimes called the
control card interpreter or command-Interpreter, and is often known as the shell. Its
function is to get the next command statement and execute it.

OPERATING SYSTEM SERVICES

An operating system provides an environment for the execution of programs. It provides


certain services to programs and to the users of those programs.
The various services offered by Operating system are:
 Program execution: The system may be able to load a program into memory and to
run that program. The program must be able to end its execution, either normally or
abnormally indicating the error.
 I/O operations: A running program may require I/O. This I/O may involve a file or an
I/O device. For security and efficiency users usually cannot control I/O devices
directly, operating system must be provided to do it.
 File-system manipulation: The files needs programs to read and write files. Programs
also need to create and delete files by names.
 Communications: One process needs to communicate with another process. Such
communication may occur in two ways:
o Communication takes place between processes that are executing on the same
computer.
o Takes place between processes that are executing on different computer
systems that are tied together by a computer network. Communications may be
implemented via shared memory, or by the technique of message passing, in
which packets of information are moved between processes by the operating
system.

 Error detection: The operating system constantly needs to be aware of possible errors.
Errors may occur in :
o the CPU and memory hardware-memory error or power failure.
o I/O devices-such as parity error on tape, a connection failure on network, or
lack of paper in the printer.
o User program-an arithmetic overflow, an attempt to access an illegal memory
location, or too great use of CPU time.

 Resource allocation: When multiple users are logged on the system, multiple jobs are
running at the same time, resources must be allocated to all of them. Many different
types of resources are managed by the operating system. Some are CPU cycles, main
memory, and file storage may have special allocation code, and I/O devices may have
general request and release code.
 Accounting: Os must keep track of which users use how many and which kinds of
computer resources.
 Protection: The owners of the information stored in a multiuser computer system may
want to control use of the information. When several processes are executed
concurrently, one process should not interfere with the other process. Security of the
system from outsiders is also important. Such security starts with each user having to
authenticate himself to the system , usually by means of a password, to be allowed
access to the resources.

You might also like