F2032 FUNDAMENTALS OF OPERATING SYSTEM F2032 - Fundamentals of Operating System.
-
Upload
oswin-oneal -
Category
Documents
-
view
240 -
download
2
Transcript of F2032 FUNDAMENTALS OF OPERATING SYSTEM F2032 - Fundamentals of Operating System.
F2032FUNDAMENTALS OF OPERATING SYSTEM
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
COURSE ASSESSMENT OUTLINE
PB – 50% PA – 50%
Pre-requisite – F1031 Computer Hardware
Quiz – 5 Assignment – 3 Lab – 5 Test – 2 (Theory Test) Tutorial Exercise – 3
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
CH
AP
TER
ON
E - IN
TR
OD
UC
TIO
N T
O O
PER
ATIN
G
SY
STEM
This topic introduces the terms and basic concept of operating system. The topic describes the various types of Operating System, the Interface between operating system and its application programs (System Calls)
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
INTRODUCTION
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
WHAT IS AN OPERATING SYSTEM?
OS controls the execution of application programs and acts as an interface between applications and the computer hardware
Objectives: to make a computer more convenience to use to efficiently use the computer system resources to permit the effective development, testing and
introduction of new system functions without interfering with service
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
HISTORY OF OPERATING SYSTEM
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
HISTORY OF OPERATING SYSTEM
1st GenerationVacuum tubes &
plug boards 2nd Generation
Transistors & batch systems
3rd Generation ICs &
multiprogramming 4th Generation
Personal computers
F2032 - Fundamentals of Operating System
1ST GENERATION (1945–55)
Around mid-1940s, Howard Aiken at Harvard, John von Neumann at the Institute for Advanced Study in Princeton, J. Presper Eckert and William Mauchley at the University of Pennsylvania, and Konrad Zuse in Germany, among others, all succeeded building calculating engines.
Used mechanical relays and later replaced by vacuum tubes.
Cycle times measured in seconds.
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
CONT 1ST GENERATION Single group of people designed, built,
programmed, operated and maintained each machine.
All programming done in absolute machine language.
Use plugboards to control machine’s basic functions.
Problem solved were straightforward numerical calculations (sines, cosines, logarithm).
Early 50s, used punch cards (possible to write programs on cards)
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
2ND GENERATION (1955-65)
Built up from individual transistors. Called mainframes. Became reliable enough to be
manufactured and sold but very expensive.
Clear separation between designers, builders, operators, programmers and maintenance personnel.
Programmer – write program on paper then punch it on the cards.
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
CONT 2ND GENERATION
a) Programmer bring cards to 1401b) 1401 reads batch of jobs onto tapesc) Operator carries input tape to 7094d) 7094 does computinge) Operator carries output tape to 1401f) 1401 prints output
Figure 1 : An early batch system
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
3RD GENERATION (1965-80)
Technology: Integrated circuits Programming: Punched cards Programming languages: FORTRAN &
Assembly Tasks: Scientific & commercial Computers: IBM 360, DEC PDPs OS: Multiprogramming/timesharing, spooling
UNIX POSIX LINUX
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
4TH GENERATION (1980-PRESENT)
Personal computers. Technology: Very-large-scale integration
(VLSI) Programming: High level Programming languages: C/C++, Java, …… Computer: PC OS: Windows, MacOS, Linux ……
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
TYPES OF OPERATING SYSTEM
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
EVOLUTION OF OS
Serial Processing
Simple Batch Systems
MultiprogrammedBatch Systems
Time-Sharing Systems
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
SERIAL PROCESSING
No operating system The programmer interacted directly
with the computer hardware Machine run from a console, consisting
of display lights, toggle switches, input device and a printer
These systems presented two main problems:scheduling – result in wasted computer
idle time or insufficient allotted timerequires a considerable amount of setup
time
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
BATCH OPERATING SYSTEM
introduced to improve utilization use a software known as the monitor (user
no longer has direct access to the machine) tasks are performed in batches OS waits for a batch of tasks to arrive and
performs the operation on the batch The workflow:
user submit a job (written on card or tape) to a computer operator
computer operator place a batch of several jobs on a input device
Monitor manages the execution of each program in the batch
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
CONT BATCH OS..
Monitor reads jobs one at a time from the input device.
Monitor places a job in the user program area.
Each program is constructed to branch back to the monitor when it completes processing the monitor would automatically
begin loading the next program
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
CONT BATCH OS..
Machine time alternates between execution of user programs and execution of the monitor
Drawbacks: some main memory is now given over to the
monitor some machine time is consumed by the monitor both of these are forms of overhead
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
UNIPROGRAMMING
The processor is often idle. I/O devices is slow compared to the
processorthe processor spends a certain amount of
time executing until it reaches an I/O instruction
it must wait until that I/O instruction concludes before proceeding
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
MULTIPROGRAMMING OPERATING SYSTEM
multiple jobs are performed by the operating system simultaneously at a timewhen one job needs to wait for I/O, the processor
can switch to the other job – no waiting for I/O Multiprogramming uses hardware that
supports I/O interrupts and DMA (direct access memory)
Memory management is needed – requires scheduling algorithm
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
CONT MULTIPROGRAMMING OS
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
CONT MULTIPROGRAMMING OS
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
DISTRIBUTED OPERATING SYSTEM
different processors that are loosely coupled operate on different jobs and communicate with each other F
20
32
- Fu
nd
am
en
tals o
f Op
era
ting
Syste
m
OPERATING SYSTEM PRODUCT
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
OPERATING SYSTEM PRODUCT
Windows Linux Mac Sun
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
WINDOWS OPERATING SYSTEM
Windows 3.0 Windows 95 Windows 98 Windows 2000 Windows ME Windows XP Windows Vista Windows 7
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
WINDOWS OPERATING SYSTEM
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
LINUX OPERATING SYSTEM
Unix-like operating systems based on the Linux kernel originally written in 1991 by Linus Torvalds
Open source
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
MAC / APPLE
established on April 1, 1976 by Steve Jobs, Steve Wozniak, and Ronald Wayne Apple I, II Apple Lisa Macintosh Mac iMac Macbook Macbook air
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
CONT APPLE
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
First Apple computer : Apple I
SUN OPERATING SYSTEM
UNIX-based operating system
SunOS then succeeded by Sun Solaris
Open source under OpenSolaris project
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
HARDWARE COMPATIBILITY AND MINIMUM REQUIREMENT FOR AN OS
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
95 98 ME XP VISTA 7
Proc 486 486DX-66Mhz
150 Mhz Pentium
300Mhz
1Ghz 1Ghz
Memory
4Mb 16Mb 32Mb 128Mb 1Gb 1Gb
Video n/a VGA VGA SVGA DX9/128Mb
DX9/WDDM 1.0
HD 50Mb 195Mb 320Mb 1.5Gb 15Gb free 16Gb free
NETWORK OPERATING SYSTEM
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
NETWORK OPERATING SYSTEM
NOS is software that controls the operations of a computer, including local hardware activities and communication over network media
Most NOS are multitasking systems because they must support both local and remote activities
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
CONT NOS…
Important features of NOS:- connect all machines and peripherals into a
network.
coordinates and controls the functions of machines and peripherals across the network.
support security and privacy for network and local.
control access to resources depends on user authentication.
manages resources from centralized directory.
gives ability to share resources
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
SHELL PROGRAM, MENU DRIVEN SYSTEM AND
GRAPHICAL USER INTERFACE
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
SHELL PROGRAM
program that provides the traditional, text-only user interface for operating systems.
Its primary function is to read commands that are typed into a console (i.e., an all-text display mode) or terminal window (an all-text window) in a GUI (graphical user interface) and then execute (i.e., run) them
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
CONT SHELL PROGRAM
What is shell? derives its name from the fact that it is an outer
layer of an operating system. A shell is an interface between the user and the internal parts of the operating system (at the very core of which is the kernel).
E.g.: Windows command prompt Windows Powershell Unix Shells Appescript
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
MENU DRIVEN SYSTEM
interactive computer system in which the operator requests the processing to be performed by making selections from a series of menus
OR A program that obtains input from a user by
displaying a list of options E.g.:
Automatic Teller Machine Washing Machine
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
CONT MENU DRIVEN SYSTEM
advantages: firstly, because input is via single key
strokes, the system is less prone to user error;
secondly, because only a limited range of characters are “allowed”, the way in which the input is to be entered is unambiguous.
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
GUI
An interface for issuing commands to a computer utilizing a pointing device, such as a mouse, that manipulates and activates graphical images on a monitor
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
CONT GUI..
replaced the character-based display with a graphics display
eliminated the need to enter cryptic commands in a required sequence.
fonts could be changed and resized on screen, providing a what-you-see-is-what-you-get (WYSIWYG) capability for creating printed materials
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
COOPERATIVE MULTITASKING, PREEMPTIVE MULTITASKING,MULTITHREADING
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
COOPERATIVE MULTITASKING
Also known as non-preemptive multitasking Current running task to give up the processor to
allow other tasks to run Cooperative multitasking requires the
programmer to place calls at suitable points in his code to allow his task to be descheduled
If a task does not allow itself to be descheduled all other tasks on the system will appear to "freeze" and will not respond to user action
Advantage: the programmer knows where the program will be
descheduled and can make sure that this will not cause unwanted interaction with other processes
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
PREEMPTIVE MULTITASKING
multitasking model in which the operating system takes control away from a program and gives it to another program, in order to ensure that all applications get their fair share of time
creates a time-shared environment in which running programs receive a recurring slice of time from the CPU
Advantages: When running software that heavily loads the CPU,
the rest of the system doesn't become unresponsive while the program is doing something.
Programs don't have to be written to stop in the middle of what they're doing to preserve system responsiveness, as the OS does this for them. This makes development simpler
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
MULTITHREADING
The ability of an operating system to execute different parts of a program, called threads, simultaneously.
Threads are bound to a single process Each process may have multiple threads of
control within it. The address space of a process is shared among
all its thread No system calls are required to cooperate among
threads Simpler than message passing and shared
memory
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
CONT MULTITHREADING
Takes less time to create a new thread than a process
Less time to terminate a thread than a process
Less time to switch between two threads within the same process
Since threads within the same process share memory and files, they can communicate with each other without invoking the kernel
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
CONT MULTITHREADING
E.g: in spreadsheet program, one thread could display
menus and read user input, while another thread executes user commands and updates spreadsheet
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
OPERATING SYSTEM STRUCTURE
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
OPERATING SYSTEM STRUCTURES
Monolithic System Layered System Virtual Machine Client Server Model
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
MONOLITHIC SYSTEM
Most primitive form of the OS Practically no structure Characterized by a collection of
procedures that can call any other procedure
Does not allow information hiding (private functions for procedures)
Services provided by putting parameters in well-defined places and executing a supervisory call.
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
CONT MONOLITHIC SYSTEM Application are separated from the OS itself
OS code run in privileged processor mode (kernel mode), with access to system data and to the hardware
Apps run in non-privileged mode (user mode), with limited set of interfaces and limited access to system data
Delivers better apps performance Problems with monolithic structure
Difficult to maintain Difficult to take care of concurrency due to
multiple users/jobs Example: CP/M , DOS
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
CONT MONOLITHIC SYSTEMF
20
32
- Fu
nd
am
en
tals o
f Op
era
ting
Syste
m
LAYERED SYSTEM Organizes the OS as a hierarchy of layers –
one module above the other Interaction only takes place between
adjacent layers (above and below) Interface functions at any particular level can
invokes services provided by lower layer, not the other way around
Example:UNIXMultics
layers are organized as a series of concentric rings
inner rings more privileged
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
CONT LAYERED SYSTEMF
20
32
- Fu
nd
am
en
tals o
f Op
era
ting
Syste
m
VIRTUAL MACHINES
A virtual machine takes the layered approach to its logical conclusion. It treats hardware and the operating system kernel as though they were all hardware.
A virtual machine provides an interface identical to the underlying bare hardware.
The operating system creates the illusion of multiple processes, each executing on its own processor with its own (virtual) memory.
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
CONT VIRTUAL MACHINES..
The resources of the physical computer are shared to create the virtual machines.CPU scheduling can create the
appearance that users have their own processor.
Spooling and a file system can provide virtual card readers and virtual line printers.
A normal user time-sharing terminal serves as the virtual machine operator’s console.
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
CONT VIRTUAL MACHINES..
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
CONT VIRTUAL MACHINES.. Modes:
virtual user mode and virtual monitor mode,
Actual user mode and actual monitor mode Time
Whereas the real I/O might have taken 100 milliseconds, the virtual I/O might take less time (because it is spooled) or more time (because it is interpreted.)
The CPU is being multi-programmed among many virtual machines, further slowing down the virtual machines in unpredictable ways.
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
CONT VIRTUAL MACHINES..
Two advantages To provide a robust level of security
no direct sharing of resources. Two solutions
To allow system development to be done easily
A perfect vehicle for OS research and development.
difficult to implement due to the effort required to provide an exact duplicate to the underlying machine.
Wine for Linux.
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
CLIENT SERVER MODEL
Also known as microkernel OS The idea is:
Only absolutely essential core OS functions should be in kernel
Less essential services and apps are built on the microkernel & execute in user mode
Microkernel architecture: horizontal instead of vertical
Example: Windows 95/NT, Exokernel
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
CONT CLIENT-SERVER MODEL
Characteristic Horizontal instead of vertical Message passing facilities Subsystems – POSIX, database, file, network
server Extensible Reliable Object Oriented Operating System
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
CONT CLIENT-SERVER MODEL
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
OS SUBSYSTEM Process Management File Management Memory Management
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
PROCESS MANAGEMENT
Principal function of a processor is to execute machine instruction resided in main memory
Interleave the execution of several processes to maximize processor utilization while providing reasonable response time
Also known as task, a program in execution, an instance of a program running on a computer
Can be traced list the sequence of instructions that execute
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
CONT PROCESS MANAGEMENT
The operating system is responsible for the following activities in connection with process management.Process creation and deletion.process suspension and resumption.Provision of mechanisms for:
process synchronization process communication
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
FILE MANAGEMENT
A file is a collection of related information defined by its creator. Commonly, files represent programs (both source and object forms) and data.
The operating system is responsible for the following activities in connections with file management: File creation and deletion. Directory creation and deletion. Support of primitives for manipulating files and
directories. Mapping files onto secondary storage. File backup on stable (nonvolatile) storage
media.
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
MEMORY MANAGEMENT Is the task carried out by the OS and
hardware to accommodate multiple processes in main memory
If only a few processes can be kept in main memory, then much of the time all processes will be waiting for I/O and the CPU will be idle
Hence, memory needs to be allocated efficiently in order to pack as many processes into memory as possible
In most schemes, the kernel occupies some fixed portion of main memory
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
SYSTEM CALLS
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem
SYSTEM CALLS
System calls provide the interface between a running program and the operating system
Most operations interacting with the system require permissions not available to a user level process, e.g. I/O performed with a device present on the system or any form of communication with other processes requires the use of system calls
F2
03
2 - F
un
da
me
nta
ls of O
pe
ratin
g S
ystem