0% found this document useful (0 votes)
13 views

Chapter 1 OS

Uploaded by

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

Chapter 1 OS

Uploaded by

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

OPERATING

SYSTEM
WHAT IS AN OPERATING
SYSTEM?
Operating system is a system software that acts
as an interface between user and the computer
hardware.
Operating
System

User
Hardware
WHAT IS AN OPERATING
SYSTEM?
 Operating system is a System
Software.
 Act as interface b/w User and the

Hardware.
 Organized set of programs.

 Controls & manages computer

resources(H/W, S/W).
 Schedules task, manages storage.

 Resource allocator.
TEACHING AND EVALUATION
SCHEME

○ Lectures/week => 2 hours


○ Internal Continuous Assessment (ICA)=> 40
Marks
○ End Semester Exam(ESE) => 60 Marks

Total => 100 Marks


Chapter 1:
Operating System
Overview
CHAPTER 1
 Syllabus
BOOKS TO BE REFERRED
1.Abraham Scilberscatz, Peter B. Galvin and
Greg Gagne, “Operating System Concepts”,
9th edition, Wiley, India Edition, 2016.
2.William Stallings, “Operating Systems:
Internals and Design”, 9th Edition, Pearson,
2018.
POINTS TO BE
COVERED…
 Conceptual view of operating system
 Objectives of operating system

 Examples of OS

 Market share of OS

 Functions of OS

 Evolution of OS

 Characteristics of modern operating

systems
 Basic Concepts
POINTS TO BE
COVERED…
 Conceptual view of operating system
 Objectives of operating system

 Examples of OS

 Market share of OS

 Functions of OS

 Evolution of OS

 Characteristics of modern operating

systems
 Basic Concepts
Conceptual View of
Operating System
User 1 User 2 User n

System Application
Softwares Softwares
Software
Operating System

Hardware CPU RAM I/O


Conceptual View of w/o
Operating System
User 1 User 2 User n

Program
Software

Hardware CPU RAM I/O


Conceptual View of
Operating System
User 1 User 2 User n

System Application
Softwares Softwares
Software
Operating System

Hardware CPU RAM I/O


COMPUTER SYSTEM
COMPONENTS
 Hardware: provides basic computing resources
(CPU, memory, I/O devices).
 Operating system: controls and coordinates the

use of the hardware among the various application


programs for the various users.
 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, word processors, spreadsheets, web
browsers etc).
 Users (people, machines, other computers).
POINTS TO BE
COVERED…
 Conceptual view of operating system
 Objectives of operating system

 Examples of OS

 Functions of OS

 Evolution of OS

 Characteristics of modern operating

systems
 Basic Concepts
OBJECTIVES
OBJECTIVES
 Convenience: An OS makes a computer more
convenient to use.
 Efficiency: An OS allows the computer system

resources to be used in an efficient manner.


 Ability to evolve: An OS should be constructed in

such a way as to permit the effective development,


testing, and introduction of new system functions
without interfering with service.
POINTS TO BE
COVERED…
 Conceptual view of operating system
 Objectives of operating system

 Examples of OS

 Functions of OS

 Evolution of OS

 Characteristics of modern operating

systems
 Basic Concepts
EXAMPLES OF OS
EXAMPLES OF OS
DIFFERENT VERSIONS OF
WINDOWS
DIFFERENT VERSIONS OF WINDOWS
MOBILE OS
• Android OS (Google Inc.)
• BlackBerry OS (Research In Motion)
• iPhone OS / iOS (Apple)
• MeeGo OS (Nokia and Intel)
• Palm OS (Garnet OS)
• Symbian OS (Nokia)
• webOS (Palm/HP)
POINTS TO BE
COVERED…
 Conceptual view of operating system
 Objectives of operating system

 Examples of OS

 Functions of OS

 Evolution of OS

 Characteristics of modern operating

systems
 Basic Concepts
FUNCTIONS OF OPERATING
SYSTEM
FUNCTIONS
Process
Management
PROCESS MANAGEMENT
 Process is a program in execution.
 E.g. Word processing program being run by the user is a

process.
 E.g. System task such as sending output to a printer is

also a process.
 Processes are allocated with resources when it is created

or while it is running.
 Once the process is done with use of resources, OS

reclaims reusable resources. Methods for process


management are:
1) Manual loading mechanism.
2) Batch Processing.
3) Multiprogramming.
4) Multiprocessing.
Memory
Management
MEMORY MANAGEMENT
 Takes care of main memory.
 Main memory is repository of quickly accessible

data shared by CPU and I/O devices.


 Deals with part of memory in use & the memory

part which is not in use.


 Allocates memory to processes & deallocate when

they are done.


File
Management
FILE MANAGEMENT
 Fileis a collection of related info.
 Manages file stored on the disk.

 Provides functions to delete, copy,

move, rename and view files.


 Backup of files on stable(non volatile)

storage.
Security
SECURITY
 Protect resources and information
against destruction & unauthorized
access.
 Types of Security:-

 External Security
 Adequate back-up data

 Internal Security
 User authentication
Device
Management
DEVICE MANAGEMENT
 Manages the peripheral devices.
 Accepts input from the user and
give corresponding output.
 Consist of policies and procedures
for handling I/O devices.
Command
Interpretation
COMMAND
INTERPRETATION
 Act as primary interface between the
user & the rest of the system.
 Understands & executes commands
entered by human beings.
POINTS TO BE
COVERED…
 Conceptual view of operating system
 Objectives of operating system

 Examples of OS

 Functions of OS

 Evolution of OS

 Characteristics of modern operating

systems
 Basic Concepts
EVOLUTION OF OS
EVOLUTION OF OS
EVOLUTION OF OS
SERIAL PROCESSING (1940S –
MID 1950S)
SERIAL PROCESSING (1940S – MID
1950S)(CONT…)
 The serial processing performs operations
in serial manner/FIFO manner.
 All jobs are prepared and stored on the

punched cards.
 After this card will be entered in the

system and all instructions will be


executed one by one.
 In case of an error, the programmer would

examine registers and main memory.


 Output on the printer/punched card.
SERIAL PROCESSING (1940S – MID
1950S) (CONT…)
PROBLEMS
 Setup time – very time consuming

 User can’t interact with the system directly.


SIMPLE BATCH SYSTEMS
(1950S – 1960S)
SIMPLE BATCH SYSTEMS (1950s –
1960s)(CONT…)
 Users of batch OS do not interact with the
computer system directly. Each user prepares
his job on an offline device like punched cards.
And submit it to the computer operator.
 To speed up processing job with similar needs

are batched together and run as a group.


 The programmer leave their programs with

operator and the operator then sorts the


programs with similar requirement into
batches.
 A software known as monitor was used for

automatic loading and running of jobs.


SIMPLE BATCH SYSTEMS
(1950S – 1960S)(CONT…)
 Problems:
 Lack of interaction between user and
job.
 Difficult to provide desired priority.
MULTIPROGRAMMED
BATCHED SYSTEMS
MULTIPROGRAMMED BATCHED
SYSTEMS (CONT…)

 Executes number of programs


simultaneously by a single processor.
 Number of processes resides in main
memory at a time.
 The OS picks and begins to execute one of

the jobs in main memory.


MULTIPROGRAMMED BATCHED
SYSTEMS (CONT…)
 Consider the following figure. Main memory
contains five jobs. CPU executes one by one.
MULTIPROGRAMMED
MULTIPROGRAMMED BATCHED
BATCHED
SYSTEMS
SYSTEMS(CONT…)
(CONT…)
 In non-multiprogramming system, the CPU
can execute only one program at a time.
 If the running program is waiting for any I/O

device, the CPU becomes idle so it will effect


on the performance of the CPU.
 In multiprogramming environment, if any
I/O wait happened in a process, then the CPU
switches from that job to another job in the
job pool. So, the CPU is not idle at any time.
MULTIPROGRAMMED BATCHED
SYSTEMS (CONT…)
 Advantages:

 Can get efficient memory utilization.


 CPU is never idle so the performance of CPU
will increase.
 The throughput CPU my also increase.
 In the non-multiprogramming environment,
the user/program has to wait for CPU much
time.
 Waiting time is limited in multiprogramming.
MULTIPROGRAMMED BATCHED
SYSTEMS
 DISADVANTAGES

User can not interact with the


job when it is executing.
Longer turnaround time.
TIME-SHARING
SYSTEM
TIME-SHARING SYSTEM
 Time-sharing or multitasking is a logical
extension of multiprogramming.
 Multiple jobs are executed by the CPU

switching between them.


 CPU scheduler selects a job from the ready

queue and switches the CPU to that job.


When the time slot expires, the CPU
switches from the job to another.
 CPU time is shared by different processes.

So, it is said to be “Time-sharing System”.


 Time slots are defined by the operating

system.
TIME-SHARING SYSTEM
 Advantages
 Efficient CPU utilization.
 Provides interactive use of a computer system at
a reasonable cost.
 Time shared OS uses CPU scheduling and
multiprogramming to provide each user with a
small portion of time-shared computer.
 User can interact with a job when it is executing,
but it is not possible in batch system.
PARALLEL SYSTEM
PARALLEL SYSTEM(CONT…)
 In parallel system, number of processors
executes job in parallel.
 Parallel OS are used to interface multiple
network computers to complete task in parallel.
 Parallel OS are able to use software to manage

all of the different resources of the computers


running in parallel such as memory, cache,
storage space, processing power.
 Parallel OS works also allow a user to directly

interface with all of the computers in a network.


 Parallel OS works by dividing sets of
calculations into smaller parts and distributing
them between the machine on a network.
PARALLEL SYSTEM
Advantages
Increases throughput.
more work can be done in shorter
period of time by increasing number
of processor.
DISTRIBUTED SYSTEM
DISTRIBUTED SYSTEM
 The processors cannot share a memory or a
clock.
 Each processor has its own local memory.

 The processor communicates with one


another through various communication
lines, such as high-speed buses.
 These systems are called “Loosely coupled”

systems.
DISTRIBUTED SYSTEM(CONT..)
Advantages
 If a number of sites connected by high-speed
communication lines, it is possible to share the
resources from one site to another site.
 For e.g. s1 and s2 are two sites. These are
connected by some communication lines. The
site s1 is having a printer, but the site does not
have any print. Then the system can be altered
without moving from s2 to s1.
 Therefore, resource sharing is possible in the
distributed operating system.
 If a resource or a system fails in one site due to
technical problem, we can use other
systems/resources in some other sites. So the
REAL-TIME SYSTEM
REAL-TIME SYSTEM(CONT..)
 Response time is always fixed.
 Time to display the result after
processing has been fixed by the
processor.
 Real-time systems are used at the
places where higher and timely
response is needed.
 Used in reservation.

 Two types:

 Hard Real Time


 Soft Real Time
REAL-TIME SYSTEM(CONT..)
HARD REAL-TIME SYSTEM
 It guarantees that critical tasks are completed in

time.
 Used with controls and robotics requiring precision

movements.
 Conflicts with time-sharing systems, not supported

by general purpose operating systems.


 Secondary storage limited or absent, data stored

in short term memory, or read-only memory


(ROM).
REAL-TIME SYSTEM(CONT..)
SOFT REAL-TIME SYSTEM
 A critical task gets priority over the other task and

retrains that priority until it completes its


execution.
 Due to lack of deadline support, they are risky to

use for industrial controls and robotics.


 Useful in applications (multimedia, virtual reality)

requiring advanced operating-system features.


POINTS TO BE
COVERED…
 Conceptual view of operating system
 Objectives of operating system

 Examples of OS

 Functions of OS

 Evolution of OS

 Basic Concepts
BASIC CONCEPTS IN OS
STRUCTURE OF OS
MONOLITHIC
STRUCTURE
MONOLITHIC STRUCTURE
 The entire operating system works in the
kernel space in the monolithic system.
 This increases the size of the kernel as well

as the operating system.


 E.g Linux, BSD(Berkely Software Distribution)

 The kernel provides various services such as

memory management, file management,


process scheduling etc. using function calls.
 This makes the execution of the operating

system quite fast as the services are


implemented under the same address space.
MONOLITHIC STRUCTURE
MONOLITHIC STRUCTURE
 In a monolithic kernel, all OS services
run along with the main kernel thread.
 Since there is less software involved it

is faster.
 As it is one single piece of software it

should be smaller both in source and


compiled forms.
 Less code generally means fewer bugs

which can translate to fewer security


problems.
 Most work in the monolithic kernel is

done via system calls.


MONOLITHIC STRUCTURE
Suggested basic structure for the
operating system:
MONOLITHIC STRUCTURE
 This organization suggests a basic structure
for the operating system:
1. A main program that invokes the requested
service procedure.
2. A set of service procedures that carry out
the system calls.
3. A set of utility procedures that help the
service procedures.
MONOLITHIC STRUCTURE
Advantages:
 The execution of the monolithic kernel is
quite fast as the services such as memory
management, file management, process
scheduling etc. are implemented under the
same address space.
A process runs completely in a single
address space in the monolithic kernel.
 The monolithic kernel is a static single

binary file.
MONOLITHIC STRUCTURE
Disadvantages
 If any service fails in the monolithic

kernel, it leads to the failure of the


entire system.
 To add any new service, the entire

operating system needs to be modified


by the user.
MICRO-KERNEL ARCHITECTURE
 A Micro-Kernel Architecture is a minimal
operating system that performs only the
essential functions of an operating system.
System processes perform all other
operating system functions.
 Here the system processes mean Servers.

 A system that contains the server is called

the Client-Server Model.


SYSTEM CALLS
SYSTEM CALLS
 System Calls provide the Interface between
a process and the Operating System.
 These calls are generally available as
Assembly language instruction.
 System Calls can also be made directly

through HLL programs for certain systems.


 UNIX System calls can be invoked directly

from a C or C++ program.


SYSTEM CALLS (CONT…)
 Two modes of operation in which programs
are executed:
 User mode and Kernel mode

Privileged mode
SYSTEM CALLS (CONT…)
 If program is executed in user mode, it
doesn’t have direct access to memory, h/w,
resources.
 If program is executed in Kernel mode, it

has direct access to many resources.


 Drawback of Kernel mode: If program
crashed during execution in kernel mode,
the whole system would crash.
 In user mode it won’t crash entire system.

So user mode is safer mode.


 Some programs in user mode needs direct

access to resources like memory, h/w, etc.


SYSTEM CALLS (CONT…)
 To access these resources program
makes a call to OS.
 Program switches from user mode to

kernel mode. This is known as context


switching.
 Switching back to user mode from
kernel mode is also called as context
switching.
 The call made for this type of switching

is called as System call.


SYSTEM CALLS (CONT…)

Source Destinatio
File n File

Acquire Input Filename

Write prompt to screen

Accept input
SYSTEM CALLS (CONT…)

Source Destinatio
File n File

Acquire Input Filename


Write prompt to screen

Accept input
Acquire output
Filename
Write prompt to screen

Accept input
SYSTEM CALLS (CONT…)

Source Destinatio
File n File

Open input file


If file doesn’t exist,
ABORT.
SYSTEM CALLS (CONT…)

Source Destinatio
File n File

Open input file


If file doesn’t exist, ABORT.
Create output file

If file exist, ABORT


SYSTEM CALLS (CONT…)

Source Destinatio
File n File

loop
Read from input file
Write to output file
Until
read Close output file
fails
SYSTEM CALLS (CONT…)

Source Destinatio
File n File

loop
Read from input file
Write to output file
Until
read Close output file
fails
Write completion message to
screen
Terminate normally
SYSTEM CALLS (CONT…)
Source Destination
File File
Acquire Input Filename
Write prompt to screen
Accept input
Acquire output Filename
Write prompt to screen
Accept input
Open input file
If file doesn’t exist, ABORT.
Create output file
loop If file exist, ABORT
Read from input file
Write to output file
Until Close output file
read Write completion message to
fails screen
Terminate normally
SYSTEM CALLS (CONT…)
Categories of System Calls
System calls can be grouped into five
major
categories as follows.
 Process control
 File management.
 Device management
 Information Maintenance and
 Communication.
SYSTEM CALLS (CONT…)
 Process control
 create process, terminate process
 end, abort
 load, execute
 get process attributes, set process
attributes
 wait for time
 wait event, signal event
 allocate and free memory
SYSTEM CALLS (CONT…)
 File management
 create file, delete file
 open, close file
 read, write, reposition
 get and set file attributes
 Device management

 request device, release device


 read, write, reposition
 get device attributes, set device
attributes
 logically attach or detach devices
SYSTEM CALLS (CONT…)
Information Maintenance
Some system calls under information
maintenance are:
 Get time or date, Set time or date
 Logically attach or detach devices
 Information maintenance
 Get system data, Set Systems data
 Get process, file of device attributes
 Set process, file or device attributes
SYSTEM CALLS (CONT…)
 Communication
 Create, delete communication
connection.
 Send, receive messages
 Transfer status information
 Attach or detach remote devices.

You might also like