You are on page 1of 98

Elements of

Computer Science And


Engineering
CS106ES
UNIT – 3
Operating systems

• Functions of operating systems,


• Types of Operating Systems,
• Device management
• Resource management
What is an Operating System?
(User’s view)
– A program that acts as an intermediary
between a user of a computer and the
computer hardware
– Defines an interface for the user to use
services provided by the system
– Creates an environment for the user
What is an Operating System?
(User’s view)
• Abstract Machine
– Hides complex details of the underlying hardware
– Provides common API to applications and
services
– Simplifies application writing
• Command Interpreter
– Part of a OS that understands and executes
commands that are entered interactively by a
human being or from a program
– Shell
What is an Operating System?
(User’s view)
Application

Shell

Operating
System

CPU Memory
Video Card Network
Monitor Disk Printer
Why is abstraction important?
• Without OSs and abstract interfaces, application writers
must program all device access directly
– load device command codes into device registers
– understand physical characteristics of the devices

• Applications suffer!
– very complicated maintenance and upgrading
– no portability
What Operating Systems Do
(User’s view)
Depends on the point of view
•Single user system
•Users want convenience, ease of use
– Don’t care about resource utilization

Optimized for single user


experience
What Operating Systems Do
(User’s view)
Depends on the point of view
•Shared computer such as mainframe must
keep all users happy
•Response time minimum
Shared
– Keep all the users happy CPU,
memory
What Operating Systems Do
(Systems view)
• OS is a resource allocator
– Manages all resources
– Decides between conflicting requests for
efficient and fair resource use

• OS is a control program
– Controls execution of programs to prevent
errors and improper use of the computer
Concept of Process
• Process
– Program loaded in memory and in execution
• Program is a passive entity
• Process is an active entity

10
Stages of a Process
System boot

Hardware starts kernel mode

Load Operating system

Start user application

Switch to User mode

Whenever Trap or interrupt occurs, hardware


switches to user to kernel mode
Some instructions designated as
privileged, only executable in
kernel mode
Resources Managed by OS
• Physical
– CPU, Memory, Disk, I/O Devices like
keyboard, monitor, printer
• Logical
– Process, File, …

Hence we have
1.Process management
2.Memory management
3.File management
4.I/O management
Process Management
• A process is a program in execution. Program is a
passive entity, process is an active entity.
• Process needs resources to accomplish its task
– CPU time
• Representation of process
– Process has one program counter specifying location of next
instruction to execute
– Data structure (stores information of a process)
• Many processes may be associated with the same
program
• Typically system has many processes
– some user processes,
– some operating system processes
• Life cycle of a process
– States
– Arrival, Computation, I/O, I/O completion, termination
Process Management Activities
The operating system is responsible for the following activities in
connection with process management:

• Creating and deleting both user and system


processes
• Suspending and resuming processes
• Process scheduling
• Providing mechanisms for process
synchronization
• Providing mechanisms for process
communication
• Providing mechanisms for deadlock handling
R1 P1 R1 P1
R2 P2 R2 P2
Memory Management
• All instructions and data in memory in order to execute
– Translate the logical address to physical address

Process Memory
Management Unit

CPU Logical address Physical address

• Process terminates => MMU declares that the memory space is available
• Multiprogramming: Memory management manages several processes in
memory
– Optimizing CPU utilization and computer response to users
• Ensure memory protection
– Track illegal address
• Memory management activities
– Keeping track of which parts of memory are currently being used and by which
process
– Allocating and deallocating memory space as needed
• Introduces Virtual memory
– If the process size is bigger than the RAM size
• Hardware support
File Management
• OS provides uniform, logical view of information storage
– Abstracts physical properties to logical storage unit - File
– File => Collection of related information defined by the creator
– Each medium is controlled by device (i.e., disk drive, tape
drive)
• Varying properties include access speed, capacity, data-
transfer rate, access method (sequential or random)

User

Files (user’s
view)
Device Driver Mapping

Disk
Physical (sector,
media track)
File Management
• OS provides uniform, logical view of information storage
– Abstracts physical properties to logical storage unit - file
– Each medium is controlled by device (i.e., disk drive, tape drive)
• Varying properties include access speed, capacity, data-transfer rate,
access method (sequential or random)

• OS implements the abstract concept of file by managing


mass storage media (disk etc) and devices that control
them

• Files usually organized into directories


• Access control on most systems to determine who can
access what
• File-System management
– Creating and deleting files and directories
– Primitives to manipulate files and dirs
– Mapping files onto secondary storage
Disk Management

• Usually disks used to store data that does not


fit in main memory or data that must be kept
for a “long” period of time
– Most of the programs are stored on disk
• Proper management is of central importance
• Entire speed of computer operation depends
on disk subsystem and its algorithms
• OS activities
– Storage allocation (logical blocks)
– Free-space management
– Disk scheduling
I/O Subsystem
• One purpose of OS is to hide peculiarities of hardware
devices from the user

• I/O subsystem responsible for


– Memory management of I/O including buffering (storing data
temporarily while it is being transferred), caching (storing parts
of data in faster storage for performance)
– General device-driver interface
– Drivers for specific hardware devices

I/O subsystem (general interface)


Device Drivers

I/O devices
Operating Systems
• Basics of Operating Systems
Working of Operating System
Stage-1
Any program is stored as an
executable file in C:/ Drive
Stage-4
Stage-2 OS submits one
OS loads the file in Main process at a time
Hard Disk
Memory to CPU

C:/
RAM as Main Memory(M/M) CPS as
D:/
Ready Queue Processor
E:/ (Executes on
P 1 P2 P-2 P-1 process at a
F:/ time to give
desired output
to a user)
Stage-3
1.File gets converted in to process in M/M
by operating system
2.Process gets scheduled inside Ready
Queue of Main Memory. This activity is
know as Process Scheduling
Functions of Operating System
• Memory Management
• Process Management
• Management of File system
• Device Management
• Misc Activities
Functions of Operating System
Memory Management
• MM(RAM) is managed by the OS
• MM- stores user programs or job requests in the
form of processes
• ROM-stores inbuilt programs
• Program needs to be loaded into main memory for
execution
• Activities in Memory management are:
– Tracking part of used and Unused memory
– Allocate/reserve memory space of a process from
main memory when if requests to do so.
– To de-allocate/release memory space of the process
from main memory when the memory space is not
from the process or a CPU has completed execution
Functions of Operating System
Process Management
• In multiprogramming (also called multitasking),
several processes are all loaded into memory
and available to run. 
• OS has to duty to identify process to be
loaded next.
– Time to load and Duration
– This is know as Scheduling
• Activities in Process management are:
– Tracks each process and the status of each
process
– Controls the processor to perform execution
– Frees the processor after completion of task
Functions of Operating System
Management of File System
• OS organizes the file system into directory
for easy navigation

• Activities :
– Tracks information , locations, status and
uses of a file& folder under a directory
– Controls which files is allocated to which
resources, at what time and for how long
– Frees the file from the process after
completion of task
Functions of Operating System
Device Management
• OS manages communication of each device
through their corresponding drivers

• Activities :
– It keeps rack of all computer system devices through
–I/O Controller
– It has to make sure device which process, at what
time and for how long
– It provides an interface to the process of the desired
device for execution in an effective manner
– It frees the device from the process once a process
finishes execution
Functions of Operating System
Misc Activities
– Accounting information : It keeps track of time and
resources used by various processes and users
– Security: many techniques to protect data and
programs from unauthorized usage
– Monitors Performance of Systems: tracks request-
response delays of any kind occurring within the
system.
– Coordination between user and software : achieves
this by using-Complier, interpreter, assembler, etc.,
– Error Detection mechanism: traces, dumps, error
messages, along with debugging tools.
History of Operating System
 The First Generation (1940's to early 1950's )
 No Operating System
 All programming was done in absolute machine language, often by wiring up plug-
boards to control the machine’s basic functions.
 The Second Generation (1955-1965)
 First operating system was introduced in the early 1950's.It was called GMOS
 Created by General Motors for IBM's machine the 701.
 Single-stream batch processing systems

 The Third Generation (1965-1980)


 Introduction of multiprogramming
 Development of Minicomputer

 The Fourth Generation (1980-Present Day)


 Development of PCs
 Birth of Windows/MaC OS
Evolution (History) of OS
• First Generation: Punched cards
• Second Generation: Transistors and batch
systems.
• Third Generation: (Integrated Circuits)
– Spooling
– Multiprogramming
– Multitasking
– Virtual Memory
Spooling
• Stands for Simultaneous Peripheral Operation
On-Line
• Takes advantage of disk technology (new at this
point)
• Allows for overlap of IO from one job with the
computation of another job
• While executing current job
– Read next job from card reader to disk
– Print previous job to printer
• Disk is relegated to the role of a partitioned buffer
Second Generation Operating System
Multiprogramming

• Memory partitioned into several pieces


• CPU Starts a job
• If the job is waiting for IO, the CPU can switch to another task
Multitasking (Time-sharing)

• Extension of Multiprogramming
– Need for user interactivity
– Instead of switching jobs when waiting for IO, a timer causes
jobs to switch
• User interacts with computer via CRT and keyboard
– Systems have to balance CPU utilization against response time
– Better device management
• Need for file system to allow user to access data and code
• Need to provide user with an “interaction environment”
Time Sharing Operating system from IBM Museum
5 Gen Parallel Systems
th

• Multiprocessor 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
 graceful degradation
 fail-soft systems
Parallel Systems (Cont.)
• Symmetric multiprocessing (SMP)
– Each processor runs an identical copy of the operating
system.
– Many processes can run at once without performance
deterioration.
– Most modern operating systems support SMP
• Asymmetric multiprocessing
– Each processor is assigned a specific task; master
processor schedules and allocates work to slave
processors.
– More common in extremely large systems
Real-Time Systems
• Often used as a control device in a dedicated application such as
controlling scientific experiments, medical imaging systems,
industrial control systems, and some display systems.
• Well-defined fixed-time constraints (known as deterministic).
• Hard real-time system.
– Secondary storage limited or absent, data stored in short-
term memory, or read-only memory (ROM)
– Conflicts with time-sharing systems, not supported by
general-purpose operating systems.
• Soft real-time system
– Limited utility in industrial control or robotics
– Useful in applications (multimedia, virtual reality) requiring
advanced operating-system features.
Distributed Systems
• Distribute the computation among several physical
processors.
• Loosely coupled system – each processor has its
own local memory; processors communicate with
one another through various communications lines,
such as high-speed buses or telephone lines.
• Advantages of distributed systems.
– Resources Sharing
– Computation speed up – load sharing
– Reliability
– Communications
Distributed Systems (Cont.)
• Network Operating System
– provides file sharing
– provides communication scheme
– runs independently from other computers on the
network
• Distributed Operating System
– less autonomy between computers
– gives the impression there is a single operating
system controlling the network.
Types of Operating Systems
1. Batch Operating System
2. Multiprogramming Operating System
3. Time-Sharing OS
4. Multiprocessing OS
5. Distributed OS
6. Network OS
7. Real Time OS
8. Embedded OS
1. Batch Operating System
• The users of this type of operating system does not interact with the
computer directly.
• Each user prepares his job on an off-line device like punch cards and
submits it to the computer operator
• There is an operator which takes similar jobs having the same requirement
and group them into batches.
1. Batch Operating System cont..

Advantages of Batch Operating System: 


 Processors of the batch systems know how long the job would be when it is
in queue
 Multiple users can share the batch systems
 The idle time for the batch system is very less
 It is easy to manage large work repeatedly in batch systems
Disadvantages of Batch Operating System:  
 User has no interaction with the computer
 Prioritization of processes cannot be done
 Batch systems are hard to debug
 It is sometimes costly
 The other jobs will have to wait for an unknown time if any job fails
Examples of Batch based Operating System:
IBM's MVS
2. Multiprogramming Operating System

• Multiple programs are residing in the main memory


• Only one process in the processor
• Processor is switching between these programs
• It increases CPU utilization by organizing jobs so that the CPU always has
one job to execute  Improves processing power
2. Multiprogramming Operating System

• Characteristics
1. One program is selected by the OS, out of the many in memory for
execution
2. Whenever an I/O operation is required by a program, the OS switches
from the current job, to perform that operation.
3. NOTE: The number of jobs on disk are always greater than that of the
main memory
4. CPU Scheduling is performed by the OS, when several jobs are ready
for execution simultaneously
5. Multiprogramming OS, does not sit idle, the processor is always busy.
As a result the CPU utilization improves, and hence the performance of
the system improves
• Time sharing is an extension on Multiprogramming OS
3. Time-Sharing(or Multi-Tasking OS)
Operating Systems
• Key goal of Multiprogramming maximizing CPU utilization
• This is improved in Time sharing systems, where minimizing response time
is a concern.
• Execute multi jobs through frequently switching, may lead to immediate
response time.
• Time Quantum
3. Time-Sharing Operating Systems cont..

• Advantages of Time-Sharing OS:  


 Each task gets an equal opportunity
 Fewer chances of duplication of software
 CPU idle time can be reduced
• Disadvantages of Time-Sharing OS:  
 Reliability problem
 One must have to take care of the security and integrity of user
programs and data
 Data communication problem
• Examples of Time-Sharing Oss
Multics, Unix, etc. 
4. Multiprocessor operating systems

• Multiprocessor operating systems are also known as parallel OS or


tightly coupled OS.
• Such operating systems have more than one processor in close
communication that sharing the common Physical Memory, computer
bus, the clock and peripheral devices.
• It executes multiple jobs at the same time and makes the processing
faster.
• Higher Speed and Faster Computation
• Single Operating System
• If one processor fails then other processor should retrieve the
interrupted process state so execution of process can continue.
• Inter-processes communication mechanism is provided and
implemented in hardware.
4. Multiprocessor operating systems
Types of Multi-Processor Systems
1. Asymmetric Multi Processor (or Master-Slave) System
• Master allocates jobs based on the utilization of the
CPUs
Limitation
• Master may get overloaded if the number of CPUs
is high.

Suitable for small


Multi processors
Types of Multi-Processor Systems
2. Symmetric Multi Processor
Limitation
• Identical free space may be claimed by 2 CPUs
• Mutex(Lock)
COMPARISON SYMMETRIC MULTIPROCESSING ASYMMETRIC MULTIPROCESSING

Basic Each processor run the tasks in Only Master processor run the
Operating System. tasks of Operating System.
Process Processor takes processes Master processor assign processes
from a common ready queue, to the slave processors, or they
or there may be a private ready have some predefined processes.
queue for each processor.
Architecture All processor in Symmetric All processor in Asymmetric
Multiprocessing has the same Multiprocessing may have same or
architecture. different architecture.
Communication All processors communicate Processors need not communicate
with another processor by a as they are controlled by the
shared memory. master processor.
Failure If a processor fails, the If a master processor fails, a slave
computing capacity of the is turned to the master processor to
system reduces. continue the execution. If a slave
processor fails, its task is switched
to other processors.
Ease Symmetric Multiprocessor is Asymmetric Multiprocessor is
complex as all the processors simple as master processor access
need to be synchronized to the data structure.
maintain the load balance.
5. Distributed Operating System
• Various interconnected computers communicate with each other using a
shared communication network.
• Independent systems possess their own memory unit and CPU.
• These are referred to as loosely coupled systems.
• Examples:- Locus, DYSEAC
5. Distributed Operating System
• Benefits
– Fast processing Speed
– Need not be physically at same place
– Load Distribution
– Cheaper than Multi processor
Parallel Vs Distributed Computing
6. Network Operating System
• These systems run on a server and provide the capability
to manage data, users, groups, security, applications, and
other networking functions.
• These types of operating systems allow shared access of
files, printers, security, applications, and other networking
functions over a small private network.
• The “ other" computers arc called client computers, and
each computer that connects to a network server must be
running client software designed to request a specific
service.
6. Network Operating System
6. Network Operating System

Advantages of Network Operating System:  


Highly stable centralized servers
Security concerns are handled through servers
New technologies and hardware up-gradation are easily integrated into the
system
Server access is possible remotely from different locations and types of systems
Disadvantages of Network Operating System:  
Servers are costly
Server Monopoly
User has to depend on a central location for most operations
Maintenance and updates are required regularly-Costly
Examples of Network Operating System are:
Microsoft Windows Server 2003/2008/2012, UNIX, Linux, Mac OS X, Novell
NetWare, and BSD, etc. 
7. Real-Time Operating System 

• These types of OSs serve real-time systems.


• The time interval required to process and respond to inputs
is very small.
• Real Time Deadline; Penalty
• This time interval is called response time. 
• Real-time systems are used when there are
time requirements that are very strict like
 missile systems,
 air traffic control systems,
 robots, etc. 
8. Embedded Operating System
• An embedded operating system is one that is built into the circuitry of an
electronic device.
• Embedded operating systems are now found in automobiles, bar-code
scanners, cell phones, medical equipment, and personal digital
assistants.
• The most popular embedded operating systems for consumer products,
such as PDAs, include the following:
 Windows XP Embedded
 Windows CE .NET:- it supports wireless communications, multimedia
and Web browsing. It also allows for the use of smaller versions of
Microsoft Word, Excel, and Outlook.
 Palm OS:- It is the standard operating system for Palm-brand PDAs
as well as other proprietary handheld devices.
 Symbian:- OS found in “ smart” cell phones from Nokia and Sony
Ericsson
Services provided by Operating System

• Essential Services
– Execution of Basic programs and Processes
– Carrying out Input and Output Operations
– Management of File System
– For Ensuring Proper process communication
– Detecting and Resolving System Errors
– Allocation of Resources
– System Protection and Security
– Tracking System opreations
System Calls
• Definition: Systems Calls provide an
interface between the process and the
operrating System
• Eg:
• Models involved in System Calls
– User Mode/Supervisor Mode
– Kernel Mode/Monitor Mode
System Calls
• Programming interface to the services
provided by the OS
• Typically written in a high-level language (C
or C++)
• Mostly accessed by programs via a high-level
Application Program Interface (API)
• Three most common APIs are
– Win32 API for Windows,
– POSIX API (all versions of UNIX, Linux, and Mac
OS X), and
– Java API for the Java virtual machine (JVM)
System Calls: Example
• Standard C
• As an example, let's
assume a C program
invokes printf() statement.
• The C library intercepts
this call and invokes the
necessary system call(s)
in the OS.
• The C library takes the
value returned
by write() and passes it
back to the user program 
Categories of System Calls
1. Process Management
2. File Management
3. Device Management
4. Information Maintenance
5. Communication
1) Process Control
• end, abort
• load, execute
• create process, terminate process
• get process attributes, set process
attributes
• wait for time
• wait event, signal event
• allocate and free memory
File Management
• create file, delete file
• open, close
• read, write, reposition
• get file attributes, set file attributes
Device Management
• request device, release device
• read, write, reposition
• get device attributes, set device attributes
• logically attach or detach devices
Information Maintenance
• get time or date, set time or date
• get system data, set system data
• get process, file, or device attributes
• set process, file, or device attributes
Communication
• create, delete communication connection
• send, receive messages
• transfer status information
• attach or detach remote devices
Operating System Structure
• Architecture of OS principle:
Principle of Separation of concerns
• Should be divided into relatively independent parts with
specific individual features
Operating System Structure
• General-purpose OS is very large
program
• Various ways to structure ones
– Simple structure – MS-DOS
– More complex -- UNIX
– Layered – an abstrcation
– Microkernel -Mach
Simple Structure -- MS-DOS
• MS-DOS – written to
provide the most
functionality in the least
space
– Not divided into modules
– Although MS-DOS has
some structure, its
interfaces and levels of
functionality are not well
separated
Non Simple Structure -- UNIX
UNIX – limited by hardware functionality, the original
UNIX operating system had limited structuring. The
UNIX OS consists of two separable parts
– Systems programs
– The kernel
• Consists of everything below the system-call interface and above
the physical hardware
• Provides the file system, CPU scheduling, memory management,
and other operating-system functions; a large number of functions
for one level
Traditional UNIX System Structure
Beyond simple but not fully layered
Layered Approach
• The operating system is divided
into a number of layers (levels),
each built on top of lower layers.
The bottom layer (layer 0), is the
hardware; the highest (layer N) is
the user interface.

• With modularity, layers are


selected such that each uses
functions (operations) and
services of only lower-level layers
Microkernel System Structure
• Moves as much from the kernel into user space
• Mach example of microkernel
– Mac OS X kernel (Darwin) partly based on Mach
• Communication takes place between user modules using
message passing
• Benefits:
– Easier to extend a microkernel
– Easier to port the operating system to new architectures
– More reliable (less code is running in kernel mode)
– More secure
• Detriments:
– Performance overhead of user space to kernel space communication
Microkernel System Structure
Modules
• Many modern operating systems implement
loadable kernel modules
– Uses object-oriented approach
– Each core component is separate
– Each talks to the others over known interfaces
– Each is loadable as needed within the kernel
• Overall, similar to layers but with more
flexible
– Linux, Solaris, etc
Solaris Modular Approach
Hybrid Systems
• Most modern operating systems are actually not one pure
model
– Hybrid combines multiple approaches to address performance,
security, usability needs
– Linux and Solaris kernels in kernel address space, so monolithic, plus
modular for dynamic loading of functionality
– Windows mostly monolithic, plus microkernel for different subsystem
personalities
• Apple Mac OS X hybrid, layered, Aqua UI plus Cocoa
programming environment
– Below is kernel consisting of Mach microkernel and BSD Unix parts,
plus I/O kit and dynamically loadable modules (called kernel
extensions)
Mac OS X Structure
Virtual Machine -- Overview
• Fundamental idea – abstract hardware of a single computer into
several different execution environments
– Similar to layered approach
– But layer creates virtual system (virtual machine, or VM) on which
operation systems or applications can run
• Several components
– Host – underlying hardware system
– Virtual machine manager (VMM) or hypervisor – creates and runs
virtual machines by providing interface that is identical to the host
• (Except in the case of paravirtualization)
– Guest – process provided with virtual copy of the host
• Usually an operating system
• Single physical machine can run multiple operating systems
concurrently, each in its own virtual machine
System Models

Non-virtual machine Virtual machine


Concept of Virtual Machine
Overview
• Fundamental idea – abstract hardware of a single computer into
several different execution environments
– Similar to layered approach
– But layer creates virtual system (virtual machine, or VM) on which
operation systems or applications can run
• Several components
– Host – underlying hardware system
– Virtual machine manager (VMM) or hypervisor – creates and runs
virtual machines by providing interface that is identical to the host
• (Except in the case of paravirtualization)
– Guest – process provided with virtual copy of the host
• Usually an operating system
• Single physical machine can run multiple operating systems
concurrently, each in its own virtual machine
System Models

Non-virtual machine Virtual machine


Implementation of VMMs
• Vary greatly, with options including:
– Type 0 hypervisors - Hardware-based solutions that provide
support for virtual machine creation and management via firmware
• IBM LPARs and Oracle LDOMs are examples

– Type 1 hypervisors - Operating-system-like software built to


provide virtualization
• Including VMware ESX, Joyent SmartOS, and Citrix XenServer

– Type 1 hypervisors – Also includes general-purpose operating


systems that provide standard functions as well as VMM functions
• Including Microsoft Windows Server with HyperV and RedHat Linux with KVM

– Type 2 hypervisors - Applications that run on standard operating


systems but provide VMM features to guest operating systems
• Includeing VMware Workstation and Fusion, Parallels Desktop, and Oracle VirtualBox
Implementation of VMMs (cont.)
• Other variations include:
– Paravirtualization - Technique in which the guest operating system is
modified to work in cooperation with the VMM to optimize performance
– Programming-environment virtualization - VMMs do not virtualize real
hardware but instead create an optimized virtual system
• Used by Oracle Java and Microsoft.Net
– Emulators – Allow applications written for one hardware environment to
run on a very different hardware environment, such as a different type of
CPU
– Application containment - Not virtualization at all but rather provides
virtualization-like features by segregating applications from the operating
system, making them more secure, manageable
• Including Oracle Solaris Zones, BSD Jails, and IBM AIX WPARs
• Much variation due to breadth, depth and importance of
virtualization in modern computing
History
• First appeared in IBM mainframes in 1972
• Allowed multiple users to share a batch-oriented system
• Formal definition of virtualization helped move it beyond
IBM
1. A VMM provides an environment for programs that is
essentially identical to the original machine
2. Programs running within that environment show only minor
performance decreases
3. The VMM is in complete control of system resources
• In late 1990s Intel CPUs fast enough for researchers to try
virtualizing on general purpose PCs
– Xen and VMware created technologies, still used today
– Virtualization has expanded to many OSes, CPUs, VMMs
Benefits and Features
• Host system protected from VMs, VMs protected from each
other
– I.e. A virus less likely to spread
– Sharing is provided though via shared file system volume,
network communication
• Freeze, suspend, running VM
– Then can move or copy somewhere else and resume
– Snapshot of a given state, able to restore back to that state
• Some VMMs allow multiple snapshots per VM
– Clone by creating copy and running both original and copy
• Great for OS research, better system development efficiency
• Run multiple, different OSes on a single machine
– Consolidation, app dev, …
Benefits and Features (cont.)
• Templating – create an OS + application VM,
provide it to customers, use it to create
multiple instances of that combination
• Live migration – move a running VM from
one host to another!
– No interruption of user access
• All those features taken together -> cloud
computing
– Using APIs, programs tell cloud infrastructure
(servers, networking, storage) to create new
guests, VMs, virtual desktops
Building Blocks
 Generally difficult to provide an exact duplicate
of underlying machine
• Especially if only dual-mode operation available on
CPU
• But getting easier over time as CPU features and
support for VMM improves
• Most VMMs implement virtual CPU (VCPU) to
represent state of CPU per guest as guest believes it
to be
• When guest context switched onto CPU by VMM, information
from VCPU loaded and stored
• Several techniques, as described in next slides

You might also like