Lecture 26: Operating systems – An Overview
Objectives of this lecture
q Learn what an Operating system (OS) is
q Differentiate between single user and multi-user OS
q Differentiate between Batch and Time Sharing OS
q Learn about Scheduler and Scheduling Algorithms
q Protection and Security
What is an OS?
q A general computing environment can be viewed as
consisting of the following four main components
Ø
Clients or users (e.g., people, machines, other
computers) trying to use the resources to
solve problems
Ø
Application programs (e.g., text editors, compilers,
video games, databases, business software)
which define how the resources can be used to solve computing problems
Ø
An operating system (OS)
(a computer program) which acts as an intermediary between the users and
the hardware. The purpose of the OS is to provide an environment for a user to
execute programs conveniently and efficiently
Ø
A computer hardware (consisting of CPU, Memory, I/O
devices) which provides the basic
computing resources.
Evolution of Operating Systems
q Before compilers were developed:
Ø
programmers had to
reserve a computer in order to use it.
Ø
programs had to be
manually loaded into memory by the programmers
Ø
physical switches and
display lights were used to monitor program execution
q Early FORTRAN, COBOL and other compilers:
Ø
programming made much
easier which is a good thing
Ø
however, the problem of
operating the computer was not solved
Ø
for example, since
application programs were normally kept on tapes, one had to take the following
steps to run a FORTRAN program (at that time):
i.
mount the FORTRAN
compiler tape on the tape drive in order to load the compiler
ii.
read the program through
the card reader and write it onto another tape
iii.
load an assembler tape
to assemble the assembly code from the FORTRAN compiler
iv.
link the assembled code
with other library routines, load the program to memory and run
q CPU idle-time problems
Ø
the process above of
loading, compiling and executing a program is called set-up time
Ø
notice that the CPU
remains idle during this process, which is highly undesirable. Why?
Ø
professional computer
operators (rather than programmers themselves) were hired to improve computer
utilization
Ø
a drawback of computer
operators is that they may not be able to debug users' programs.
q Reducing set-up time: (batch processing)
Ø
Batch
processing is the process of grouping
programs with similar requirements (e.g.,
programs requiring a FORTRAN compiler) and running them through the computer as
a group.
Ø
Batch processing reduces
set-up time but does not eliminate it; we still need a more effective way of
minimizing this further
q Automatic job sequencing (beginning of OS)
Ø
notice that set-up
delays are still a problem even with professional computer operators and batch processing,
especially when there are many errorneous programs
Ø
a resident monitor is a
small program which automatically transfers control from one job to another
Ø
when the computer is
switched on, the resident monitor is invoked which transfers control to a
program. When the program terminates, it transfers control to the resident
monitor which transfers control to the next job and so on
Operating Systems: What do they do?
q an OS manages the operation and control of a computer
system. For e.g., the management of I/O resources, storage and other devices
needed for the system to work
q an OS serves several purposes like the loading of
software programs into main memory for execution
q an OS establishes a command-processor interface
enabling the user to communicate with the computer
q ther interface between the user and the processor can
be based on command words or as operations shown visually as pictures called
icons, depending on the OS
q execution of a compiled C program starts with the OS
calling the main() function in the program etc.
Batch OS
q computer OS of the late 1950s did not allow human
interaction with a job while the job was being processed
q processing in these older OS where only one job could
be processed at a time is called batch processing
q with time, demand arose for interactive processing
where a computer could respond to users while in a processing state
q since there is no interaction in batch systems,
programs must be debug statically
Single User OS
q These are OS that allow only one user to work on a
computer at a time. E.g. MSDOS, and Windows95/98
q They were developed as a result of the popularity of
Personal Computers (PC)
q The early versions of these OS (e.g. MSDOS) accept
commands only in text format – thus the user has to memorize the commands and
he also has to type them.
q They allow only one program to execute at a time.
q Recent Single user systems (Windows 95/98, Apple Mac)
provides graphical user-interface where by the user issue commands to the
computer by means of pointing and clicking on pictures called icons.
q They also provides multi-tasking capabilities – more
than one program running at a time
.
Multi-User Time Sharing OS
q multi-user OS were developed in the 1960s as a result
of the high cost of single computers
q multi-user OS (e.g UNIX ) allow several users to run
the same computer at the same time
q multi-user OS are said to operate in a time-shared
environment because they allow the processing power of of the CPU to be shared
by many users
q They are also multi-tasking as they allow more than
one tasks to be processed at the same time on the same computer
q a multi-user OS consists of two main software
components called the scheduler and the dispatcher
q the scheduler arranges the order in which commands are
executed on the computer. The dispatcher gives control of the CPU to a job
already scheduled by the scheduler
q the OS also acts as a resource allocator for both
hardware and software by managing memory and file spaces, managing requests for
CPU and I/O usage etc.
Scheduling Algorithms
q scheduling is the process of selecting a program from the ready
queue that will take control of the CPU
q in other words, a scheduling algorithm determines
access to the CPU
q clearly, there are many possible job scheduling
arrangements e.g., is a scheme which
allows every job to execute to completion before the next job starts?
q a preemptive algorithm allows a job to be stopped
after executing for some time or because a higher priority job has arrived. A
Nonpreemptive algorithm does not allow such stoppage.
q FIFO, priority (e.g., shortest-job-first (SJF))
algorithms etc
Protection and Security
q a multi-user, time-shared and interactive OS is more
complex than a batch processing, single-user OS. Why?
q resource allocation in a single-user system is
relatively simple although it needs to keep mutiple tasks from interfering with
each other, too
q an important consideration in a multi-user OS is the
necessity to protect the integrity of the system and of the users of the system
as well
q an OS can implement computer security by allowing
access to only authorised users
q protection is the method or how the system is guarded
and security is the measure of protection taken to provide who has the right to
access the system
q in other words, protection is the mechanism for
controlling the access of programs, processes, or user to the resources defined
by a computer system.
q protection can improve reliability by detecting errors