Chapter5OperatingSystem 1 1
Chapter5OperatingSystem 1 1
Chapter5OperatingSystem 1 1
Instructor:
Rachana Nyaichyai
WHAT IS AN OPERATING
SYSTEM?
❖ A type of system control program that manages the resources
of the computer system and controls execution of user
program.
❖ An Operating System (OS) is an interface between a
computer user and computer hardware. An operating system
is a software which performs all the basic tasks like file
management, memory management, process management,
handling input and output, and controlling peripheral
devices such as disk drives and printers.
1
WHAT IS AN OPERATING
SYSTEM?
❖ An operating system commonly referred to as
OS is an integrated set of programs that
controls resources such as memory, I/O
devices, CPU etc. of a computer system and
provides its users with an interface or virtual
machine that is easier to use than real
machine.
❖ It provides a basis and execution environment
for application programs.
❑ Uniform abstract representation of resources that
can be requested and accessed by applications
i.e. Processor, memory, I/O (disk, network)
❑ Exploits the hardware resources of one or more
processors
❑ Manages secondary memory and I/O devices
2
DESIGN GOALS OF OPERATING
SYSTEM:
❖ Make a computing system convenient to
use
❖ Use the computer hardware and
resources in an efficient manner
❖ Execute user programs and make
solving user problems easier
❖ Create user-friendly computing
environment
❖ Make a computing system secure
3
COMPUTER SYSTEM
COMPONENTS:
Components of Computer System are
divided into four parts:
1. Hardware
Basic computing resources: processor (CPU), memory,
I/O devices
2. Operating system
Program that Controls and coordinates the use of
hardware among multiple programs running on a
computer
3. Application program
Solve user-specific problems: compilers, database
systems, business applications
4. User
People, machines, other computers
4
FUNCTIONS OF OPERATING
S YSTEMS:
1. Process Management:
❑ A process is a program in execution. It is a unit of
work within the system. Program is a passive entity,
and process is an active entity.
2/12/2019 7
FUNCTIONS OF OPERATING
SYSTEMS:
2. Memory Management:
❑ All data in memory before and after processing
❑ All instructions in memory in order to execute
❑ Memory management determines what is in memory
❑ Optimizing CPU utilization and computer response to
users
❑ Memory management activities
❑ Keeping track of which parts of memory are currently
being used and by whom
❑ Deciding which processes (or parts thereof) and data to
move into and out of memory
❑ Allocating and deallocating memory space as needed
2/12/2019 8
FUNCTIONS OF OPERATING
SYSTEMS:
3. File Management:
❑ File is the logical storage unit in a computer system.
2/12/2019 9
FUNCTIONS OF OPERATING
SYSTEMS:
4. Device Management:
❑ An OS manages device communication via their
respective drivers.
2/12/2019 10
FUNCTIONS OF OPERATING
SYSTEMS:
5. Network Management:
❑ An OS manages active and passive components over
network.
2/12/2019 11
FUNCTIONS OF OPERATING
SYSTEMS:
6. Protection and Security
❑ An OS protects the computer system from
malicious applications.
2/12/2019 12
FUNCTIONS OF OPERATING
SYSTEMS:
7. Provides User Interface
❑ An OS facilitates the communication between an
application and its user by acting as an intermediary
between them.
❑ User interact with the system either by using
Command-Line User Interface or by Graphical User
Interface.
❑ Command Line User Interface displays text, and
its commands are usually typed on a command line
using a keyboard.
❑ With a graphical user interface, the functions are
carried out by clicking or moving buttons, icons and
menus by means of a pointing device.
2/12/2019 13
PROCESS MANAGEMENT
A process is program under execution.
The process management module manages the
different types of processes submitted to the
system in such a way that it minimizes the idle
time of the processors.
DIFFERENT PROCESS STATES (PROCESS
LIFE CYCLE)
Processes in the operating system can be in any of
the following states:
NEW- The process is being created.
Disadvantages
Difficult to debug program.
2. Blocked
3. Ready
UNIPROGRAMMING SYSTEM
It is a system which processes only one job at a
time and all the system resources are available
for the job until its completion.
The figure below shows a uni-programming
system :
An OS does the following activities related to
multiprogramming.
➢ The operating system keeps several jobs in memory at
a time.
➢ This set of jobs is a subset of the jobs kept in the job
pool.
➢ The operating system picks and begins to execute one
of the jobs in the memory.
➢ Multiprogramming operating systems monitor the
state of all active programs and system resources using
memory management programs to ensures that the
CPU is never idle, unless there are no jobs to process.
Advantages
High and efficient CPU utilization.
User feels that many programs are allotted CPU almost
simultaneously.
Disadvantages
CPU scheduling is required.
To accommodate many jobs in memory, memory
management is required.
TYPES OF JOBS
A jobs does not need CPU for entire duration of its
processing because in addition to computation (for which
CPU is needed ), it often needs to perform I/O operations
(such as reading/writing of data from/to a disk.
On the basis of utilization jobs are of two types:
1. CPU bound jobs
➢ These jobs mostly perform computations with little I/O
operations.
➢ CPU utilization is high
➢ Programs used for scientific and engineering falls in this
category of jobs.
2. I/O bound jobs
➢ These type of job mostly perform I/O operation with little
computation
➢ CPU utilization is low
➢ Programs used for commercial data processing fall under
this kind of job
REQUIREMENTS OF MULTIPROGRAMMING
SYSTEM
1) Larger Memory
2) Memory Protection
3) Job status Reservation
4) Proper Mix up of Jobs
5) CPU Scheduling
MULTITASKING
Multitasking is when multiple jobs are executed by the
CPU simultaneously by switching between them.
Switches occur so frequently that the users may interact with
each program while it is running.
An OS does the following activities related to multitasking −
➢ The user gives instructions to the operating system or to
a program directly, and receives an immediate response.
➢ The OS handles multitasking in the way that it can handle
multiple operations/executes multiple programs at a time.
➢ Multitasking Operating Systems are also known as Time-
sharing systems.
➢ These Operating Systems were developed to provide interactive
use of a computer system at a reasonable cost.
➢ A time-shared operating system uses the concept of
CPU scheduling and multiprogramming to provide each
user with a small portion of a time-shared CPU.
➢ Each user has at least one separate program in memory.
MULTIPROCESSING
Multi-processing refers to the ability of a system to support
more than one processor at the same time.
Applications in a multi-processing system are broken to
smaller routines that run independently.
The operating system allocates these threads to the
processors improving performance of the system.
Multiprocessor system means, there are more than one
processor which work parallel to perform the required
operations.
It allows the multiple processors, and they are connected
with physical memory, computer buses, clocks, and
peripheral devices.
The main objective of using a multiprocessor operating
system is to increase the execution speed of the system and
consume high computing power
TYPES OF MULTIPROCESSING SYSTEM
1. Tightly coupled – single system with primary
memory shared by all processors
2. Loosely coupled – Each processor has its own
local memory.
CPU,MEMORY, AND I/O PROCESSORS OF A
COMPUTER SYSTEM
ASSIGNMENT 2:
Explain about time sharing system.
Differentiate between multiprogramming,
multiprocessing and multitasking.
File Operations
Set of commands provided by an operating system to deal
with files and their contents
Create
Delete
Open
Close
Read
write
Seek
Rename
Copy etc.
SOME POPULAR OPERATING SYSTEM
DOS
WINDOWS
UNIX
LINUX