Prepared By:
Reema Agrawal
Asst Professor
MERI
Operating System
Operating System is a software, which makes a
computer to actually work.
The OS organizes and controls the hardware.
A program that controls the execution of application
programs
An interface between applications and hardware
Examples: Windows, Linux, Unix and Mac OS,
etc.,
Objectives Of Operating System
The two primary objectives are:
1. Makes a computer system easier to use: Provides a
convenient interface for using a computer system.
It acts as an intermediate between the system and
users.
2. Manages the resources of a computer system:
Keeps track of who is using what resources, granting
resource requests etc.
Structure Of Operating System
Structure Of Operating System
The structure of OS consists of 4 layers:
1. Hardware
Hardware consists of CPU, Main memory, I/O
Devices, etc,
2. Software (Operating System)
Software includes process management routines,
memory management routines, I/O control
routines, file management routines.
Structure Of Operating System
3. System programs
This layer consists of compilers, Assemblers,
linker etc.
4. Application programs
This is dependent on users need.
Types Of Operating System
Real Time O.S
Multi User or Time sharing O.S
Multitasking or Multiprogramming
Distributed
Batch Processing
Multiprocessor O.S
Embedded O.S
Real Time Operating System
Designed to respond to an event within a predetermined
time.
The time taken by the system to respond to an input and
display of required updated information is termed as
response time.
They respond quickly.
For example: Scientific experiments, medical imaging
systems, industrial control systems, weapon systems,
robots, and Air traffic control system etc.
Multi User or Time Sharing O.S
(Preemptive or Non-Preemtive)
Theses allow different users to access the same data
and application programs on the same network.
It has many user terminals connected to the same
computer simultaneously.
The short period during which a user process gets to
use CPU is known as time slot or time slice or
quantum and is between 10 to 100 milliseconds.
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.
•As a process executes, it changes state.
•New: The process is being created.
•Running: Instructions are being executed.
•Waiting: The process is waiting for some event to occur.
•Ready: The process is waiting to be assigned to a processor.
•Terminated: The process has finished execution.
Multitasking or Multiprogramming:
• It allows more than one program to be running at the
same time.
• Example: A user can work both on word processing
application and an audio CD player running at the
same time.
In this the operating system, picks and begins to
execute one job from memory.
Once this job needs an I/O operation operating system
switches to another job.
If several jobs are ready to run at the same time, then
system chooses which one to run
In Multiprogramming system, CPU will never be idle
and keeps on processing.
When one job needs to wait for I/O, the processor can switch to the
other job
Distributed
This system manages a group of independent
computers and makes them appear to be a single
computer.
Batch Processing
This was the first operating system that evolved.
Allows one program to run at a time.
In Batch processing same type of jobs batch
(BATCH- a set of jobs with similar needs) together
and execute at a time.
Common Example is of creating payrolls of
employees
A list of employees will be entered and their monthly salaries will be
calculated and corresponding pay slips would be printed. Batch
processing is useful for this purpose since these procedures are to be
repeated for every employee and each month.
Producing monthly bank statements to send out to customers
Multiprocessor Operating System
Capable of supporting and utilizing more than one
computer processor within a single computer system.
More than one CPU can be shared.
Eg- UNIX, LINUX
It is used to do multiple jobs in less time.
Embedded Operating System
It is embedded and specially configured for a certain
hardware configuration.
Used for hardware that have little RAM/ROM and a
slow CPU
Example: Android in Mobile phones, Blackberry phones
with blackberry O.S, Traffic lights, ATM, elevators etc.
Functions Of Operating System:
The functions performed by operating system are:
1. Process Management
2. Memory Management
3. File Management
4. Security
Process Management
A process is a program in execution.
Process Management manages the processes submitted to a
system in a manner to minimize idle time of processors of
the system.
Time can be minimized by:
Real Time O.S
Multi User or Time sharing O.S
Multitasking or Multiprogramming
Distributed
Batch Processing
Multiprocessor O.S
Embedded O.S
Memory Management
Memory management is the functionality of an
operating system which handles or manages primary
memory.
It keeps track of which parts of memory are in use and
which are free.
It decides which process will get memory at what time.
It also allocates memory to processes when they need
it and de-allocates when they no more need.
Different Ways Of Memory
Management:
Uniprogramming Memory Model:
• It is used in systems that process one job only at a
time.
• One part of memory is used by operating system and
its remaining part is available for use by the currently
active user process.
• Certain part is still left out from usage. It is not
properly utilized.
Uniprogramming:
Multiprogramming:
Multiple programs need to resign in main memory
It can be of 2 types:
a. Multiprogramming with fixed number of memory
partitions
b. Multiprogramming with variable number of memory
partitions
Multiprogramming with Fixed Number
Of Memory Partitions
Memory is divided into fixed partitions.
Size of each partition is fixed
Each partition has only one process
Any space in the partition is left out or is in excess of
actual memory requirement of the process loaded into
it, it remains unused
Hence now it is not used
Multiprogramming with Variable
number of memory partitions
Due to under utilization of memory resources the
variable number of partitions came into use.
Here the size of partition size vary as the processes
enter and exit the system.
Virtual Memory
If your computer lacks the random access memory
(RAM) needed to run a program or operation,
Windows uses virtual memory to compensate.
Virtual memory combines your computer’s RAM with
temporary space on your hard disk.
File Management
All file related activities are taken care of.
File Operations
a. Create
b. Delete
c. Open
d. Close
e. Read
f. Write
g. Copy
h. Rename
File Naming: A name is given to a file with an
extension for accessing it.
.c
.txt
.doc
.xls
.ppt
.jpg
Security
Deals with protecting various resources and
information of a computer system against destruction
and unauthorized access.
Security includes:
a. User authentication: Physical access to a computer.
Eg: Passwords, biometric devices etc.
b. Access Control: Since a computer is used by many
users. Hence restriction is made on certain
information or resources which is not meant for
users.
c. Cryptography: Encrypting data in form of certain
codes which is not understandable by any third party
for its misuse.