Advance Operating System: Introduction To Operating Systems

You might also like

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 27

Advance Operating System

Introduction to Operating
Systems
Introduction to Operating Systems

 What is an Operating System?


– Not always a clear definition as to what constitutes an OS.
– A program that acts as an intermediary between a user of a
computer and the computer hardware.
 Operating system goals:
 Execute user programs and make solving user problems
easier.
 Make the computer system convenient to use.
 Use the computer hardware in an efficient manner.
Operating System Definitions

 Resource Allocator : Manages and allocates


resources.
 Control Program : Controls the execution of
user programs and operations of I/O devices.
 Kernel – the one program running at all
times.
OS Features Needed for Multi-
programming

 I/O routine supplied by the system.


 Memory management : The system must
allocate the memory to several jobs.
 CPU scheduling : The system must choose
among several jobs ready to run.
 Allocation of devices.
Different ways of Operation

 Single-User Environment
 One User at a time
 Initially, running only one program at a time
 Now, Single-User PC allows several Programs to
run at the same time (e.g., Windows 95, Mac
System 7.x, OS/2)
 Can have WP(Word Processor and Spread Sheet
open at same time and `switch' between them.
Different ways of Operation

 Multi-Access/Multi-user Environments
 Many users logged in at same time (e.g., via
campus network or Internet)
 Same application run several times, or many
different application run at the same time
 Each user appears to have all systems resources
available
Different ways of Operation

 Multi-tasking/Multi-processing
 Definition “A process is an instance of a
program in execution”
 Processes are run apparently in parallel by
sharing system resources
 Multi-tasking does not imply Multi-user.
Different ways of Operation

 Multi-programming
 Multi-tasking + instructions / data from different
processes co-resident in memory
Reasons for different operating
requirements

 Many users interactively using same computer


system for many different tasks.
 Many Users running the same program e.g.,
Flight reservations.
 Few Users, or fully automated system, mainly for
checking system status e.g., real-time system.
 Batch system e.g., only supervisor interacts with
system
 General Purpose OS: Allows interaction and
batch processing.
Computer System

 Processor: Performs data processing


 Main memory: Stores both data and programs, typically
volatile
 Disks: Secondary memory devices which provide persistent
storage
 Network interface: Inter-machine communication
 Bus: Intra-machine communication

Memory Bus (processor-memory)

I/O Bus (disks, network interfaces, other I/O
devices, memory-bus)
Basic computer structure

CPU Memory

memory bus

I/O bus

Disk Net interface


Multiprocessors

CPU CPU
cache cache Memory

memory bus

I/O bus

disk Net interface

 Simple Scheme: More than one processor on the same bus


 Memory is shared among processors
 Alternative: System interconnection
 Single-image operating systems
Multiprocessors

 Multiprocessors are of two types


– Asymmetric multiprocessing (Master-Slave)
– Symmetric multiprocessing (SMP)
 Tandem: Uses both hardware and software
duplication to ensure continued operation despite
faults.
 Blade Servers: Multiple processor boards, I/O
boards, networking boards are placed in the same
chassis.
Multi-Computers

CPU CPU
cache Memory cache Memory

memory bus memory bus

I/O bus I/O bus


network
Disk Net interface Net interface Disk

 Network of Computers: “Share-Nothing” Cheap


 Communication through message passing: Difficult to program
 Each system runs its own operating system
History of OS

 First generation: 1945–55


 Human Operator-Programmer-User
– The machine was run from a console that had
display lights, toggle switches, a plug board or
punched cards, and a printer
– The programmer also “operated” the machine as
she/he interacted directly with the bare hardware
– Programs were entirely written in machine or
assembly language
– One running program had complete control of the
entire computer
History of OS
 Second generation: 1955–65
 Separation between operators and
programmer
– First commercially viable machines: Developed by
GM (IBSYS).
– The programmer prepares her/his job off-line on
punched cards, brings the card deck to the
machine room and waits for results
– The human operator runs the job and delivers a
printed output
 Problem: Serial processing
 Solution: Batch Processing
History of OS

 Third generation: 1965-80


 Problem: Despite batching, a lot of CPU time is still
wasted waiting for I/O instructions to complete
 UNIX was released in 1970. V6.0 in 1976 and V7.0 in
1978.
 Fourth generation: 1980-Present
 Released Dos 1.0 in 1981.
 In 1990 Windows 3.0.
What is an Operating System

Application (user)

Operating System

Hardware
 A software layer between the hardware and the application
programs/users which provides a virtual machine interface: Easy
and Safe
 A resource manager that allows programs/users to share the
hardware resources: Fair and Efficient
How does an OS works

Application (user) System Calls Up calls


Hardware independent
OS
Hardware dependent Commands Interrupts

Hardware
 Receives requests from the application: System calls
 Satisfies the requests: May issue commands to hardware
 Handles hardware interrupts: May upcall the application
Files

Application/User: copy file1 file2 Naming, Protection,


Operations on files
Operating System: files, directories
Operations on disk
Hardware: Disk blocks...

 Traditional approach: OS does disk block allocation and caching


(buffer cache) , disk operation scheduling and replacement in the
buffer cache
 New approaches: Application-controlled cache replacement, log-
based allocation (makes writes fast)
Traditional File System

Application: Read/Write Files

OS: Translate file to disk blocks

Maintains buffer cache

Controls Disk Accesses: Read/Write Blocks

Hardware:
Mechanism Vs Policy

Application (user)

Operating System: Mechanism + Policy

Hardware

 Mechanism: Data structures and operations that implement the


abstraction.
 Policy: The procedure that guides the selection of a certain course
of action from among alternatives.
Application-Controlled Caching

Application: Read/Write Files Replacement Policy

OS: Translate file to disk blocks

Maintains buffer cache

Controls disk accesses: Read/Write Blocks

Hardware:
Traditional OS structure

 Monolithic/layered systems

One/N layers all executed in “kernel-mode”

Good performance

user
User process
System Calls
OS Kernel file memory
system system

Hardware
Micro-kernel OS

client file memory


User Mode process server server

Micro-Kernel IPC

Hardware

Client-Server model, IPC between clients and servers

The micro-kernel provides protected communication

OS functions implemented as user-level servers

Flexible but efficiency is the problem

Easy to extend for distributed systems
Extensible OS kernel

process process
User Mode

user default
Extensible Kernel memory memory
service service

Hardware

User processes can load customized OS services into
the kernel

Good performance but protection and scalability
become problems
Introduction to Operating Systems

END OF LECTURE

You might also like