0% found this document useful (0 votes)
29 views10 pages

UNIT-1 OS Final

Uploaded by

Debasis mishra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views10 pages

UNIT-1 OS Final

Uploaded by

Debasis mishra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

UNIT-1

INTRODUCTION:
 Operating system is a system software that acts as an intermediary between the user of a
computer and computer hardware.
 It is considered as the brain of the computer.
 It controls the internal activities of the comp. hardware and provides the user interface.
 This interface enables a user to utilize the hardware resources very efficiently.
 It is the first program that gets loaded into the computer memory through the process
called “booting”.
COMPONENTS OF COMPUTER SYSTEM:
In general we can divide a computer system into the following four components.
 Hardware
 Operating system
 Application programs
 Users

 As we can see in the figure the user interacts with the application programs.
 The application program do not access the hardware resources directly.
 HARDWARE resources include I/O devices, primary memory, secondary memory(hard
disk, floppy disk etc.)and the microprocessor.
 So the os is required to access and use these resources.
 The application programs are programmed in such a way that they can easily
communicate with the resources.
 An os is the first program that is loaded into into the computers main memory, when a
computer is switched on.
 Some popular os are windows9x(95,98), Linux, Unix, Windows xp.vista etc.

1|Page
OBJECTIVES OF OS:
OS has three main objectives.
 Convenience: An OS makes a computer system convenient and easy to use, for the user.
 Efficiency: An OS allows the computer to use the computer hardware in an efficient
way, by handling the details of the operations of the hardware.
 Ability to Evolve: An OS should be constructed in such a way as to permit the effective
development, testing, and introduction of new system functions without at the same time
interfering with service.

NEEDS AND SERVICES OF OS/ FUNCTIONS OF OS


Os performs a number of functions for the computer system that are follows:
1) It acts as an Command Interpreter:
 Generally the cpu cannot understand the commands given by user. It is the
function of os to translate this command(human understandable ) into m/c
understandable instructions that the system (cpu) can understand.
 After the execution of instructions by cpu, it retranslates the o/p back into a
human understandable language.
 To execute the user jobs , the os interacts with the computer hardware.
2) It acts as the Resource Manager:
 An os acts as a resource manager in two ways
 Time multiplexing
 Space multiplexing

 In time multiplexing the different resources (hardware or software) can be


shared among different users for a optimal or fixed time slot.
 e.g. the os allocates a resources such as cpu to program A for a fixed time slot.
When the time slot of process A is over, the cpu is allocated to another program
B. If program A needs more cpu attention, then the cpu again allocated to
program A after the time slice period allocated to program B is over.
 In space multiplexing, different resources are shared at the same time among
different programs .e.g. sharing of hard disk and main memory by different
users at the same time.
3) Memory Management:
 It keeps track of the resources (memory),what part of memory is in use and by
whom, which part of the memory is not in use.
 Decides which processes are to be loaded when memory space is available.
 Allocation and de allocation of memory
4) Process Management:
 A process(task) is an instance of a program in execution. A program is just a
passive entity, but a process is an active entity.
 To accomplish its task ,a process needs certain resources like cpu time, memory,
files and I/O devices.
 These resources are allocated to process either at the time of creation or when it is
executing.

2|Page
 The OS is responsible for the following functions related to process management.
i. Process creation (loading the prog. From secondary storage to main
memory)
ii. Process scheduling
iii. Provide mechanism for process synchronization
iv. Provide mechanism for deadlock handling
v. Process termination
5) Peripheral or I/O device Management:
 Keep track of resources (device, channels, control units) attached to the system.
 Communication between these devices and cpu is observed by OS.
 An OS will have device drivers to facilitate I/O functions involving device like
keyboard, mouse, monitor, disk, FDD, CD-ROM, printer etc.
 Allocation and De allocation of resources to initiate I/O operation.
 Other management activities are
i. Spooling
ii. Caching
iii. Buffering
iv. Device driver interface
6) File Management:
 A file is a collection of related information or record defined by the user.
 The OS is responsible for various activities of file management are
i. Creation and deletion of files
ii. Creation and deletion of directories
iii. Manipulation of files and directories
iv. Mapping files onto secondary storage
7) Secondary storage Management:
 It is a larger memory used to store huge amount of data. Its capacity is much
larger than primary memory. E.g. floppy disk, hard disk etc.
 The OS is responsible for handling all the devices that can be done by the
secondary storage management.
 The various activities are:
i. Free space management
ii. Storage allocation(allocation of storage space when new files have to be
written).
iii. Disk scheduling(scheduling the request for memory access)
8) Protection/Security Management:
 If a computer system has a multiple processor then the various processes must be
protected of one another’s activities.
 Protection refers to mechanism for controlling user access of programs or
processes or user to resources defined by the computer system.
9) Error detection and Recovery:
 Error may occur during execution like divide by zero by a process, memory
access violation, deadlock, I/O device error or a connection failure.
 The os should detect such errors and handles them.

3|Page
CLASSIFICATION / TYPES OF OS
All os consists of similar component and can perform all most similar function but the method
and procedure for performing these functions are different.
OS are classified into different categories according to their different features. The
following section will discuss the classification of OS.

Single user OS:


 In a single user OS a single user can access the computer at a particular time.
 This system provides all the resources to the user at all the time.
 The single user os is divided into the following types.
 Single user, single tasking os
 Single user , multitasking os
Single user, single tasking os:
 In a single user, single tasking OS, There is a single user to execute a program at a
particular system.
 Example – MS-DOS
Single user , multitasking os
 In single user, multitasking OS a single user can execute multiple programs.
 Example – A user can program different programs such as making calculations in excel
sheet, printing a word document & downloading into the file from internet at the same
time.

USER Application Programs

Operating System

Hardware

Advantage:
 The CPU has to handle only one application program at a time so that process management
is easy in this environment.
Disadvantage:
 As the OS is handling one application at a time most of the CPU time is wasted.
Multi user OS:
 In a multi-user os , multiple number of users can access different resources of a computer
at a time.
 This system provides access with the help of a network. Network generally consists of
various personal computers that can and receive information to multi user mainframe
computer system.

4|Page
 Hence, the mainframe computer acts as the server and other personal computer act as the
client for that server.
 Ex: UNIX, Window 2000
Advantage:
Sharing of data and information among different user.
Disadvantage:
Use of expensive hardware for the mainframe computer.
Batch Operating System
 In a batch processing operating system interaction between the user and processor is
limited or there is no interaction at all during the execution of work.
 Data and programs that need to be processed are bundled and collected as a ‘batch’.
 These jobs are submitted to the computer through the punched card. then the job with
similar needs executed simultaneously.
Advantage:
It is simple to implement.
Disadvantage:
Lack of interaction between user and the program.
Multiprogramming OS:
 In a multiprogramming os several user can execute
multiple jobs by using a single cpu at the same time.
 The os keeps several program or job in the main
memory.
 When a job is submitted to the system in a magnetic
disk or job pool.
 Then some of the jobs are transferred to the main
memory according to the size of the main memory.
 The cpu execute only one job which is selected by the
os.
 When the job requires any I/O operation, then cpu
switches to next job in the main memory i.e cpu do not have to wait for the completion of
I/O operation of that job.
 When the I/O operation of that job is completed then the cpu switches to the next job
after the the execution of the current job.
 E,g.UNIX, Windows 95 etc

Advantage:
Cpu utilization is more i.e the most of the time the cpu is busy.
Disadvantage:
The user can’t directly interact with the system.
Time sharing OS:
 This is the Logical extension of multiprogramming system.
 The CPU is multiplexed among several jobs that are kept in memory and on disk (the
CPU is allocated to a job only if the job is in memory).

5|Page
 Here the cpu can execute more than one job simultaneously by switching among
themselves.
 The switching process is very fast so that the user can directly interact with the system
during the execution of the program.
 This system stores multiple jobs in the main memory and cpu execute all the jobs in a
sequence.
 Generally cpu time is divided into no. of small interval known as time slice period.
 Every process has to execute for the time slice period; then the cpu switch over to next
process.
 The switching process is very fast,so it seems that several processes are executed
simultaneously.

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.
Advantage:
 Cpu utilization is more i.e the most of the time the cpu is busy.
Disadvantage:
 The OS is more complex due to memory management, Disk management etc.

Multitasking OS:
 A multi-tasking operating system allows
more than one program to be running at
the same time.
 E.g.-one user can open the word
document and can simultaneously access
the internet.
 While the processor handles only one
application at a particular time it is
capable of switching between the
applications effectively to apparently simultaneously execute each application.
 This type of operating system is seen everywhere today and is the most common type of
OS, the Windows operating system would be an example.

6|Page
Multiprocessing OS:
 When a system contains more than one processor in close communication, sharing the
computer bus, the clock and sometimes memory and peripheral devices is known as
multiprocessing os.

 This is divided into 2 types:


 Symmetric multiprocessing system
 Asymmetric multiprocessing system
Symmetric multiprocessing (SMP)
 Each processor runs a shared copy of the OS.
 Different processor can communicate with each other and are able to execute this
copy at the same time.
 These processor are executed by a single os and have equal right to access all the
I/O devices connected to the system.
Asymmetric multiprocessing(ASMP)
 It is based upon the principle of master slave relationship.
 In this system one processor runs the os and other processor run the user
processes.
 The processor which runs the os is known as master processor the processor
which runs the user processes known as the slave processor.
 It is used in large system.
 Each processor is assigned a specific task; master processor schedules and
allocated work to slave processors.
 More common in extremely large systems

Advantage:
 Improved Reliability:-As the system consists of multiple processor, failure of one
processor does not disturb the computer system. The other processor in the system
continues the task.
 Improved throughput:-throughput is defined as the total no of jobs which are excuted
by the cpu in one second. As this system use multiple processor allthe workload divided
between the different processor.
 Economical:-in this system different processor share the clock, bus, peripheral and
memory between them. Due to this reason the system are more economical than multiple
single processor system.

7|Page
Real time OS:
 In a real-time operating system a job is to be completed within the right time constraint
otherwise job loses its meaning.
 These system compete a particular job in the fixed time slot in order to respond to an
event quickly.
 Real time introduces for correct operation and it required to produce result within a non
negotiable time period.
 Real-time systems are usually used to control complex systems that require a lot of
processing like machinery and industrial systems.

 This is of 2 types:
 Hard real time OS
 Soft real time OS

Hard real-time system:


 This system completes the critical tasks within the definite interval of time constraint.
 If the critical task is not completed within the time constraint, then the system fails.
 This system has to complete all the processes within the definite deadline and a single
miss leads to critical failure.
 E.g.:-Pace maker, flight control system( any miss in deadline leads to crash).
Soft real-time system:
 These systems are not affected by the lapse of time interval and do not cause any critical
failure.
 E.g.:-Live video streaming.
Distributed OperatingSystems:
 In distributed OS , the users access remote resources in the same way as the local
resources are accessed.
 Distribute the computation among several physical processors.
 Loosely coupled system – each processor has its own local memory; processors
communicate with one another through various communications lines, such as high-
speed buses or telephone lines.
 These systems provide features such as data and process migration.
 This OS based on two models.
 Client-server model
 Peer –to-peer model

Client-server model:-In this model, the client


sends a request for a resource to the server and
the server, in turn provides the requested
resource as a response back to the client.

8|Page
Peer –to-peer model: In a peer-to-peer model,all the computers
behave
as peers as well as clients. These peers communicate with each other for
exchange of their resources.

Advantages:
 It facilitates the sharing of hardware and software resources between different processors.
 It increases reliability as failure of one node does not affect the entire network.
 It increases the computational speed of computer by sharing the workload into different
nodes.
 It enable different users to communicate with each other using email.

Structure of Operating System

The structure of Operating System comprises of 4 layers.


 Hardware
 Kernel
 System call interface(shell)
 Application programs
Kernel:
 It is the vital part of the OS. It interacts directly
with the hardware of a computer.
 Programs interact with the kernel through 10
system calls.
 System call:- The system call provides an
interface to the operating system services.
 System call tells the kernel to carry out various
asks for the program such as opening a file,
writing to a file, obtaining information about a
file, executing a program, terminating a process etc.
 The main function of the kernel are
 To manage computer memory
 To maintain file system
 Allocation of resources
 Control access to the computer
 Handle interrupts
System Call Interface(Shell):
 Shell is command line interpreter which interprets the commands given by the user.
 It is software or program which acts as a mediator between kernel and user.

9|Page
 The shell read the commands, what you typed at command line and interprets them
and sends request to execute a program. That’s why shell is called as command line
interpreter.
Hardware:
 Computer hardware refers to the physical parts or components of a computer such as
the monitor, mouse, keyboard, computer data storage, hard drive disk (HDD), system
unit (graphic cards, sound cards, memory, motherboard and chips), etc. all of which
are physical objects that can be touched

Utility and application programs:


 Utility programs help manage, maintain and control computer resources. These
programs are available to help you with the day-to-day chores associated with
personal computing and to keep your system running at peak performance.
 Application software is all the computer software that causes a computer to perform
useful tasks beyond the running of the computer itself.
 Examples of application programs include word processors; database programs; Web
browsers; development tools; drawing, paint, and image editing programs; and
communication programs.

Evolution of Operating system:


1. Serial operating system.
2. Batch operating system.
3. Multiprogramming operating system.
4. Time-Sharing operating system.
5. Real-Time operating system.
6. Multiprocessing operating system
7. Distributed operating system

10 | P a g e

You might also like