Introduction to
Objectives 1. 2. 3. 4. 5. 6.
A firm understanding about OS, its primary purpose and goals to a computer system; Trace the history of OS and the development of systems. Concepts basic to OS; OS components and its component management; Computer system operations, structure of the computer systems and hardware protection; Services of OS.
Introduction
Major components of Computer Systems:
Hardware Computer users Software
Note:
Without software, computer is of little use. However with software, computer can store, manipulate and retrieve information, and can engage in many other activities.
Introduction Software can be grouped into:
System software (OS and utilities) Application software (user programs) User1
compiler compiler
User2
User3
User n
assembler text database assembler texteditor editor databasesystems systems AAppppl li iccaat ti ioonn PPrrooggrraammss OPERATING OPERATINGSYSTEMS SYSTEMS
Computer ComputerHardware Hardware
Introduction Utilities Utilities
Application Application Software Software
OS OS
CPU CPU
device device
device device
… …
M M ee m m oo rr yy
device device
Introduction Without an OS, a user who wanted to run a
program that uses some of the resources of the system will need to write a program that includes code for driving the resources required. Code for handling keyboard, printers, etc. have to be written.
Introduction To alleviate these difficulties, OS contains set
of procedures for driving the resources of the system, thus it frees the users from the dirty details of writing these drivers for the devices involved in the problem being solved.
What is OS? Program implemented either in firmware or
software which acts as an intermediary between the user of a computer and the computer hardware. Collection of system programs (procedures) that together control the operation of a computer system. The purpose is to provide an environment wherein users can execute programs
Different OS Mainframe OS
designed to optimize utilization of hardware.
PC OS
supports games, business applications, and the like.
Handheld OS
designed to interface with the computer to execute programs.
Primary goals of an OS Make the computer convenient to use 2. Use the computer hardware in an efficient manner. 1.
Sizes of OS
Its size & complexity depend on a number of factors:
Computer system characteristics: (has one or more processors) Provides facilities: (allows interactive use or not?) Applications to support (allows many users to use the same application simultaneously or not?)
Why study operating systems?
In this course, we will NOT write OS but…
It is one of the largest and most complicated system software. Draws on lots of areas • Software Engineering, Computer Architecture, Data Structures, Networks and Algorithms etc.
If certain things in the OS need to be changed, better understand them first! Can apply techniques used in an OS to other areas • complex data structures, conflict resolution, concurrency, resource management
What does an OS do? It controls the function of the computer system. OS includes programs that: Initializes the hardware Provides basic routine for device control Provides for the management, scheduling and interaction of tasks Maintain system integrity, and Handle errors
Where are OS found? Complexity of OS depends on the type of
functionality it provides:
Some OS manage many users on a network.
Found in petrol pumps, airplanes, video recorders, washing machines and car engines.
What is a General Purpose OS? Provides the ability to run a number of
programs.
MS Windows, UNIX, Linux, etc.
Viewpoints of an OS Similar to a government Resource Allocator/Manager Control Program An extended machine
Note: OS runs in a kernel/supervisor/monitor mode (protection from user by the hardware)
Single-user vs. Multi-user OS
Single user OS provides access to the computer system by a single user at a time.
Examples are: Win95, WinNT, Win2K, Win XP
Provides with the capability to perform tasks on the computer system such as writing programs and documents, printing and accessing files
Single-user vs. Multi-user OS A multi-user OS allows more users to access
the computer system at one time via network, thus accessing the system remotely from another terminal.
Examples are UNIX and mainframes such as the IBM AS400.
Multi-user OS Advantages
Hardware is very expensive, and it lets a number of users share this expensive resource (reduced cost) Since resources are shared, they are more likely to be in use than sitting idle being unproductive. (increased resource utilization)
Multi-user OS Disadvantages
More users slow down the performance of the system. Cost of hardware, requires a lot of disk space and memory. Multi-user OS cost is more than software for single-user.
Operating System Utilities OS consists of hundreds of thousands of
program codes and stored on hard disk. Portions of the OS are loaded into the RAM when needed.
Utilities are provided for:
Managing files and documents Development of programs and software Communicating with people and with other computer systems Managing user requirements for programs, storage space and priority.
OS Interfaces OS provides each user with an interface
that accepts, interprets and executes user commands or programs. Shell or command line interpreter. (CLI)
In some systems, this might be a simple lineby-line text mode (such as DOS or UNIX) or highly graphical (such as Windows)
What is a multitasking OS? Provides the ability to run more than one
program at once.
Each of these tasks the user is doing
appears to be running at the same time
Advantage: increased productivity Disadvantage: more memory required.
Evolution of OS
Programmed in machine language and used front panel switches for input.
The programmer is also the operator interacting with the computer directly from the system console (control panel).
Introduce Device drivers (a subroutine performing various I/O devices which involves complex sequences of device-specific operations)
Setup time is very high.
Evolution of OS Problems:
Programmers needed to sign-up in advance to use the computer one at a time. Executing a single program (often called job) required substantial time to setup the computer.
A. Simple Batch Systems
Similar jobs are batched and run together with no direct interaction between user and the computer during execution.
Automatic job sequencing
Computers are extremely valuable.
Pre-OS: Resident Monitor
Initial control in monitor Control transfers to job When job completes, control transfers back to monitor
Overlapped CPU and I/O operations
Online Processing – CPU is directly connected to card readers and line printers
Overlapped CPU and I/O operations
Off-line Processing
Spooling
Simultaneous Peripheral Operation Online. Uses disk as input device and for storing output files.
B. Multiprogrammed Batch Systems
OS keeps several jobs in memory at a time and picks and begins to execute one of the jobs in the memory.
Drawback: Causes the computer system to stop executing when the monitor encounters error (bug). Other jobs in the memory will not be executed as well.
C. Time sharing systems Interactive Computing
Allows interaction between user and process. The CPU executes multiple jobs by switching between them but the switches occur so frequently that users may interact with each program while it is running. Monitor
T1
Job 1 Job 2
T2 T3 T4
Job 3 Job n
Time sharing systems Time sharing (or multitasking)
is a logical extension of microprogramming. Job A
Job B
CPU I/O 0
5
10
15
20
25
30
35
40
time
Uniprogramming: Job A and B end at time 36 CPU is idle 47% I/O is idle 53
Time sharing systems Job A
Job B
CPU I/O
0
5
10
15
time
“pure” multiprogramming Job A and B end at time 20.
Sample problem #1: Consider a system designed to run only one
user program at a time. Suppose the user is running a program designed to execute the ff sequence of instructions: while (not end of input) { read from the card reader process the data : : write to the printer : : }
Sample problem #1: Assuming that the computer system has the
following characteristics:
Card reader: 300 cards / min. Line printer : 300 lines / min. CPU : 1 µ s/instruction
Sample problem #1:
Suppose it takes about 10,000 instructions to process each line (one card) of input, then a card will require the ff:
Input phase • (1 min/ 300 cards) x (60,000 ms/min) = 200 ms
Process phase • (10,000 inst) x (1 µ s/inst) = 10 ms
Output phase • (1 min/ 300 cards) x (60,000 ms/min) = 200 ms
CPU utilization = (10 / 410) x 100% = 2.4 %
Therefore, it shows poor CPU utilization
It’s your turn Sample Question #2: Given the following
characteristics of a single-user system:
Card reader Line printer CPU
: 600 cards /min : 100 lines /min : 1 µ sec / instruction
Suppose it takes 1,000 instructions to process each line of input and produce one line of output, compute the CPU utilization, and input and output device utilization.
D. Personal Computer
Personal Computer
computer system dedicated to a single user
I/O devices
User convenience and responsiveness
Adopt technology developed for larger OS often individuals have sole use of computer and do not need advance CPU utilization or protection features
May run several different types of OS
E. Parallel Systems Systems having more than one processor
(multiprocessor systems) in close communication, sharing the common bus, clock, memory and peripheral devices. Tightly coupled; multiprocessing
Advantages of parallel systems Increased throughput Economical Increased reliability
Graceful degradation Fail-safe systems
Types of parallel systems Symmetric multiprocessing model (SMP)
Each processor runs an identical copy of the OS and these copies communicate with each other Many processes can run at once without performance deterioration Most modern OS support SMP CPU 1
CPU2
CPU3
CPU4
Types of parallel systems Asymmetric multiprocessing model (AMP)
Each processor is assigned a specific task; master processor schedules, and allocated work to slave processors. More common in extremely large systems
Master CPU Slaves CPU
F. Distributed Systems
Distribute computation among several processors.
F. Distributed Systems
Loosely coupled systems
Requires networking infrastructure
processors do not share memory or a clock, instead, each processor has its own local memory. LAN or WAN implementations May be either client-server of peer-to-peer systems
Resources on each machine are managed by that machine’s OS and working together to manage the collective network resources
Reasons for building Distributed Systems
Resource sharing Computation Speedup
allows to distribute the computation among various sites. Movement of jobs is called “load sharing”
Reliability Communications
Distributed Systems : Clustered 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.
G. Real-time systems Used as a control device in a dedicated
application
Eg. controlling scientific experiments, medical imaging systems, industrial control systems, and some display systems
Real-time OS
Designed to support execution of tasks within specific clock time constraints. Correctness of a processing task is dependent on the clock time at which the processing occurred
Real-time systems Deadline (time critical) requirement – well-
defined fixed-time constraints.
Eg. Industrial control systems, weapons systems, computer controlled products, ballistic missile control systems, airline reservation systems.
Handheld Systems Personal Digital Assistants (PDA’s) Cellular telephones
Issues • • • •
Limited memory Slow processors Small display screens (still true today?)
H. Embedded Systems Also known as dedicated systems. Perform a specific task only and cannot run a
wide variety of programs unlike generalpurpose systems.
Migration of OS Concepts and Features