Sei sulla pagina 1di 58

Advanced Operating System

Introduction
Grading

 Attendance
 75% required
 Absence is marked after 10 minutes
 Assignments
 Late submission means 5% deduction per week
 Mid-term Exam.
 Presentation / Research Report
 Final Exam.

Advanced OS : Dr. M. Alam


Recommended Books
1. Modern Operating Systems, Andrew S.
Tanenbaum.
2. ABRAHAM SILBERSCHATZ
3. Distributed Systems, Andrew S. Tanenbaum.
4. Operating Systems by William Stallings, 3rd
Edition.
5. Operating System Concepts, Silberschatz
Galvin, 7th Edition
6. Distributed Systems : Concepts and Design,
G. Coulouris, J. Dollimore & T. Kindberg
7. Internet websites ………….
Advanced OS : Dr. M. Alam
Course Outline
 Introduction
 Communication
 Synchronization
 Processes & Scheduling
 File System
 Specific OS
 Research Work
Pre-requisite
Exposure of existing operating systems:
Unix, Linux, Window NT, …………
Basic Networking
Advanced OS : Dr. M. Alam
Objectives

 Introduction of Operating System


 Computer Systems and Operating System
 Introduction of Advanced Systems
 Introduction of Distributed Operating System
 Discussion and implementation issues

Advanced OS : Dr. M. Alam


What is Operating System ?

 A program that acts as an intermediary between a


user of a computer and the computer hardware
 Provides facilities how to use the computer
 Layer of software on the top of bare H/W that
control & manage the resources
 Examples : UNIX, IRIX, LINUX, Windows, ….
 Runs in kernel or supervisor mode / protected
from user

Advanced OS : Dr. M. Alam


How it works?

Operating Extended Instructions Application


System System Calls Program

Example
Process Swapping in Time Sharing Systems
 System Calls
 Start process, Terminate process, Release memory, …
 Process Table Entry

Advanced OS : Dr. M. Alam


Computer System
 Computer System Components
 Hardware – provides basic computing resources like
CPU, memory, I/O devices.
 OS – controls & coordinates the use of hardware
among the various application programs for the
various users.
 Application Programs – define the ways in which
the system resources are used to solve the computing
problems of the users (Database systems, Video
games, Business programs).
 Users – (People, Machines, Other computers)
Advanced OS : Dr. M. Alam
Computer System

Application/Shell
 Functionality of OS
System  Initializes H/W
Programs
 Provides device control
 Provides management, scheduling
Hardware & interaction of tasks
 Maintain system integrity
OS/KERNEL  Error handling
 Converts user’s commands to
machine language
User

Advanced OS : Dr. M. Alam


Parts of OS

Generally a modern OS has four parts:

Operating System

Kernel Process Scheduler File


Manager Manager

Advanced OS : Dr. M. Alam


User View of OS
 Standalone PC
 The operating system is designed for ease of use
 Little attention paid to performance
 None paid to resource utilization
 Mainframe or Minicomputer
 Operating system is designed to maximize resource utilization
 Users share resources like CPU, memory and I/O efficiently
 Workstations
 Users connected through network, have dedicated resources at
their disposal but shared as well
 The OS is designed to compromise between individual usability
and resource utilization
Advanced OS : Dr. M. Alam
System View of OS
 Resource Allocation
 Computer System Resources- CPU, Clock, Memory,
Disks, Terminals, I/O devices, ………
 OS acts as a manager of these resources
 Manages & allocates resources to specific users and
programs so that it can operate efficiently and fairly
 Control Program
 Controls the execution of user programs and operations
of I/O devices.
 Kernel
 The one program running at all times

Advanced OS : Dr. M. Alam


Tasks of OS

 Process Control
 Memory Management
 File Systems & Management
 I/O Control
 Security
 Synchronization
 Communication

Advanced OS : Dr. M. Alam


Computer Systems & OS

Advanced OS : Dr. M. Alam


Computer Systems

 Mainframe Systems
 Desktop Systems

 Multiprocessor Systems

 Clustered Systems

 Distributed Systems

 Real-Time Systems

 Handheld Systems

Advanced OS : Dr. M. Alam


Mainframe Systems

 First computers used to tackle many


commercial and scientific applications
 Types of mainframe systems:
 Simple Batch Systems
 Multiprogramming Batch Systems
 Time-Sharing Systems

Advanced OS : Dr. M. Alam


Simple Batch Systems
 Input /Output Devices: Card Readers, Tape
Drives, Line printers, Card Punches …
(Slower mechanical devices)
 Programmer/user prepare a job (program,
data and control information)
 CPU often sits idle
 Similar jobs are batched together to speed up
processing
 OS:
 Transfer control automatically between
Memory Layout
jobs
 Could perform job scheduling (due to
direct access to several jobs on a disk )
 Always resident in memory
Advanced OS : Dr. M. Alam
Multiprogramming Batch Systems
0
Several jobs are kept in main Operating System

memory at the same time and Job 1

CPU is multiplexed Job 2

512K Job 3
OS Features
 I/O routines 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.
Advanced OS : Dr. M. Alam
Time-Sharing Systems
 The CPU is multiplexed among several jobs (CPU
is allocated to a job only if the job is in memory).
 A job swapped in and out of memory to the disk.
 On-line communication between the user and the
system is provided; when OS finishes the
execution of one command, it seeks the next
“control statement” from the user’s keyboard.
 These systems involves memory management and
protection, file system, CPU scheduling, Job
synchronization and communication, and avoiding
jobs to be deadlocked.
Advanced OS : Dr. M. Alam
Desktop Systems

 Personal Computers – System dedicated to a


single user.
 I/O devices – Keyboards, Display screens,
Small Printers, …..
 User convenience and responsiveness.
 Do not need advanced CPU utilization or
protection features.
 May run several different types of operating
systems (Windows, MAC OS, UNIX, Linux)
Advanced OS : Dr. M. Alam
Multiprocessor / Parallel Systems
 Systems with more than one CPU in close
communication.
 Tightly coupled system:
 Processors share memory and a clock
 communication usually takes place through the
shared memory
 Advantages of parallel system:
 Increased Throughput
 Economical
 Increased Reliability

Advanced OS : Dr. M. Alam


Fault Tolerant Mechanism
 System consists of two identical processors
(primary and backup), each with its local memory.
 Processors are connected through a bus.
 During the execution of the system, the state
information of each job (including a copy of
memory image) is copied from primary to backup.
 In case of failure, backup copy is activated and
restart from the most recent checkpoint.
 An expensive solution as it involves considerable
hardware duplication.
Advanced OS : Dr. M. Alam
Multiprocessing
 Symmetric Multiprocessing (SMP)
 Each processor runs an identical copy of the OS.
 Many processes can run at once without performance
deterioration.
 Most modern operating systems support SMP.
 Asymmetric Multiprocessing
 Each processor performs a specific task; master
processor schedules and allocate work to slave.
 More common in extremely large systems.
 The difference between SMP and Asymmetric MP
could be either hardware or software.
Advanced OS : Dr. M. Alam
Distributed Systems
 Distribute the computation among several
physical processors.
 Loosely coupled system
 Each processor has its own local memory
 Processors communicate with each other through high-
speed buses or switches or telephone lines.
 Requires networking infrastructure
 Local area networks (LAN) or
 Wide area networks (WAN)
 May be either client-server or peer-to-peer
systems.
Advanced OS : Dr. M. Alam
Distributed Systems (Conti….)
 Advantages of distributed systems: Resource Sharing,
Computation Speedup, Load Sharing, Reliability, ……
 Network OS
 Provides file sharing
 Provides communication schemes that allows different
processes on different computers to exchange messages.
 Runs independently from the other computers on the network.
 Distributed OS
 Less autonomy between computers
 Give the impression there is a single OS controlling the
network.

Advanced OS : Dr. M. Alam


Clustered Systems
 Combination of two or more systems (nodes)
connected through S/W and network infrastructure
 Shared resources
 Processors communicate using message passing
 Cheaper with respect to high processing power
 Homogeneous Cluster
 All nodes have similar architecture and similar OS
 Heterogeneous Cluster
 Nodes have different architecture or different OS
 No specific OS; OS is installed on all machines
 Unavailability of general-purpose distributed file
system
Advanced OS : Dr. M. Alam
Real Time Systems

 Often used as a control device in a dedicated


application such as
 Controlling scientific experiments
 Medical imaging systems
 Industrial control systems
 Some display systems, ……
 Well-defined fixed-time constraints.
 Real-Time systems may be either
 hard or
 soft
Advanced OS : Dr. M. Alam
Hard Real Time Systems
 Guarantees that critical tasks are completed on time
 Secondary storage is limited or absent, data is stored
in short term memory OR read-only memory (ROM)
 ROM will be nonvolatile storage device
 Most advance operating system operations are
absent
 Conflicts with time-sharing systems as most
advanced OS features are absent.
 Not supported by general-purpose operating
systems.
Advanced OS : Dr. M. Alam
Soft Real Time Systems
 Less restrictive
 A critical real-time task gets priority
 Limited utility in industrial control or robotics
 Useful in applications (multimedia, virtual
reality) requiring advanced operating-system
features
 It is added to most recent Operating Systems
including major versions of UNIX

Advanced OS : Dr. M. Alam


Handheld Systems

 Personal Digital Assistants (PDAs)


 Cellular Telephones
 Issues:
 Limited Memory
 Slow Processors
 Small Display Screens
 Smaller Bandwidth

Advanced OS : Dr. M. Alam


Working of Operating Systems

Advanced OS : Dr. M. Alam


Starting of OS
 Turn on or restart the computer system, activates the
bootstrap loader
 Bootstrap
 Initializes the hardware (Interrupts)
 Read OS from somewhere ( Memory or disk or network )
 OS loads and starts a user-level 'init' program
 ‘init’ starts an original collection of processes,
usually specified by a configuration file
 typically including a login authorization program for each
terminal line or other input device

Advanced OS : Dr. M. Alam


Starting of OS (Continue)
 init also starts other 'daemon' processes such as
 Network management and services,
 Time service,
 Batch job manager, ………
 When user login to a terminal, the login process
 Creates a shell for user as a sub-process.
 Then waits for the shell to terminate that is done
when user logoff
 In case of rlogin, it is a network service daemon
that creates the shell for user
Advanced OS : Dr. M. Alam
Invoking a System Call

Calling Read( )
Communication: User  OS?
How to request the services?

Steps involved to invoke a system call


Advanced OS : Dr. M. Alam
Structure of Operating Systems

Advanced OS : Dr. M. Alam


Structure of Operating Systems

1. Monolithic System
2. Layered System
3. Virtual Machines
4. Client-Server Model

Advanced OS : Dr. M. Alam


Monolithic System

Advanced OS : Dr. M. Alam


Monolithic System

 OS is a collection of procedures (System Calls)


 Procedures or files containing procedures are
compiled and then bind all together
 Don’t care about information hiding
 Procedures can call each other freely
 Each procedure has well defined parameters &
results

Advanced OS : Dr. M. Alam


Model
Organized in Three Layers

Advanced OS : Dr. M. Alam


Basic Organization

1. Main Procedure : Invokes services procedures


2. Service Procedures : Carry out the system calls
3. Utility Procedures : Helps the service procedures

 One system call against one service procedure


 Utility procedures do job required by service
procedures (e,g. fetch data from user program)

Advanced OS : Dr. M. Alam


Functionality
1. User program request service by invoking system call
2. Procedure puts parameters in registers or on stack and
issues the trap instruction (Kernel or Supervisor call)
3. Machine switches from user mode to kernel mode
4. Control is transfer to OS
5. OS checks parameters  Which system call ?
6. OS indexes to table that contains the pointer to required
procedure
7. Service procedure is identified and then called
8. System call is finished & control is given back to user
program
Advanced OS : Dr. M. Alam
Layered System

Advanced OS : Dr. M. Alam


Layered System
Structure of THE (Technische Hogeschool Eindhoven)
Operating System
 OS is organized as hierarchy of six layers
 Simple batch system

0 Processor Allocation & Multiprogramming


1 Memory & Drum Management
2 Operator – Process Communication
3 I/O management
4 User Programs
5 The Operator
 MULTICS  Concentric Rings
Advanced OS : Dr. M. Alam
Layer 0 & Layer 1
Layer 0
 Allocate processors
 Switches between processes (When interrupts occur or
timer expiration)
 Multiprogramming : Sequential processes are
programmed without knowing that multiple processes
are running on a single processor
Layer 1
 Allocate space for processes in main memory
 For larger process, extra part is placed on disk/drum
 Responsible to bring pages into memory when needed
Advanced OS : Dr. M. Alam
Layer 2 & Layer 3

Layer 2
 Communicate between process & operator
console
 Each process has its own operator console

Layer 3
 Manages I/O devices

 Buffers information stream to & from I/O

 A process can handle abstract I/O devices nicely

Advanced OS : Dr. M. Alam


Layer 4 & Layer 5

Layer 4
 Contains user programs
 User program do not need to bother about
process, memory, console or I/O management

Layer 5
 Contains system operator process

Advanced OS : Dr. M. Alam


Virtual Machine

Advanced OS : Dr. M. Alam


Virtual Machines
 VM/370 based on observation that a time
sharing system provides
1. Multiprogramming and
2. An extended machine with more convenient interface
than the bare H/W

Advanced OS : Dr. M. Alam


Virtual Machine Monitor (VMM)

 Performs multiprogramming
 Runs on bare H/W
 Provides several virtual machines to next layer.
 These are not extended machines with files & other
nice features but these are exact copies of bare H/W
(including kernel / user mode, I/O interrupts, & ….
like real machine)
 Each virtual machine is identical, one can run any OS
that will run directly on H/W
 Different virtual machines may run different OS
Advanced OS : Dr. M. Alam
Conversational Monitor System
 CMS executes system call
 Call is trapped to the OS in its own virtual
machine just like running on real machine
 Example: Read Data
 CMS issues hardware I/O instructions for reading
required data
 I/O instructions are trapped by VM/370
 VM treats instruction as part of simulation of the real
H/W

Advanced OS : Dr. M. Alam


Client-Server Model

Advanced OS : Dr. M. Alam


Client-Server Model
 Goal: Develop most OS functions in user
processes & leaving minimal kernel in OS
 Invoking a service:
 User process (client process) sends request to
server process
 Then server process performs the job & send
results
 Kernel
 Handle communication between clients and
servers
 provides low-level resource management
Advanced OS : Dr. M. Alam
Basic Organization
 Modular Approach:
 Divide OS into parts
 Each part handles one module (set of specific
services) of the system
 Such as file service, process service, terminal
service, memory service, …

Advanced OS : Dr. M. Alam


Features
 Modular Approach is easier to understand
 Management is easier for smaller part
 Servers
 Run as user-mode process instead of kernel-mode
 Do not have direct access to H/W
 Any failure in a server will cause the crash in
that particular service not in the whole system

Advanced OS : Dr. M. Alam


Application in Distributed System

 Can be used in distributed systems


 Client communicate with server through messages
 Client do not know that message is treated locally
or remotely
 Kernel conveys the messages only
PE 1 PE 2 PE 3 PE 4
Client File Server Process Server Memory Server
Kernel Kernel Kernel Kernel

Messaging
Advanced OS : Dr. M. Alam
Summery

 What is an Operating System


 What is a Computer System
 How OS & computer system affect
each other

Advanced OS : Dr. M. Alam


Assignment
Write a brief report about an OS including its
distinguished features & limitations
 Windows
 DOS
 IRIX
 Linux
 Unix
 Free BSD Unix
 Solaries
 ……………..

Advanced OS : Dr. M. Alam


Research Topics
Choose a research paper(s) / topic for writing the
report that you have to submit
 Deadlock Prevention

 Multiple Locks

 OS for Mobile Equipments

 Synchronization

 Scheduling

 ……….

Advanced OS : Dr. M. Alam

Potrebbero piacerti anche