Operating Systems
Computer System
1. Hardware
2. Operating system
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
What Operating Systems Do
• Depends on the point of view
• Users want convenience, ease of use and good performance
– 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
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
Operating system interface
Hardware
Operating
System
Software
Prepared by: Mazhar Javed Awan 7
Components of Operating System
• Process management
• Memory management
• Secondary management
• I/O System
• File System
• Protection System
Operating system types
• Single user
• Multi user
• Batch processing
• Multiprogramming
• Time sharing
• Real time system
• Distributed system
• Client server system
• Handheld
Prepared by: Mazhar Javed Awan 9
Single User Systems
•
Personal computers
– computer system dedicated to a single
user.
•
Interactive
•
User convenience and responsiveness.
•
Can adopt technology developed for larger operating systems
—multi-process, multi-user
•
Individuals usually have sole use of computer and do not
need advanced protection features.
•
In this CPU remains the idle suring an I/O operation.
• They are popularly associated with Desktop operating system
which run on standalone systems where no user accounts
are required.
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
.
Prepared by: Mazhar Javed Awan 11
Batch Processing:
• In Batch processing same type of jobs batch (BATCH- a set of jobs with similar needs) together and execute at a time.
•
First rudimentary system.
•
User
operator
•
Reduce
setup time by batching
similar jobs
•
Automatic job sequencing – automatically transfers
control from one job to another.
•
Resident monitor :
initial control in monitor
control transfers to job
when job completes
Batch Processing (Contd…):
• 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. ) • Common Input devices were card readers and tape
drives.
• 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).
Prepared by: Mazhar Javed Awan 13
Examples
• Payroll Systems
• Tax systems
• Production of electricity Bills
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.
Prepared by: Mazhar Javed Awan 15
Multiprogramming (Contd…):
OS
Job 1
Job 2
Job 3
Job 4
Job 5
•
Figure dipicts the layout of
multiprogramming system.
• The main memory consists of 5
jobs at a time, the CPU executes
one by one.
Advantages:
•Efficient memory utilization
•Throughput increases
OS Features Needed for
Multiprogramming
•
SPOOLing (Simultaneous Peripheral
Operation On-Line)
Prepared by: Mazhar Javed Awan 17
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. • Using multiprogramming to handle
multiple interactive jobs
• Multiple users simultaneously access the system through terminals.
• A job is swapped in and out of memory to the disk if needed.
• Examples
• Airline booking Systems
Process 1 Process 2 Process 3
Real-time Systems
• Well-defined fixed-time constraints.
• 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.
• System is automatically updated when a change is made due to transaction occur.
• The terminals must be connected to the computers. • Must be an online system.
• Medical imaging systems • Industrial control systems • Traffic Lights
• Robots
Prepared by: Mazhar Javed Awan 19
Real-time Systems types
•
Hard real-time
systems:
Secondary storage limited or absent, data stored in short term memory, or read-only memory (ROM)
No virtual memory—time
cannot be “wasted” on
translation of logical to physical addresses
OS code structured for
efficiency
Plane landing systems, proces
control in nuclear power plants, respirators, etc.
•
Soft real-time
systems
Output should be produced
within the given time
constraints but if it is not, the result is not life
threatening
Useful in applications
(multimedia, virtual reality) requiring advanced
Distributed Systems
• Distribute the computation among several physical processors.
• Loosely coupled system (clusters?) – each processor has its own local
memory; processors communicate with one another through various
communications lines, such as high-speed buses , cross-bar switches, LANS, or telephone lines.
• Advantages of distributed systems.
– Resources Sharing
– Computation speed up – load sharing – Reliability
– Communications
• Disadvantages: control and OS functions complicated, and
Prepared by: Mazhar Javed Awan 21
Client Server Systems
• In which cooperation and intercommunication
between the various elements of a network is
conducted.
Handheld Systems
• Personal Digital Assistants (PDAs)
• Cellular telephones
• Issues:
– Limited memory
– Slow processors
Prepared by: Mazhar Javed Awan 23
Embedded system
• Different electronic devices are controlled
• Permanently store on Rom chip
Uses
• Mobile phone
• Microwave
• TV sets
•
Examples