OPERATING
SYSTEMS
Prof Shamik Palit
Department of Engineering & IT
Manipal University, Dubai
Module 1
CONTENTS
Operating System Introduction
Operating System Structure
Operating System Services
Module 1
Operating System
Introduction
DEFINITION
An Operating System is a program that acts as an
intermediary between user of a computer and
computer Hardware.
An Operating System provides environment a user can
execute programs in convenient and efficient way.
An Operating System must ensure the correct
operation of Computer System
An Operating System also provides certain services to
the programs and user of programs.
WHAT IS AN OPERATING
SYSTEM?
A program that acts as an intermediary between a
user of a computer and the computer hardware.
Operating system goals:
Execute user programs and make solving user
problems easier.
Make the computer system convenient to use.
Use the computer hardware in an efficient manner.
WHAT IS AN OPERATING
SYSTEM?
Computer systems typically
Hardware and Software
Hardware - electronic,
optical devices
Software programs
contain:
mechanical,
Without support software, the computer
is of little use..
WHAT IS AN OPERATING
SYSTEM?
An interface between Hardware and User
Programs
An abstraction of the hardware for all the
(user) processes
Hide
the complexity of the underlying
hardware and give the user a better view of
the computer
COMPUTER SYSTEM COMPONENTS
1.
Hardware provides basic computing resources (CPU, memory,
I/O devices).
2.
Operating system controls and coordinates the use of the
hardware among the various application programs for the
various users.
3.
Applications programs define the ways in which the system
resources are used to solve the computing problems of the
users (compilers, database systems, video games, business
programs).
4. Users (people, machines, other computers).
ABSTRACT VIEW OF SYSTEM
COMPONENTS
THE OS
applications
software
utilities
systems
software
Operating system
hardware
components
device
CPU
device
...
memory
device
THE GOALS OF AN OS
Let users run programs:
Correctness
Memory boundaries, priorities, steady state
Convenience
User
should
not
handle
the
tiny
details
(encapsulate/abstract),
provide
synchronization
primitives, system calls, file system, tools
THE GOALS OF AN OS
Let users run programs:
Efficiency
Resource Utilization, resource Sharing, Multitasking
Fairness
(in resource allocation)
Among: users, tasks, resources
The tradeoff between efficiency and fairness
AN OS IS A RESOURCE
ALLOCATOR
Multiple users (?) get all
resources simultaneously:
computing
CPU
time
Memory (ram, swap, working set, virtual,..)
File system (storage space)
I/O devices (display, printers, mouse,..)
Clock
The OS should give every user the illusion
that she is getting all resources to herself
(not sharing!)
TYPES OF OS :MAINFRAME SYSTEMS
Reduce setup time by batching similar jobs
Automatic job sequencing automatically
transfers control from one job to another. First
rudimentary operating system.
Resident monitor
initial control in monitor
control transfers to job
when job completes control transfers pack to monitor
TYPES OF OS : SIMPLE BATCH SYSTEM
TYPES OF OS : MULTIPROGRAMMED
BATCH SYSTEMS
Several jobs are kept in main memory at the same time, and the
CPU is multiplexed among them.
TYPES OF OS : TIME-SHARING SYSTEMS
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).
A job swapped in and out of memory to the disk.
On-line communication between the user and the system is
provided; when the operating system finishes the execution of one
command, it seeks the next control statement from the users
keyboard.
On-line system must be available for users to access data and code.
TYPES OF OS : DESKTOP SYSTEMS
Personal computers computer system dedicated to a single user.
I/O devices keyboards, mice, display screens, small printers.
User convenience and responsiveness.
Can adopt technology developed for larger operating system often
individuals have sole use of computer and do not need advanced
CPU utilization of protection features.
May run several different types of operating systems (Windows,
MacOS, UNIX, Linux)
TYPES OF OS : PARALLEL SYSTEMS
Multiprocessor systems with more than on CPU in close
communication.
Tightly coupled system processors share memory and a clock;
communication usually takes place through the shared memory.
Advantages of parallel system:
Increased throughput
Economical
Increased reliability
graceful degradation
fail-soft systems
TYPES OF OS : PARALLEL SYSTEMS
(CONT.)
Symmetric multiprocessing (SMP)
Each processor runs and identical copy of the operating
system.
Many processes can run at once without performance
deterioration.
Most modern operating systems support SMP
Asymmetric multiprocessing
Each processor is assigned a specific task; master processor
schedules and allocated work to slave processors.
More common in extremely large systems
TYPES OF OS : DISTRIBUTED SYSTEMS
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.
Advantages of distributed systems.
Resources Sharing
Computation speed up load sharing
Reliability
Communications
TYPES OF OS : DISTRIBUTED SYSTEMS
(CONT)
Requires networking infrastructure.
Local area networks (LAN) or Wide area
networks (WAN)
May be either client-server or peer-to-peer
systems.
TYPES OF OS : CLUSTERED SYSTEMS
Clustering allows two or more systems to share
storage.
Provides high reliability.
Asymmetric clustering: one server runs the
application while other servers standby.
Symmetric clustering: all N hosts are running the
application.
TYPES OF OS : REAL-TIME
SYSTEMS
Often used as a control device in a dedicated
application such as controlling scientific
experiments,
medical
imaging
systems,
industrial control systems, and some display
systems.
Well-defined fixed-time constraints.
Real-Time systems may be either hard or soft
real-time.
TYPES OF OS : REAL-TIME
SYSTEMS (CONT.)
Hard real-time:
Secondary storage limited or absent, data stored in short
term memory, or read-only memory (ROM)
Conflicts with time-sharing systems, not supported by
general-purpose operating systems.
Soft real-time
Limited utility in industrial control of robotics
Useful in applications (multimedia, virtual reality)
requiring advanced operating-system features.
TYPES OF OS : HANDHELD
SYSTEMS
Personal Digital Assistants (PDAs)
Cellular telephones
Issues:
Limited
memory
Slow processors
Small display screens.
MIGRATION OF OPERATING-SYSTEM CONCEPTS AND FEATURES
Module 1
Operating System
Structure
OPERATING SYSTEM STRUCTURE
System Components
Process
management
Main memory management
File Management
I/O System management
Secondary Storage management
Networking
Protection System
Command Interpreter System
OPERATING SYSTEM STRUCTURE
System Components
Process
management
A process can be thought as a program in execution
Ex : A word processing program run by user
Process need resources
CPU time, Memory, Files , I/O Device
Process
is unit of work in System
Create, delete user, system process
Suspending and resume process
Mechanism for process synchronization
Mechanism for process communication
OPERATING SYSTEM STRUCTURE
System Components
Main
memory management
Central to the all operation of Computer System
Central Processor reads instruction from main memory
Central Processor reads, writes data from main
memory
Which part of the memory currently used by whom
Which process are to be loaded into memory
Allocating and De allocating memory space
OPERATING SYSTEM STRUCTURE
System Components
File
Management
Most Visible component of Operating System
File is a collection of related information
Creating, deleting files
Creating , deleting directories
Backing up files on storage.
OPERATING SYSTEM STRUCTURE
System Components
I/O
System management
OS hides peculiarities of Hardware device from user
I/O Subsystem consists of
Memory management component
General Device driver interface
Driver for specific Hardware Device
OPERATING SYSTEM STRUCTURE
System Components
Secondary
Storage management
Used as back up memory
Programs Compilers, assemblers stored on disk
Free space management
Storage Allocation
Disk Scheduling
OPERATING SYSTEM STRUCTURE
System Components
Networking
Distributed system
Collection of process that do not share memory
Each processor has its local memory
Process communicate through network
User access various resources
Ex: http used in communication web server &
browser
OPERATING SYSTEM STRUCTURE
System Components
Protection
System
Mechanism for controlling access of program, process
Improves reliability of detecting errors
Distinguish between authorized, unauthorized access.
Ex: Memory address hardware ensures that process
can execute within its own address space.
OPERATING SYSTEM STRUCTURE
System Components
Command
Interpreter System
Interface between user and OS
New job started in batch system
Command Line interpreter Shell get command
statement and execute
OPERATING SYSTEM STRUCTURE
A modern OS must be engineered carefully if
it is to function properly and modified easily.
Simple
Structure
Layered
Approach
Microkernels
OPERATING SYSTEM STRUCTURE
Simple Structure
Many
commercial systems do not have well
defined structure
Such OS started small , simple, limited systems
then grow beyond their original scope
Ex : MS DOS, UNIX
UNIX
initially had 2 components
Kernel
System Programs
New
version of UNIX are designed to use more
advanced hardware
OPERATING SYSTEM STRUCTURE
OPERATING SYSTEM STRUCTURE
Layered Approach
OS
is broken up into number of layers / levels
Bottom layer is Hardware, highest layer is user
interface
OS layer is an implementation of abstract object
Advantage : Modularity
It
Each layer uses functionality of its lower level
simplifies debugging and system verification
It is less efficient
Ex: OS/2, Windows NT
OPERATING SYSTEM STRUCTURE
OPERATING SYSTEM STRUCTURE
Microkernels
Remove
all non essential components from the
kernel and implement them as system
Minimal
process and memory management
Provide
a communication facility between client
program and various services
Communication
is provided by message passing
OPERATING SYSTEM STRUCTURE
OPERATING SYSTEM STRUCTURE
Microkernels
Client
Program and service communicate
indirectly by exchanging message with
microkernel
Advantage:
All new services are added to user
space , do not require modification of kernel.
Examples
Tru 64 UNIX
Apple Mac OS X Server
QNX
Module 1
Operating System
Services
OPERATING SYSTEM SERVICES
Operating System provides an environment for
execution of programs.
It provides following services to programs and
users:
Program execution
I/O operation
File system manipulation
Communications
Error detections
Resource Allocation
Accounting
Protections
OPERATING SYSTEM SERVICES
Program execution
System
must be able to load a program into
memory and to run that program
Program must be able to end its execution
OPERATING SYSTEM SERVICES
I/O operation
A
running program may require I/O
A File
I/O Device
Users
can not control I/O directly
OS provides a means to do I/O
OPERATING SYSTEM SERVICES
File system manipulation
Programs
need to read and write files
Programs need to create and delete files
OPERATING SYSTEM SERVICES
Communications
Can
occur in 2 ways:
Between processes execute on same computer
Between processes execute in different computer
Communications
implemented via shared
memory or message passing technique.
OPERATING SYSTEM SERVICES
Error detections
OS
need to be aware of possible errors
Errors may occur in
CPU, memory hardware
I/O devices
User Program
OS
must take appropriate action for each type of
error to ensure correct and consistent computing
OPERATING SYSTEM SERVICES
Resource Allocation
Resource must be allocated when
Multiple users logged into system
Multiple jobs are running in same time
Different
type of resource managed by OS
CPU cycles, Main memory, file storage
I/O device
OS
maintains CPU scheduling routines.
OPERATING SYSTEM SERVICES
Accounting
Which
user use how many and which kind of
computer resources
Record keeping used for accounting ,usage
statistics
Used to improve computing services.
OPERATING SYSTEM SERVICES
Protections
Owner of the information stored in multiuser
computer want to control use of that information
Protection ensures that all access to the system
resources are controlled
Security
User Authentication
External I/O devices
Thank You