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

Operating System NOTES

Uploaded by

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

Operating System NOTES

Uploaded by

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

UNIT-I

Introduction of Operating System


An operating system acts as an intermediary between the user of a computer and
computer hardware. The purpose of an operating system is to provide an
environment in which a user can execute programs conveniently and efficiently.
An operating system is software that manages computer hardware. The hardware
must provide appropriate mechanisms to ensure the correct operation of the
computer system and to prevent user programs from interfering with the proper
operation of the system.
Operating System – Definition:
 An operating system is a program that controls the execution of application
programs and acts as an interface between the user of a computer and the
computer hardware.
 A more common definition is that the operating system is the one program
running at all times on the computer (usually called the kernel), with all else
being application programs.
 An operating system is concerned with the allocation of resources and
services, such as memory, processors, devices, and information. The
operating system correspondingly includes programs to manage these
resources, such as a traffic controller, a scheduler, a memory management
module, I/O programs, and a file system.
Functions of Operating system – Operating system performs three functions:
1. Convenience: An OS makes a computer more convenient to use.
2. Efficiency: An OS allows the computer system resources to be used
efficiently.
3. 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
at the same time without interfering with service.
4. Throughput: An OS should be constructed so that it can give
maximum throughput (Number of tasks per unit time).
Major Functionalities of Operating System:
 Resource Management: When parallel accessing happens in the OS means
when multiple users are accessing the system the OS works as Resource
Manager, Its responsibility is to provide hardware to the user. It decreases
the load in the system.
 Process Management: It includes various tasks
like scheduling, termination of the process. OS manages various tasks at a
time. Here CPU Scheduling happens means all the tasks would be done by
the many algorithms that use for scheduling.
 Storage Management: The file system mechanism used for the
management of the storage. NIFS, CFS, CIFS, NFS, etc. are some file
systems. All the data stores in various tracks of Hard disks that all managed
by the storage manager. It included Hard Disk.
 Memory Management: Refers to the management of primary memory. The
operating system has to keep track, how much memory has been used and
by whom. It has to decide which process needs memory space and how
much. OS also has to allocate and deallocate the memory space.
 Security/Privacy Management: Privacy is also provided by the Operating
system by means of passwords so that unauthorized applications can’t
access programs or data. For example, Windows
uses Kerberos authentication to prevent unauthorized access to data.
The process operating system as User Interface:
1. User
2. System and application programs
3. Operating system
4. Hardware
Every general-purpose computer consists of the hardware, operating system,
system programs, and application programs. The hardware consists of memory,
CPU, ALU, and I/O devices, peripheral devices, and storage devices. System
program consists of compilers, loaders, editors, OS, etc. The application program
consists of business programs, database programs.

Conceptual view of a computer system


Every computer must have an operating system to run other programs. The
operating system coordinates the use of the hardware among the various system
programs and application programs for various users. It simply provides an
environment within which other programs can do useful work.
The operating system is a set of special programs that run on a computer system
that allows it to work properly. It performs basic tasks such as recognizing input
from the keyboard, keeping track of files and directories on the disk, sending output
to the display screen, and controlling peripheral devices.
OS is designed to serve two basic purposes:
1. It controls the allocation and use of the computing System’s resources among
the various user and tasks.
2. It provides an interface between the computer hardware and the programmer
that simplifies and makes it feasible for coding, creation, debugging of
application programs.
The Operating system must support the following tasks. The tasks are:

1. Provides the facilities to create, modification of programs and data files using
an editor.
2. Access to the compiler for translating the user program from high-level
language to machine language.
3. Provide a loader program to move the compiled program code to the
computer’s memory for execution.
4. Provide routines that handle the details of I/O programming.
I/O System Management –
The module that keeps track of the status of devices is called the I/O traffic
controller. Each I/O device has a device handler that resides in a separate
process associated with that device. The I/O subsystem consists of
 A memory Management component that includes buffering caching and
spooling.
 A general device driver interface.
Drivers for specific hardware devices.
Assembler –
The input to an assembler is an assembly language program. The output is an
object program plus information that enables the loader to prepare the object
program for execution. At one time, the computer programmer had at his disposal a
basic machine that interpreted, through hardware, certain fundamental instructions.
He would program this computer by writing a series of ones and Zeros (Machine
language), place them into the memory of the machine.
Compiler –
The High-level languages- examples are FORTRAN, COBOL, ALGOL, and PL/I are
processed by compilers and interpreters. A compiler is a program that accepts a
source program in a “high-level language “and produces a corresponding object
program. An interpreter is a program that appears to execute a source program as
if it was machine language. The same name (FORTRAN, COBOL, etc.) is often used
to designate both a compiler and its associated language.
Loader –
A Loader is a routine that loads an object program and prepares it for execution.
There are various loading schemes: absolute, relocating, and direct-linking. In
general, the loader must load, relocate and link the object program. The loader is a
program that places programs into memory and prepares them for execution. In a
simple loading scheme, the assembler outputs the machine language translation of
a program on a secondary device and a loader places it in the core. The loader
places into memory the machine language version of the user’s program and
transfers control to it. Since the loader program is much smaller than the
assembler, those make more core available to the user’s program.
History of Operating system –
The operating system has been evolving through the years. The following table
shows the history of OS.

Generatio Electronic device Types of OS


Year
n used Device
First 1945-55 Vacuum Tubes Plug Boards
Second 1955-65 Transistors Batch Systems
Third 1965-80 Integrated Circuits(IC) Multiprogramming
Since Large Scale
Fourth PC
1980 Integration

Types of Operating System:


 Batch Operating System- Sequence of jobs in a program on a computer
without manual interventions.
 Time-sharing operating System- allows many users to share the computer
resources. (Max utilization of the resources).
 Distributed operating System- Manages a group of different computers and
makes appear to be a single computer.
 Network operating system- computers running in different operating systems
can participate in a common network (It is used for security purposes).
 Real-time operating system – meant applications to fix the deadlines.
Examples of Operating System are –
 Windows (GUI based, PC)
 GNU/Linux (Personal, Workstations, ISP, File and print server, Three-tier
client/Server)
 macOS (Macintosh), used for Apple’s personal computers and workstations
(MacBook, iMac).
 Android (Google’s Operating System for smartphones/tablets/smartwatches)
 iOS (Apple’s OS for iPhone, iPad, and iPod Touch)
Different approaches or Structures of Operating Systems
Operating system can be implemented with the help of various structures. The
structure of the OS depends mainly on how the various common components of the
operating system are interconnected and melded into the kernel. Depending on this
we have following structures of the operating system:
Simple structure: Such operating systems do not have well defined structure and
are small, simple and limited systems. The interfaces and levels of functionality are
not well separated. MS-DOS is an example of such operating system. In MS-DOS
application programs are able to access the basic I/O routines. These types of
operating system cause the entire system to crash if one of the user programs fails.
Diagram of the structure of MS-DOS is shown below.

Advantages of Simple structure:


 It delivers better application performance because of the few interfaces
between the application program and the hardware.
 Easy for kernel developers to develop such an operating system.
Disadvantages of Simple structure:
 The structure is very complicated as no clear boundaries exists between
modules.
 It does not enforce data hiding in the operating system.
Layered structure:
An OS can be broken into pieces and retain much more control on system. In this
structure the OS is broken into number of layers (levels). The bottom layer (layer 0)
is the hardware and the topmost layer (layer N) is the user interface. These layers
are so designed that each layer uses the functions of the lower level layers only.
This simplifies the debugging process as if lower level layers are debugged and an
error occurs during debugging then the error must be on that layer only as the
lower level layers have already been debugged.
The main disadvantage of this structure is that at each layer, the data needs to be
modified and passed on which adds overhead to the system. Moreover careful
planning of the layers is necessary as a layer can use only lower level layers. UNIX
is an example of this structure.

Advantages of Layered structure:


 Layering makes it easier to enhance the operating system as implementation
of a layer can be changed easily without affecting the other layers.
 It is very easy to perform debugging and system verification.
Disadvantages of Layered structure:
 In this structure the application performance is degraded as compared to
simple structure.
 It requires careful planning for designing the layers as higher layers use the
functionalities of only the lower layers.
Operating-System Services

A view of operating system services

OSes provide environments in which programs run, and services for the users of the
system, including:
 User Interfaces - Means by which users can issue commands to the system.
Depending on the system these may be a command-line interface ( e.g. sh,
csh, ksh, tcsh, etc. ), a GUI interface ( e.g. Windows, X-Windows, KDE,
Gnome, etc. ), or a batch command systems. The latter are generally older
systems using punch cards of job-control language, JCL, but may still be used
today for specialty systems designed for a single purpose.
 Program Execution - The OS must be able to load a program into RAM, run
the program, and terminate the program, either normally or abnormally.
 I/O Operations - The OS is responsible for transferring data to and from I/O
devices, including keyboards, terminals, printers, and storage devices.
 File-System Manipulation - In addition to raw data storage, the OS is also
responsible for maintaining directory and subdirectory structures, mapping
file names to specific blocks of data storage, and providing tools for
navigating and utilizing the file system.
 Communications - Inter-process communications, IPC, either between
processes running on the same processor, or between processes running on
separate processors or separate machines. May be implemented as either
shared memory or message passing, ( or some systems may offer both. )
 Error Detection - Both hardware and software errors must be detected and
handled appropriately, with a minimum of harmful repercussions. Some
systems may include complex error avoidance or recovery systems, including
backups, RAID drives, and other redundant systems. Debugging and
diagnostic tools aid users and administrators in tracing down the cause of
problems.
Other systems aid in the efficient operation of the OS itself:
 Resource Allocation - E.g. CPU cycles, main memory, storage space, and
peripheral devices. Some resources are managed with generic systems and
others with very carefully designed and specially tuned systems, customized
for a particular resource and operating environment.
 Accounting - Keeping track of system activity and resource usage, either for
billing purposes or for statistical record keeping that can be used to optimize
future performance.
 Protection and Security - Preventing harm to the system and to resources,
either through wayward internal processes or malicious outsiders.
Authentication, ownership, and restricted access are obvious parts of this
system. Highly secure systems may log all process activity down to
excruciating detail, and security regulation dictate the storage of those
records on permanent non-erasable medium for extended times in secure
( off-site ) facilities.
An Operating System provides services to both the users and to the
programs.

 It provides programs an environment to execute.


 It provides users the services to execute the programs in a convenient
manner.
Following are a few common services provided by an operating system.

 Program execution
 I/O operations
 File System manipulation
 Communication
 Error Detection
 Resource Allocation
 Protection
Program execution
Operating systems handle many kinds of activities from user programs to system
programs like printer spooler, name servers, file server, etc. Each of these activities
is encapsulated as a process.

A process includes the complete execution context (code to execute, data to


manipulate, registers, OS resources in use). Following are the major activities of an
operating system with respect to program management.

 Loads a program into memory.


 Executes the program.
 Handles program's execution.
 Provides a mechanism for process synchronization.
 Provides a mechanism for process communication.
 Provides a mechanism for deadlock handling.
I/O Operation
An I/O subsystem comprises of I/O devices and their corresponding driver software.
Drivers hide the peculiarities of specific hardware devices from the users.
An Operating System manages the communication between user and device
drivers.
 I/O operation means read or write operation with any file or any specific I/O
device.
 Operating system provides the access to the required I/O device when
required.
File system manipulation
A file represents a collection of related information. Computers can store files on the
disk (secondary storage), for long-term storage purpose. Examples of storage media
include magnetic tape, magnetic disk and optical disk drives like CD, DVD. Each of
these media has its own properties like speed, capacity, data transfer rate and data
access methods.
A file system is normally organized into directories for easy navigation and usage.
These directories may contain files and other directions. Following are the major
activities of an operating system with respect to file management.
 Program needs to read a file or write a file.
 The operating system gives the permission to the program for operation on
file.
 Permission varies from read-only, read-write, denied and so on.
 Operating System provides an interface to the user to create/delete files.
 Operating System provides an interface to the user to create/delete
directories.
 Operating System provides an interface to create the backup of file system.
Communication
In case of distributed systems which are a collection of processors that do not share
memory, peripheral devices, or a clock, the operating system manages
communications between all the processes. Multiple processes communicate with
one another through communication lines in the network.
The OS handles routing and connection strategies, and the problems of contention
and security. Following are the major activities of an operating system with respect
to communication.
 Two processes often require data to be transferred between them
 Both the processes can be on one computer or on different computers, but
are connected through a computer network.
 Communication may be implemented by two methods, either by Shared
Memory or by Message Passing.
Error handling
Errors can occur anytime and anywhere. An error may occur in CPU, in I/O devices
or in the memory hardware. Following are the major activities of an operating
system with respect to error handling −
 The OS constantly checks for possible errors.
 The OS takes an appropriate action to ensure correct and consistent
computing.
Resource Management
In case of multi-user or multi-tasking environment, resources such as main memory,
CPU cycles and files storage are to be allocated to each user or job. Following are
the major activities of an operating system with respect to resource management −
 The OS manages all kinds of resources using schedulers.
 CPU scheduling algorithms are used for better utilization of CPU.
Protection
Considering a computer system having multiple users and concurrent execution of
multiple processes, the various processes must be protected from each other's
activities.
Protection refers to a mechanism or a way to control the access of programs,
processes, or users to the resources defined by a computer system. Following are
the major activities of an operating system with respect to protection −
 The OS ensures that all access to system resources is controlled.
 The OS ensures that external I/O devices are protected from invalid access
attempts.
 The OS provides authentication features for each user by means of
passwords.

Introduction of System Call


In computing, a system call is the programmatic way in which a computer program
requests a service from the kernel of the operating system it is executed on. A
system call is a way for programs to interact with the operating system. A
computer program makes a system call when it makes a request to the operating
system’s kernel. System call provides the services of the operating system to the
user programs via Application Program Interface (API). It provides an interface
between a process and operating system to allow user-level processes to request
services of the operating system. System calls are the only entry points into the
kernel system. All programs needing resources must use system calls.
Services Provided by System Calls:
1. Process creation and management
2. Main memory management
3. File Access, Directory and File system management
4. Device handling(I/O)
5. Protection
6. Networking, etc.
Types of System Calls:
There are 5 different categories of system calls –
1. Process control: end, abort, create, terminate, allocate and free
memory.
2. File management: create, open, close, delete, read file etc.
3. Device management
4. Information maintenance
5. Communication
Process Control
These system calls deal with processes such as process creation, process
termination etc.
File Management
These system calls are responsible for file manipulation such as creating a
file, reading a file, writing into a file etc.
Device Management
These system calls are responsible for device manipulation such as reading
from device buffers, writing into device buffers etc.
Information Maintenance
These system calls handle information and its transfer between the
operating system and the user program.
Communication
These system calls are useful for interprocess communication. They also deal
with creating and deleting a communication connection.
Some of the examples of all the above types of system calls in Windows and
Unix are given as follows
Types of System Windows Linux
Calls

Process Control CreateProcess() fork()


ExitProcess() exit()
WaitForSingleObject() wait()

File Management CreateFile() open()


ReadFile() read()
WriteFile() write()
CloseHandle() close()

Device Management SetConsoleMode() ioctl()


ReadConsole() read()
WriteConsole() write()

Information GetCurrentProcessID() getpid()


Maintenance SetTimer() alarm()
Sleep() sleep()

Communication CreatePipe() pipe()


CreateFileMapping() shmget()
MapViewOfFile() mmap()
There are many different system calls as shown above. Details of some of
those system calls are as follows −
Open ()
The open () system call is used to provide access to a file in a file system.
This system call allocates resources to the file and provides a handle that the
process uses to refer to the file. A file can be opened by multiple processes
at the same time or be restricted to one process. It all depends on the file
organisation and file system.
read ()
The read () system call is used to access data from a file that is stored in the
file system. The file to read can be identified by its file descriptor and it
should be opened using open () before it can be read. In general, the read()
system calls takes three arguments i.e. the file descriptor, buffer which
stores read data and number of bytes to be read from the file.
write ()
The write () system calls writes the data from a user buffer into a device such
as a file. This system call is one of the ways to output data from a program.
In general, the write system calls takes three arguments i.e. file descriptor,
pointer to the buffer where data is stored and number of bytes to write from
the buffer.
close ()
The close () system call is used to terminate access to a file system. Using
this system call means that the file is no longer required by the program and
so the buffers are flushed, the file metadata is updated and the file resources
are de-allocated
System Programs in Operating System
System Programming can be defined as the act of building Systems Software
using System Programming Languages. According to Computer Hierarchy, one
which comes at last is Hardware. Then it is Operating System, System Programs,
and finally Application Programs. Program Development and Execution can be done
conveniently in System Programs. Some of the System Programs are simply user
interfaces, others are complex. It traditionally lies between the user interface and
system calls.
So here, the user can only view up-to-the System Programs he can’t see System
Calls.
System Programs can be divided into these categories:
1. File Management – A file is a collection of specific information stored in the
memory of a computer system. File management is defined as the process of
manipulating files in the computer system; its management includes the
process of creating, modifying and deleting files.
 It helps to create new files in the computer system and placing them at
specific locations.
 It helps in easily and quickly locating these files in the computer
system.
 It makes the process of sharing files among different users very easy
and user-friendly.
 It helps to store files in separate folders known as directories.
 These directories help users to search files quickly or to manage files
according to their types of uses.
 It helps users to modify the data of files or to modify the name of files
in directories.
2. Status Information – Information like date, time amount of available
memory, or disk space is asked by some users. Others providing detailed
performance, logging, and debugging information which is more complex. All
this information is formatted and displayed on output devices or printed.
Terminal or other output devices or files or a window of GUI is used for
showing the output of programs.
3. File Modification – For modifying the contents of files we use this. For Files
stored on disks or other storage devices, we used different types of editors.
For searching contents of files or perform transformations of files we use
special commands.
4. Programming-Language support – For common programming languages,
we use Compilers, Assemblers, Debuggers, and interpreters which are
already provided to users. It provides all support to users. We can run any
programming language. All languages of importance are already provided.
5. Program Loading and Execution – When the program is ready after
Assembling and compilation, it must be loaded into memory for execution. A
loader is part of an operating system that is responsible for loading programs
and libraries. It is one of the essential stages for starting a program. Loaders,
relocatable loaders, linkage editors, and Overlay loaders are provided by the
system.
6. Communications – Virtual connections among processes, users, and
computer systems are provided by programs. Users can send messages to
another user on their screen, User can send e-mail, browsing on web pages,
remote login, the transformation of files from one user to another.

Operating System Structure


An operating system is a construct that allows the user application programs to
interact with the system hardware. Since the operating system is such a complex
structure, it should be created with utmost care so it can be used and modified
easily. An easy way to do this is to create the operating system in parts. Each of
these parts should be well defined with clear inputs, outputs and functions.
Simple Structure
There are many operating systems that have a rather simple structure. These
started as small systems and rapidly expanded much further than their scope. A
common example of this is MS-DOS. It was designed simply for a niche amount for
people. There was no indication that it would become so popular.
An image to illustrate the structure of MS-DOS is as follows −

It is better that operating systems have a modular structure, unlike MS-DOS. That
would lead to greater control over the computer system and its various applications.
The modular structure would also allow the programmers to hide information as
required and implement internal routines as they see fit without changing the outer
specifications.
Layered Structure
One way to achieve modularity in the operating system is the layered approach. In
this, the bottom layer is the hardware and the topmost layer is the user interface.
An image demonstrating the layered approach is as follows −

As seen from the image, each upper layer is built on the bottom layer. All the layers
hide some structures, operations etc from their upper layers.
One problem with the layered structure is that each layer needs to be carefully
defined. This is necessary because the upper layers can only use the functionalities
of the layers below them.
Microkernel in Operating Systems
Kernel is the core part of an operating system which manages system resources. It
also acts like a bridge between application and hardware of the computer. It is one
of the first programs loaded on start-up (after the Bootloader).

Kernel mode and User mode of CPU operation: The CPU can execute certain
instruction only when it is in the kernel mode. These instruction are called privilege
instruction. They allow implementation of special operation whose execution by the
user program could interface with the functioning of operating system or activity of
another user program. For example, instruction for managing memory protection.
 The operating system puts the CPU in kernel mode when it is executing in the
kernel so, that kernel can execute some special operation.
 The operating system puts the CPU in user mode when a user program is in
execution so, that user program cannot interface with the operating system
program.
 User-level instruction does not require special privilege. Example are
ADD,PUSH,etc.

The concept of modes can be extended beyond two, requiring more than a single
mode bit CPUs that support virtualization use one of these extra bits to indicate
when the virtual machine manager, VMM, is in control of the system. The VMM has
more privileges than ordinary user programs, but not so many as the full kernel.
System calls are typically implemented in the form of software interrupts, which
causes the hardware’s interrupt handler to transfer control over to an appropriate
interrupt handler, which is part of the operating system, switching the mode bit to
kernel mode in the process. The interrupt handler checks exactly which interrupt
was generated, checks additional parameters (generally passed through registers) if
appropriate, and then calls the appropriate kernel service routine to handle the
service requested by the system call.
User programs’ attempts to execute illegal instructions ( privileged or non-existent
instructions ), or to access forbidden memory areas, also generate software
interrupts, which are trapped by the interrupt handler and control is transferred to
the OS, which issues an appropriate error message, possibly dumps data to a log
( core ) file for later analysis, and then terminates the offending program.
What is Microkernel?
Microkernel is one of the classifications of the kernel. Being a kernel it manages all
system resources. But in a microkernel, the user services and kernel
services are implemented in different address space. The user services are kept
in user address space, and kernel services are kept under kernel address
space, thus also reduces the size of kernel and size of operating system as well.

It provides minimal services of process and memory management. The


communication between client program/application and services running in user
address space is established through message passing, reducing the speed of
execution microkernel. The Operating System remains unaffected as user
services and kernel services are isolated so if any user service fails it does not affect
kernel service. Thus it adds to one of the advantages in a microkernel. It is
easily extendable i.e. if any new services are to be added they are added to user
address space and hence requires no modification in kernel space. It is also
portable, secure and reliable.
Microkernel Architecture – Since kernel is the core part of the operating system,
so it is meant for handling the most important services only. Thus in this
architecture only the most important services are inside kernel and rest of the OS
services are present inside system application program. Thus users are able to
interact with those not-so important services within the system application. And the
microkernel is solely responsible for the most important services of operating
system they are named as follows:
 Inter process-Communication
 Memory Management
 CPU-Scheduling
Advantages of Microkernel –
 The architecture of this kernel is small and isolated hence it can function
better.
 Expansion of the system is easier, it is simply added in the system application
without disturbing the kernel
Monolithic Operating Systems
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. This is
different than the microkernel system where the minimum software that is required
to correctly implement an operating system is kept in the kernel.
A diagram that demonstrates the architecture of a monolithic system is as follows −

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.
Differences between Microkernel and Monolithic Kernel
Some of the differences between microkernel and monolithic kernel are given as
follows −
 The microkernel is much smaller in size as compared to the monolithic
kernel.
 The microkernel is easily extensible whereas this is quite complicated for the
monolithic kernel.
 The execution of the microkernel is slower as compared to the monolithic
kernel.
 Much more code is required to write a microkernel than the monolithic kernel.
 Examples of Microkernel are QNX, Symbian, L4 Linux etc. Monolithic Kernel
examples areLinux, BSD etc.
Advantages of Monolithic Kernel
Some of the advantages of monolithic kernel are −
 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.
Disadvantages of Monolithic Kernel
Some of the disadvantages of monolithic kernel are −
 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
Virtual Machines in Operating System
Virtual Machine abstracts the hardware of our personal computer such as CPU,
disk drives, memory, NIC (Network Interface Card) etc, into many different
execution environments as per our requirements, hence giving us a feel that each
execution environment is a single computer. For example, VirtualBox.
When we run different processes on an operating system, it creates an illusion that
each process is running on a different processor having its own virtual memory,
with the help of CPU scheduling and virtual-memory techniques. There are
additional features of a process that cannot be provided by the hardware alone like
system calls and a file system. The virtual machine approach does not provide
these additional functionalities but it only provides an interface that is same as
basic hardware. Each process is provided with a virtual copy of the underlying
computer system.
We can create a virtual machine for several reasons, all of which are fundamentally
related to the ability to share the same basic hardware yet can also support
different execution environments, i.e., different operating systems simultaneously.
The main drawback with the virtual-machine approach involves disk systems. Let us
suppose that the physical machine has only three disk drives but wants to support
seven virtual machines. Obviously, it cannot allocate a disk drive to each virtual
machine, because virtual-machine software itself will need substantial disk space to
provide virtual memory and spooling. The solution is to provide virtual disks.
Users are thus given their own virtual machines. After which they can run any of the
operating systems or software packages that are available on the underlying
machine. The virtual-machine software is concerned with multi-programming
multiple virtual machines onto a physical machine, but it does not need to consider
any user-support software. This arrangement can provide a useful way to divide the
problem of designing a multi-user interactive system, into two smaller pieces.
Advantages:
1. There are no protection problems because each virtual machine is completely
isolated from all other virtual machines.
2. Virtual machine can provide an instruction set architecture that differs from
real computers.
3. Easy maintenance, availability and convenient recovery.
Disadvantages:
1. When multiple virtual machines are simultaneously running on a host
computer, one virtual machine can be affected by other running virtual
machines, depending on the workload.
2. Virtual machines are not as efficient as a real one when accessing the
hardware

You might also like