CSE2005 Operating Systems
Introduction
Syllabus
Course Assesments
Assessment includes
Two Continuous assessment tests,
3 Digital assignments,
Lab sessions,
Project and
Final assessment test.
Chapter 1: Introduction
What Operating Systems Do
Computer-System Architecture
Operating-System Structure
Operating-System Operations
Process Management
Memory Management
Storage Management
Protection and Security
Distributed Systems
Special-Purpose Systems
Objectives
To provide a grand tour of the major operating systems
components
To provide coverage of basic computer system organization
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
Computer System Structure
Computer system can be divided into four components:
Hardware – provides basic computing resources
CPU, memory, I/O devices
Operating system
Controls and coordinates use of hardware among various applications
and users
Application programs – define the ways in which the system
resources are used to solve the computing problems of the
users
Word processors, compilers, web browsers, database systems, video
games
Users
People, machines, other computers
Four Components of a Computer System
What Operating Systems Do
Depends on the point of view
Users want convenience, ease of use
Don’t care about resource utilization
But shared computer such as mainframe or minicomputer
must keep all users happy
Users of dedicate systems such as workstations have dedicated
resources but frequently use shared resources from servers
Handheld computers are resource poor, optimized for usability
and battery life
Some computers have little or no user interface, such as
embedded computers in devices and automobiles
Operating System Definition
OS is a resource allocator
Manages all resources
Decides between conflicting requests for efficient and fair
resource use
OS is a control program
Controls execution of programs to prevent errors and
improper use of the computer
Operating System Definition (Cont.)
No universally accepted definition
“Everything a vendor ships when you order an operating system”
is good approximation
But varies wildly
“The one program running at all times on the computer” is the
kernel. Everything else is either a system program (ships with
the operating system) or an application program.
Types of OS:
Operating System can also be classified as,-
Single User Systems
Multi User Systems
Single User Systems:
Provides a platform for only one user at a time.
They are popularly associated with Desk Top operating
system which run on standalone systems where no user
accounts are required.
Example: DOS
Multi-User Systems:
Provides regulated access for a number of users by maintaining a
database of known users.
Refers to computer systems that support two or more
simultaneous users.
Another term for multi-user is time sharing.
Ex: All mainframes are multi-user systems.
Example: Unix
Batch Processing:
In Batch processing same type of jobs batch (BATCH- a set of jobs with
similar needs) together and execute at a time.
The OS was simple, its major task was to transfer control from one job
to the next.
The job was submitted to the computer operator in form of punch
cards. At some later time the output appeared.
The OS was always resident in memory. (Ref. Fig. next slide)
Common Input devices were card readers and tape drives.
Batch Processing (Contd…):
Common output devices were line printers, tape drives, and card
punches.
Users did not interact directly with the computer systems, but he
prepared a job (comprising of the program, the data, & some control
information).
OS
User
progra
m area
Single user/Single tasking OS
One user works on the system
Performs one task at a time
MS-DOS and Palm OS
Take up little space on disk
Run on inexpensive computers
Operating System cannot be able to take control back from
the running process/task/application
In case if a process call an I/O Instruction then Processor
must wait for I/O instruction to complete before preceding
Multitasking OS
User performs many tasks at once
Most common form of OS
Windows XP and other OS
Require expensive computers
Tend to be complex
Operating System can take control back from the
running process and can give it to other.
When one job needs to wait for I/O, the processor can
switch to the other job
Operating System Structure
Multiprogramming needed for efficiency
Single user cannot keep CPU and I/O devices busy at all times
Multiprogramming organizes jobs (code and data) so CPU always has one to execute
A subset of total jobs in system is kept in memory
One job selected and run via job scheduling
When it has to wait (for I/O for example), OS switches to another job
Timesharing (multitasking) is logical extension in which CPU switches
jobs so frequently that users can interact with each job while it is running, creating
interactive computing
Response time should be < 1 second
process
Each user has at least one program executing in memory
If several jobs ready to run at the same time CPU scheduling
If processes don’t fit in memory, swapping moves them in and out to run
Virtual memory allows execution of processes not completely in memory
Memory Layout for Multiprogrammed System
Multiprogramming:
Multiprogramming is a technique to execute number of programs
simultaneously by a single processor.
In Multiprogramming, number of processes reside in main memory at
a time.
The OS picks and begins to executes one of the jobs in the main
memory.
If any I/O wait happened in a process, then CPU switches from that
job to another job.
Hence CPU in not idle at any time.
Multiprogramming (Contd…):
OS •Figure dipicts the layout of
multiprogramming system.
Job 1
• The main memory consists
Job 2 of 5 jobs at a time, the CPU
executes one by one.
Job 3
Advantages:
Job 4 •Efficient memory utilization
Job 5 •Throughput increases
•CPU is never idle, so
performance increases.
Time Sharing Systems:
Time sharing, or multitasking, is a logical extension of
multiprogramming.
Multiple jobs are executed by switching the CPU between them.
In this, the CPU time is shared by different processes, so it is called as
“Time sharing Systems”.
Time slice is defined by the OS, for sharing CPU time between
processes.
Examples: Multics, Unix, etc.,
Operating Systems functions:
The main functions of operating systems are:
1. Program creation
2. Program execution
3. Input/Output operations
4. Error detection
5. Resource allocation
6. Accounting
7. protection
Process Management
A process is a program in execution. It is a unit of work within
the system. Program is a passive entity, process is an active
entity.
Process needs resources to accomplish its task
CPU, memory, I/O, files
Initialization data
Process termination requires reclaim of any reusable resources
Single-threaded process has one program counter
specifying location of next instruction to execute
Process executes instructions sequentially, one at a time, until
completion
Multi-threaded process has one program counter per thread
Typically system has many processes, some user, some
operating system running concurrently on one or more CPUs
Concurrency by multiplexing the CPUs among the processes /
threads
Process Management Activities
The operating system is responsible for the following activities in
connection with 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
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 when
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
Storage Management
OS provides uniform, logical view of information storage
Abstracts physical properties to logical storage unit - file
Each medium is controlled by device (i.e., disk drive, tape
drive)
Varying properties include access speed, capacity, data-transfer rate,
access method (sequential or random)
File-System management
Files usually organized into directories
Access control on most systems to determine who can access
what
OS activities include
Creating and deleting files and directories
Primitives to manipulate files and dirs
Mapping files onto secondary storage
Backup files onto stable (non-volatile) storage media
Mass-Storage Management
Usually disks used to store data that does not fit in main memory
or data that must be kept for a “long” period of time
Proper management is of central importance
Entire speed of computer operation hinges on disk subsystem
and its algorithms
OS activities
Free-space management
Storage allocation
Disk scheduling
Some storage need not be fast
Tertiary storage includes optical storage, magnetic tape
Still must be managed – by OS or applications
Varies between WORM (write-once, read-many-times) and RW
(read-write)
I/O Subsystem
One purpose of OS is to hide peculiarities of hardware
devices from the user
I/O subsystem responsible for
Memory management of I/O including buffering (storing data
temporarily while it is being transferred), caching (storing
parts of data in faster storage for performance), spooling (the
overlapping of output of one job with input of other jobs)
General device-driver interface
Drivers for specific hardware devices
Protection and Security
Protection – any mechanism for controlling access of processes
or users to resources defined by the OS
Security – defense of the system against internal and external
attacks
Huge range, including denial-of-service, worms, viruses, identity
theft, theft of service
Systems generally first distinguish among users, to determine
who can do what
User identities (user IDs, security IDs) include name and associated
number, one per user
User ID then associated with all files, processes of that user to
determine access control
Group identifier (group ID) allows set of users to be defined and
controls managed, then also associated with each process, file
Privilege escalation allows user to change to effective ID with
more rights
Distributed Computing
Collection of separate, possibly heterogeneous, systems
networked together
Network is a communications path
Local Area Network (LAN)
Wide Area Network (WAN)
Metropolitan Area Network (MAN)
Network Operating System provides features between systems
across network
Communication scheme allows systems to exchange messages
Illusion of a single system
Special-Purpose Systems
Real-time embedded systems most prevalent form of computers
Vary considerable, special purpose, limited purpose OS, real-time
OS
Multimedia systems
Streams of data must be delivered according to time restrictions
Handheld systems
PDAs, smart phones, limited CPU, memory, power
Reduced feature set OS, limited I/O
End of Chapter 1