Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
2 views

2.2 Introduction to Operating System

Uploaded by

rajsinghvatsalya
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

2.2 Introduction to Operating System

Uploaded by

rajsinghvatsalya
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

PURPOSE OF AN

OPERATING SYSTEM
Introduction to
Operating System
Concepts The purpose of an operating system is
to provide an environment in which a
by user may execute programs.

Dr. Anoop Kumar Gupta


MAIT
1

Abstract view of the components of


WHAT IS AN OPERATING
a computer system SYSTEM?
Users
An Operating System is an interface
Application Programs between user and hardware of a
Operating system computer system.
Computer H/ware
OPERATING SYSTEM What is an Operating System?
 A program that acts as an intermediary
An Operating System is a system
between a user of a computer and the
software which may be viewed as an computer hardware.
organized collection of software
 Operating system goals:
consisting of procedures for operating a  Execute user programs and make solving user
computer and providing an environment problems easier.
for execution of programs.  Make the computer system convenient to use.
 Use the computer hardware in an efficient
manner.

What is OS? What is OS?


 Computer systems typically contain:  An interface between Hardware and User
Hardware and Software Programs
Hardware - electronic, mechanical,  An abstraction of the hardware for all the
optical devices (user) processes
Hide the complexity of the underlying hardware
Software – programs 

and give the user a better view of the computer


 Without support software, the computer
is of little use..  => A MUST!
Abstract View of System
Computer System Components 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).

The OS Operating System Definitions


 Resource allocator – manages and
utilities
applications
software allocates resources.
systems
software
 Control program – controls the
Operating system execution of user programs and
operations of I/O devices .
 Kernel – the one program running
hardware
device device ... device
at all times (all else being
components CPU
memory application programs).
The Goals of an OS The Goals of an OS
 Let users run programs:  Let users run programs:
 Correctness  Efficiency
 Memory boundaries, priorities, steady state  Resource Utilization, resource Sharing,
Multitasking
 Convenience
 User should not handle the tiny details  Fairness (in resource allocation)
(encapsulate/abstract), provide synchronization  Among: users, tasks, resources
primitives, system calls, file system, tools  The tradeoff between efficiency and fairness

OS as System Manager An OS is a Resource Allocator


 The operating system
 Multiple users (?) get all computing resources
 manages the processes “simultaneously”:
 manages the memory  CPU time
Memory (ram, swap, working set, virtual,..)
temporary storage (e.g. buffers)


 File system (storage space)
 more permanent (e.g. disks)
 I/O devices (display, printers, mouse,..)
 manages input and output  Clock
The OS should give every user the illusion that she
 manages security

is getting all resources to herself (not sharing!)
 monitors performance
Virtual Continuity Using Priorities
 A process can get “switched in” or “switched  Most OS’s provide the priority mechanism
out”.  Priorities are associated with processes
 Priority are used to help the OS to reach fairness.
 OS should give the illusion for the process as
if it exists in the CPU continuously
=> Context Switching

The kernel The kernel


 A Kernel is a computer program that is the  Especially with GUI interfaces, operating
heart and core of an Operating System. systems have become rather large
Since the Operating System has control  Once the boot program is loaded into
over the system so, the Kernel also has memory, it in turn loads the essential parts
control over everything in the system. and the more frequently used commands
 The Kernel is responsible for low-level (the kernel) of the operating system
tasks such as disk management, memory  The rest (the external commands) are
management, task management, etc. loaded only when needed
Parameters for Measuring
Process System Performance
 A process is a job or program in execution.  Throughput: Amount of work that the
system is able to do per unit time
 The components of a process are:
 the program to be executed,  Turnaround time: Interval from the time
of submission of a job to the system for
 the data on which the program will execute, processing to the time of completion of
 the resources required by the program—such as the job
memory and file(s)—and
 Response time: Interval from the time of
 the status of the execution. submission of a job to the system for
processing to the time the first response
for 25
1the job is produced by the system

OTHER DEFINITIONS OTHER DEFINITIONS


o An Operating System is a control o An Operating System is a control
program. program.
This program controls the execution
o An Operating System is similar to a o An Operating System
of user is similar
programs to preventtoerrors
a and
Government. improper use of the computer.
Government.
o An Operating System can be defined as a o An Operating System can be defined as a
Resource Manager. Resource Manager.
OTHER DEFINITIONS COMPUTER
HARDWARE & SOFTWARE
o An Operating System
As a resource managerisand
a control
allocator, the OS
will
program. resolve the confliting request for
computer resources(CPU time, memory o H/w - Physical Components of a
o An space, filesSystem
Operating storageis space,
similarinput/output
to a Computer.
devices, etc) from various users or programs.
Government. o S/w – Set of Computer Programs.
o An Operating System can be defined as a
Resource Manager.

COMPUTER SOFTWARE OPERATING SYSTEM


o It is the most fundamental of all the
system programs, which controls all the
computer’s resources and provides the
base upon which the application
System Programs Application Programs
programs can be written.
o Which manages o Which solve
the operations of problems for
the computer their users o It is a layer of s/w on the top of the bare
h/w, which will shield programmers
from the complexity of the h/w.
COMPUTER SYSTEM COMPUTER SYSTEM
Banking Airline Banking Airline
System System Application Programs System System Integrated
Compilers Editors
Command
Compliers Editors
Command circuit chips,
Interpreter Interpreter

System Programs wires, power


Operating System Operating System suppliers,
cathode ray
Machine Language Machine Language
tube, etc.
Microprogramming Hardware Microprogramming

Physical Devices Physical Devices

A Computer system consists of Hardware, A Computer system consists of Hardware, System Programs and
Application Programs
System Programs and Application Programs

COMPUTER SYSTEM COMPUTER SYSTEM


Banking Airline Banking Airline Instructions for moving
System System Directly controls the System System data around the
Compliers Editors
Command physical devices and Compliers Editors
Command machine, doing
Interpreter Interpreter
provides a cleaner arithmetic and
Operating System interface to the next Operating System comparing values. I/O
layer. It interprets the devices are controlled
Machine Language Machine Language
instructions from the by loading values into
Microprogramming above layer and carry Microprogramming
specified device
out them. registers.
Physical Devices Physical Devices

A Computer system consists of Hardware, System Programs and


Application Programs
A Computer system consists of Hardware,
System Programs and Application Programs
COMPUTER SYSTEM COMPUTER SYSTEM
Major function is
The OS runs in kernel
Banking Airline to hide all h/w Banking Airline
System System System System mode but the compilers
Command
complexity and Compliers Editors
Command and editors run in user
Compliers Editors
Interpreter
give the Interpreter
mode. If a user does not
Operating System programmer a Operating System like a particular
more convenient complier, the user is free
Machine Language Machine Language to write his own but he
set of instructions is not free to write his
Microprogramming to work with. Microprogramming
own disk interrupt
Physical Devices Physical Devices handler, which is part of
the OS.

COMPUTER SYSTEM PURPOSE OF AN


Banking Airline
OPERATING SYSTEM
These programs are
System System
written by the users to A computer’s Operating system is a group of
Command solve their particular
Compliers Editors
Interpreter
problems, such as
programs designed to serve two basic
Operating System commercial data purposes:
processing,
engineering  To control the allocation and use of the
Machine Language
calculations, or game computing system’s resources among the
Microprogramming
playing. various users and tasks.
Physical Devices
 To provide an interface between the
A Computer system consists of Hardware, System Programs and
Application Programs
computer hardware and the programmer.
TYPES OF OPERATING TYPES OF OPERATING
SYSTEM SYSTEM
Distinguished by the nature of interaction Distinguished by the nature of interaction
that takes place between the computer that takes place between the computer
user and his/her program during its user and his/her program during its
processing. processing.
 Batch Operating System  Batch Operating System

Users submit jobs to a central place where these jobs are collected
 Time-Sharing Operating System  a Time-Sharing
into Operating
batch, and subsequently placed on System
an input queue at the
computer where they will be run. The user has no interaction with
the job during its processing. The computer’s response time is the
 Real-Time Operating System  Real-Time
turnaround Operating
time- the time System
from submission of the job until
execution is complete, and the results are ready for return to the
person who submitted the job.

TYPES OF OPERATING Time-Sharing Systems –


SYSTEM Interactive Computing
Distinguished by the nature of interaction
that takes
Computer place
provides between
computing thetocomputer
services several or
 The CPU is multiplexed among several jobs that are
many
user and his/her program during itsare
users concurrently on-line. Various users
sharing the central processor, the memory and other kept in memory and on disk (the CPU is allocated to
processing. a job only if the job is in memory).
resources of the computer system. The user has full
Batch Operating
 interaction System
with the program during its execution.  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
 Time-Sharing Operating System
finishes the execution of one command, it seeks the
next “control statement” from the user’s keyboard.
 Real-Time Operating System  On-line system must be available for users to access
data and code.
TYPES OF OPERATING Buffering & Spooling
SYSTEM
Distinguished by the nature of interaction Buffering and Spooling:
that takes place between the computer More ways to overlap CPU with
A RTOS is designed to support execution of tasks within
user and his/her program during its
specific wall clock time constraints. Use of RTOS is slower operations.
processing.
mostly limited to dedicated applications such as industrial Buffering:- overlap computing with
Batch
 control Operating
systems, System
weapon systems and computer-
controlled products. RTOS is managing the resources so I/O for same job.
that a particular operation executes in precisely the same
Spooling:- overlap computing with
 amount of time every time
Time-Sharing it occurs. System
Operating
I/O for different jobs.

 Real-Time Operating System

Spooling Spooling
Acronym of “Simultaneous Peripheral When there is a resource (like printer) to be
Operation On-Line”. accessed by two or more processes(or
Its a process of placing data in temporary devices), there spooling comes handy to
working area for another program to schedule the tasks. Data from each process
process. is put on the spool (print queue) and
E.g.: Print spooling and Mail spools etc. processed in FIFO(first in first out) manner.
Spooling MULTI PROGRAMMING

A multiprogramming operating system is


a system that allows more than one
active user program to be stored in
main memory simultaneously.

Time-sharing systems are


multiprogramming systems.

MULTI PROGRAMMING
Uniprogramming System

Multiprogramming: Main memory

• Multiprogramming was used as a Operating OS area

technique to enhance the throughput system

efficiency.
User job User program area

• More than one job is “ready” at the Execution in


same time. progress

CPU

Only one job is processed by the system at a time and all


the system resources are exclusively available for the job
until it completes
Multiprogramming System Process States in Multiprogramming

Main memory

Operating system
Job is allocated the
New CPU for execution Job
job Ready Running processing
Writing output data Job A
completed
Job B

Job C (Waiting for I/O completed Job must wait for I/O
Secondary disk storage CPU) Blocked completion

Execution in
progress
CPU

Requirements of Different types of


Multiprogramming Systems Multiprogramming Operating
System
 Large memory
• Multitasking operating system
 Memory protection
 Job status preservation
• Multiprocessing operating system
 Proper job mix (CPU and I/O bound jobs) • Multi-user operating system
 CPU scheduling
Different types of Classification of Operating
Multiprogramming Operating Systems on functional basis
System
 Operating systems may be
• Multitasking operating system distinguished in whether they allow
 multi-tasking
• Multiprocessing operating system
 multi-threading
• Multi-user operating system
 multi-users
More than one active user programs to be stored in the
main memory.  multi-processors

Multi-tasking Types of multi-tasking


 A task or process is a program or part of  context switching: only one process is
a program the user wants executed active, but the status of the other process
 Modern operating systems are multi- is preserved
tasking in that they execute two or more  cooperative multitasking: switching occurs
applications running simultaneously at natural breaks in the process, but one
(actually they switch back and forth application can take over
between the applications)  preemptive multi-tasking: tasks are
 Older single-tasking operating systems prioritized and looked in on often so that
could only do one thing at a time one of them does not monopolize the CPU
Multithreading Multithreading System

 Thread is basic unit of CPU utilization. Threads share a


Address
CPU in the same way as processes do space
Thread
Address
space
Thread Thread Thread
 All threads of a process also share the same set of
operating system resources
 All threads of a process inherit parent’s address space
and security parameters
 Each thread of a process has its own program counter, (a) Single-threaded and (b) multithreaded
its own register states, and its own stack processes.
 Referred as mini-process or lightweight process A single-threaded process corresponds to a process
of a traditional operating system.

Different types of
Multiprogramming Operating Multi-processor
System
 If a single CPU is insufficient for your
• Multitasking operating system computing purposes, you may need an
operating system which can coordinate
• Multiprocessing operating system
a number of CPU’s (processors)
• Multi-user operating system
 asymmetric: different tasks assigned to
different CPU’s each with its own
A computer hardware configuration that includes more than
one independent processing unit.
memory
 symmetric: tasks and memory shared
equally among CPU’s
Multi-threading and Multi-user Parallel Systems (Cont.)
Symmetric multiprocessing (SMP)
Multi-threading: similar to multi-tasking


 Each processor runs an identical copy of the operating
but takes place within a single system.
application, e.g. one wants to take in  Many processes can run at once without performance
typed information and see it on the deterioration.
screen simultaneously  Most modern operating systems support SMP
 Asymmetric multiprocessing
 Multi-user: having more than one user,  Each processor is assigned a specific task; master
operating systems for work stations, processor schedules and allocated work to slave
mainframe, mini and supercomputers processors.
allow for more than one user  More common in extremely large systems

Multiprocessor systems - NETWORK OPERATING


Parallel Systems SYSTEM
 Multiprocessor systems with more than on CPU in close The Software that enhances a basic
communication.
Operating System by adding Networking
 Tightly coupled system – processors share memory and a
clock; communication usually takes place through the shared Features.
memory.
 Advantages of parallel system:
Examples: Novell Netware,
 Increased throughput WINDOWS NT
 Economical

 Increased reliability

 graceful degradation

 fail-soft systems
Networking Operating System Distributed Operating System
• A networked computing system is a A distributed computing system
collection of physical interconnected consists of a number of computers
computers. that are connected and managed so
• The OS of each of the
interconnected computers must
that they automatically share the job
contain provisions for handling processing load among the
communication and transfer of constituent computers, or separate
program and data among the other
computers, in addition to its own the job load as appropriate
stand-alone functionality. particularly configured processors.

DISTRIBUTED OPERATING
SYTEM Distributed Systems
Distributed operating system is one  Distribute the computation among several physical
processors.
that looks to its users like an ordinarily  Loosely coupled system – each processor has its own local
memory; processors communicate with one another through
centralized operating system but runs various communications lines, such as high-speed buses or
telephone lines.
on multiple independent CPU’s. Key  Advantages of distributed systems.
 Resources Sharing

concept is TRANSPARENCY.  Computation speed up – load sharing

 Reliability

 Communications
General Structure of Client-
Distributed Systems (cont) Server

 Requires networking infrastructure.


 Local area networks (LAN) or Wide
area networks (WAN)
 May be either client-server or peer-
to-peer systems.

Networked vs. Distributed


In n/w OS, the users are aware of the existence
of multiple computers and can log in to remote
machines and can copy files from one machine
to another ……
DOS appears to its users as a traditional uni-
processor system, even though it is actually
composed of multiple processor..
Transparency- users should not be aware of
where their programs are being run or where
their files are located ….

You might also like