Transcript ch1_OS

Operating Systems
Dr. Raihan Ur Rasool
BICSE-3
Credits: 3
Contacts








Operating System Concepts
Office:
Academic Block -II
Phone 051-9280439 Ext 129
Office Hours:
Monday 1000 – 1200 hrs
email:
[email protected]
Exceptional meeting:
Give me an email and get time.
1.2
Course Outline
1. Introduction
2. Operating System Structures
3. Processes
4. Threads
5. CPU Scheduling
6. Process Synchronization
7. Deadlocks
8. Main Memory
9. Virtual Memory
10. File-System Interface
11. File-System Implementation
12. Mass-Storage Structure
13. I/O Systems
Operating System Concepts
1.3
Books
 Text Books
 Operating
System Concepts, 7th Edition, by Avi
Silberschatz, Peter Baer Galvin, Greg Gagne, published by
John Wiley & Sons, Inc. ISBN 0-471-69466-5
Operating System Concepts
1.4
Books
 Reference Books
 Operating Systems by Williams Stallings
 www.howstuffworks.com
 www.whatis.com
Operating System Concepts
1.5
Evaluation
One Hour Tests (OHT)
:
Assignments
:
Quizzes
:
Project
:
End Semester Examination (ESE)
Operating System Concepts
1.6
30%
10%
5%
10%
:
45%
Policies
 Bring your own calculator, pen paper etc..
 You will not be allowed to borrow anything from anyone during any




test
Must write your name and reference number (Merit No or Regn No)
in a test
No late work will be accepted (unless arrangements have been
made in advance)
Ask questions; participate actively in class
You are allowed to talk to instructor only
Operating System Concepts
1.7
Policies
 You are responsible for what is covered in class – even if you
don’t show up
 Deficiency in attendance may lead to termination or relegation
 You are encouraged to help each other with your homework
assignments – but you must turn in your own work
 If you are found to be cheating, you will fail at least the
assignment / test and perhaps the entire class
Operating System Concepts
1.8
Policies
 If you have any learning disabilities or special needs,
please let me know in advance through email or personal
meeting
 Check your email regularly for messages
 Quizzes are unannounced
Operating System Concepts
1.9
Chapter 1: Introduction
 What is an Operating System?
 Mainframe Systems
 Desktop Systems
 Multiprocessor Systems
 Distributed Systems
 Clustered System
 Real -Time Systems
 Handheld Systems
 Computing Environments
Operating System Concepts
1.10
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.
 E.g.
 Microsoft Windows 98/2000/XP
 Linux (Different flavors, RedHat most popular)
 Unix (FreeBSD Popular)
 Solaris (Based on Unix, expensive but very reliable)
 MacOS (Apple , Motorola 68K series)
 Micro C Linux (Flavor of linux for Hand held devices)
Operating System Concepts
1.11
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).
Operating System Concepts
1.12
Operating System Definitions
 Resource allocator – manages and allocates resources.
 Processor (CPU)
 Memory
 Disk Space
 Modem, Network etc.
 Control program – controls the execution of user programs and
operations of I/O devices .
 C/C++ Programs
 MS Office etc.
 Kernel – A program running at all the times (all else being
application programs).
 Always resident in RAM (Like soul of human)
 E.g. Command.com in MS-DOS
 In Windows system kernel is not just one program but it is a set of
programs (We will look at Windows XP and Linux in a little more
detail in future lectures)
Operating System Concepts
1.13
Abstract View of System Components
OS – an
environment
provider
Operating System Concepts
1.14
Different Computer Systems
 Mainframe Systems
 Batch Systems
 Multiprogrammed Systems
 Time-Sharing Systems
 Desktop Systems
 Multiprocessor Systems
 Distributed Systems
Operating System Concepts
1.15
Mainframe Systems
 First computers used to tackle commercial and engineering
applications.
 0th Generation (1940’s)
 Very large computers (Size of a big room)
 Required a team to run / manage the whole system
Operating System Concepts
1.16
Batch Systems
Mainframe Systems
 Reduced setup time by batching similar
jobs
 Batches were sorted and fed into the system
by Operator.
 E.g. Updating daily sales records in a
database etc.
 Processed one program at a time and
after finishing the program loaded
another program from the same batch.
 Automatic job sequencing –
automatically transfers control from one
job to another. First basic operating
system.
Operating System Concepts
1.17
Memory Layout for a Simple Batch System
Operating System Concepts
1.18
Batch Systems
Card
Card
Card
Reader
Reader
Reader
Operating System Concepts
CPU
1.19
Printer
Multiprogrammed Batch Systems
 Multiprogramming increases CPU
utilization by organizing jobs so that
the CPU always has one to execute
– Early 1960
 Job scheduling and CPU scheduling
 If Job 1 is being executed and then
due to some reason it has to wait for
some I/O Operation, then the CPU
would automatically switch to Job 2
and would turn to Job 3 or Job 1
according to algorithm if job 2 has to
perform I/O.
 Usually a process (program in the
memory of CPU) has to perform I/O
after a few calculations
DISK
Job1, Job 2,
Job 3 … Job n
Operating System Concepts
1.20
Multiprogrammed Systems
Mainframe
Operating System
(OS)
DISK
Job 1, Job 2,
. . . Job n
Operating System Concepts
Job 1
Job 1
Job 2
Job 2
Job 3
Job 3
1.21
OS Features Needed for Multiprogramming
 I/O routine supplied by the system.
 Memory management – the system must allocate the
memory to several jobs.
 CPU scheduling – the system must choose among
several jobs ready to run.
 Allocation of devices.
Operating System Concepts
1.22
Time-Sharing Systems–Interactive Computing
 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 user’s keyboard.
 On-line system must be available for users to access data
and code.
Operating System Concepts
1.23
Desktop Systems
 Personal computers – computer system dedicated to a




single user (1970’s).
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, Solaris, BeOS)
 90% share is for Microsoft Windows based OS
 Linux is gaining popularity (Open source)
Operating System Concepts
1.24
Parallel Systems
 Multiprocessor systems with more than one 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
Operating System Concepts
1.25
Parallel Systems (Cont.)
 Symmetric multiprocessing (SMP)
 Each processor runs an 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 allocates work to slave
processors.
 More common in extremely large systems
Operating System Concepts
1.26
Symmetric Multiprocessing Architecture
Operating System Concepts
1.27
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 highspeed buses or telephone lines.
 Advantages of distributed systems.
 Resources Sharing
 Computation speed up – load sharing
 Reliability
 Communications
Operating System Concepts
1.28
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.
Operating System Concepts
1.29
General Structure of Client-Server
Operating System Concepts
1.30
Clustered Systems
 Definition: Clustered computers which share storage and





are closely linked via LAN networking.
Advantages: high availability, performance improvement,
etc.
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.
Operating System Concepts
1.31
Real-Time Systems
 Definition: A real-time system is a computer system where
a timely response by the computer to external stimuli is
vital!
 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.
Real-time means on-time instead of fast
Operating System Concepts
1.32
Real-Time Systems (Cont.)
 Hard real-time system: The system has failed if a timing
constraint, e.g. deadline, is not met.
 All delays in the system must be bounded.
 Many advanced features are absent.
 Secondary storage limited or absent, data stored in short term
memory, or read-only memory (ROM)
 Conflicts with time-sharing systems, not supported by generalpurpose operating systems.
 E.g. Robot manufacturing a car, Overhead crane loading and
unloading at Sea Port, Computer interfacing of certain machines
 Soft real-time system: Missing a timing constraint is serious,
but does not necessarily result in a failure unless it is
excessive
 A critical task has a higher priority.
 Supported in most commercial OS.
 Useful in applications (multimedia, virtual reality) requiring
advanced operating-system features.
Operating System Concepts
1.33
Handheld Systems
 Personal Digital Assistants (PDAs)
 Cellular telephones
 Issues:
 Slow processors  Battery Power
 Limited memory  No virtual Memory, Small size
 Small display screens  Web clipping,
Operating System Concepts
1.34
Migration of Operating-System Concepts and Features
Operating System Concepts
1.35
Computing Environments
 Traditional computing
 Web-Based Computing
 Embedded Computing
Operating System Concepts
1.36
End Of Lecture

Next Lecture
Computer System Operation
I/O Structure
Storage Structure
Storage Hierarchy
Operating System Concepts
1.37