You are on page 1of 75

1.

INTRODUCTION : BASICS
OF OPERATING SYSTEM
GTU Weightage : 10 marks

Prepared By:
Jayesh Chauhan
INTRODUCTION
 When we need to work with computer we
first switch on the power supply and wait till
our system becomes ready to login

 System will undergoes to different activities


during this period which is called “BOOTING”
by which system completes some important
warm up tasks that will prepare computer for
work.
OS : Definition
 “An Operating System is software that
manages computer hardware and software
resources and provides common services for
computer programs”
BASIC ARCHITECTURE OF OS
BASIC ARCHITECTURE OF OS
 OS is a software that manages all system
activities to perform desired task.
 It acts as a interface that communicates
commands issued by user application to
hardware in hardware understandable form,
get work required workdone, collect result
and reports back to the user application with
desired result in application understandable
form.
 USER : User uses system to get required work
done through user made application
 User Application : User uses these software to
accomplish certain tasks . Example: MSWORD
to prepare documents
BASIC ARCHITECTURE OF OS
 System Programs : These are set of programs
that belongs to operating system but not used
for any system management operations
 Example : compiler to convert high level
language to low level language
 Operating System: OS is a software that
manages all operations like i/o managements,
memory management, Process management,
etc.
 Hardware : It is electronic that is used to
perform all tasks requested by software layer.
BOOTING
 Following steps are performed in booting
BOOTING
Power On Self Test (POST)
 When we switch on power supply, it flows
toward voltage stabilizer famously known as
Switch mode power supply (SMPS)
 SMPS wait for fraction of second for voltage
to get stabilize and then proceed toward next
stage.
 Completion of this stage is notified with beep
sound.
BOOTING
 Following steps are performed in booting
BOOTING
Basic Input Output System (BIOS)
 POST is followed by device testing procedure.
 All the peripheral devices are connected to
computer are tested one by one before they
are considered for use which can be notified
by blinking of LED of appropriate Device.
 example keyboard, Monitor
BOOTSTRAPING
 With successful completion of BIOS system
proceed toward the next stage where a most
basic program is loaded in main
memory(RAM).
BOOTING
Operating System program execution
 After successful loading it is then handed over
to the processor for execution.
 Complete execution of these program leads to
display of login screen where user needs to
provide login credentials.
 This basic program is known as “operating
System”. Hence we can say that OS does the
task of bringing life in machine and
converting a dead hardware to usable
computer.
Objective Of OS…GTU
May..2013
 1. Convenience : It makes computing
convenient, lowering down complexity of
manual tasks.
 2. Efficient : It makes computing efficient.
saving user’s time and money.
 3. Ability to evolve : Evolve as a general
purpose tool that will cover all possible
domains
 it can be summarized as :
 1. Provides user-friendly interface
 2. Make tentative arrangement of recourses
 3. Provides appropriate method for data
storage and communication
Objective Of OS
 4. Provides reliable and safe environment for
execution of user applications.
 5. supports user activities through efficient
services like
 a. For programmer : Availability of utilities
that will be use while writing, compiling,
executing, testing and debugging programs ,
example : compiler, debugger
 b. For end users : availability of various
application programs that will make
computing a great experience.
 Example : MSoffice
Functions of OS…GTU
Dec..13, MAY..14
 Example: It is very normal scenario to see
people doing multiple jobs on a computer,
like listening to music while browsing through
the mail box and downloading some data in
the background.
Functions of OS…GTU
Dec..13, MAY..14
 1. Process management:
 Simultaneous execution leads to multiple processes.
 thus creation, execution and termination of a process
are the most basic functionality of an OS.
 If processes are dependent, than they may try to share
same resources. thus task of process synchronization
comes to the picture.
 If processes are independent, than a due care needs to
be taken to avoid their overlapping in memory area.
 based on priority, it is important to allow more
important processes to execute first than others.
 these all responsibility will cover by process
management
Functions of OS…GTU
Dec..13, MAY..14
 2. Memory management:
 For every newly created process we need to provide
some space in memory for execution.
 Allocation and de-allocation of memory to and from
process.
 Reallocation as per the availability and requirement.
 3. File management:
 If we consider that example of beginning, for a music
player to play song we need to provide song file as input
to application
 Required file must be existing so that it can be supplied
as an input to audio application.
Functions of OS…GTU
Dec..13, MAY..14
 In multiuser system it is quite possible that more than
one user may try to access a common file with different
intention.
 There may be efficient mechanism that will handle such
situations to avoid data inconsistency.
 1. There must be a facility to manage file operation like
create, modify, rename, copy, delete, etc.
 2. management of directory structure that will make
search operation easy.
 3. Protection of data against misuse by providing
security.
Functions of OS…GTU
Dec..13, MAY..14
4. I/O management:
consider example stated at beginning , we can see that
user taking input using multiple ways , example: mouse is
used to browse through mailbox while music player reading
data from file and delivering audio output to the speaker.
 In OS there must be a mechanism that keeps track of
data coming in or going out of system and its
appropriate application or device to whom it is intended
for I/O management
 a. It manages with I/O devices and their drivers
 b. Managing with device control operations.
Functions of OS…GTU
Dec..13, MAY..14
5. Security and Protection:
 We need to protect our data from theft or misuse
 Different ways for that are:
 1. Providing password protection mechanism
 2. assigning access right permission to files and
directories.
6. User Interface Mechanism
 User interface is a method that an application provides
for its users to interact with it.
 There are two methods:
 a. Command line user interface: where interaction is
done trough console, generally command based.
Functions of OS…GTU
Dec..13, MAY..14
b. Graphical user interface: where interaction is made by
clicking.
Types of OS…GTU MAY..12,
MAY..13, …7 marks
 1. Batch operating system
 At beginning around 50’s system used to consume more
set up time. So to overcome this problem it was decided
to process the jobs in batches (groups), this technique is
known as batch programming.
 In this technique jobs of similar type were submitted to
CPU for processing and executing together.
 These systems mainly focus on automatic execution of
the jobs in a batch. This task is carried out under
supervisory program known as a ‘Batch Monitor’ program
that resided in the lower end of main memory.
 Here all jobs are stored in hard disk to create pool of
jobs for it’s execution as a batch.
Types of OS…GTU MAY..12,
MAY..13, …7 marks
 Initially all jobs from job pool are read and executed by
the batch monitor. These jobs are grouped by placing
identical jobs (jobs with similar needs) in same batch.
 Batch processing system than executes these grouped
jobs automatically one after another saving its time by
undertaking all required activities (like loading, linking)
only for once. This resulted in to improved system.
 In previously job processing systems all jobs are placed
in queue. Jobs were allocated with required memory
and when space was available in main memory.
 A job was selected from job queue when processor
became available , the processor scheduler selects job
that was loaded in the memory and execute it.
Types of OS…GTU Dec..13,
MAY..14

Fig -System flow diagram


Types of OS…GTU Dec..13,
MAY..14

Traditional job processing Batch File processing


Problem with batch system

 This system does not provide any opportunity of user


intervention during job execution and all jobs execute
on first come first serve basis. There is no scope to
provide priority to jobs.
 In this system only one job could engage the processor
for long time if there was any delay in its input/output
operation, the processor time was wasted till the
completion of I/O job. This resulted in underutilization
of CPU time
2. Multiprogramming
Operating System
 This method was introduce to overcome the problem of
underutilization of CPU and Main memory.
Multiprogramming is nothing but interleaved execution
of multiple jobs by same computer.
 While one program is busy waiting for I/O, Other
program is kept ready to utilize the CPU.
 Thus CPU time is shared based on status of program
under execution at that time.
 It is not about execution of jobs at the same instance of
time, rather it mean that there only a portion of one is
executed than a segment of another.
2. Multiprogramming Operating System

Fig :Process of multiprogramming

 In this figure we can see that at a particular time , If job ‘A’


is not utilizing CPU time because it is busy in I/O options
than CPU executes job ‘B’
 If same thing is repeated again than another job C is waiting
for the CPU for getting its execution time . In this way CPU
will never remain idle and will fully utilized for maximum
amount of time.
3. Time Sharing Operating
System
 In This method it is possible to allow many users( user
applications) to share the computer resources at same time.
 all system resources are allotted on time sharing basis with
each process could use resources in a definite time slots.
 This creates a scene as if all process are using resources
simultaneously.
 Aim of time sharing OS is to make interactive use of computer
system.
 System switches quickly from one user to another , a very
short span that is given to each user.
 The OS distributes CPU time slots based on number of users
trying to execute their tasks. once this time is utilizes control
is given to next user on system.
3. Time Sharing Operating System

Fig :Time sharing system

 from figure it is clearly visible that there are five users, out
of these all user 5 is active but user 1, user 2, user. 3 and user
4 are in waiting for their turn and user 6 is in ready status.
 After user 5 utilizes it’s quantum period, the control moves
on to the next ready user as in case user 6. For next stage
user 2,user 3, user 4 and user 5 are in waiting state and user
1 is in ready state
3. Time Sharing Operating
System
 ADVANTAGES
 Provides quick response
 Bring down CPU’s idle time.
 DISADVANTAGES
 System has to rely totally on other executing processes.
 Must need to take about security and integrity of user
programs and data
 Problem related to data communication must be resolved.
4. MULTIPROCESSOR SYSTEM
 Multiprocessor systems with more than on CPU in close
communication.
 Tightly coupled system – processors share memory, bus,
peripheral devices and a clock; communication usually takes
place through the shared memory.
I. FEATURES OF MULTIPROCESSOR SYSTEM
It supports large physical address space and larger virtual
address space.
II. If one processor fails then other processor should retrieve
the interrupted process state so execution of process can
continue.
III. Inter-processes communication mechanism is provided and
implemented in hardware
IV. Multiprocessor systems are of two types.
a. Symmetric Multiprocessing b. Asymmetric multiprocessing
4. MULTIPROCESSOR SYSTEM
 Symmetric multiprocessing (SMP)
✦ Each processor runs and identical copy of the operating
system.
✦ Each processor uses different data and program but sharing
some common resources like I/o Devices.
✦ Many processes can run at once without performance
deterioration.
✦ Most modern operating systems support SMP
4. MULTIPROCESSOR SYSTEM
 Asymmetric multiprocessing (AMP)
✦All CPUS are not equal. There is one master processor and
remaining are slave processor. Each processor have it’s own
memory space.
Each processor is assigned a specific task; master processor
schedules and allocated work to slave processors.
✦ More common in extremely large systems
 DIFFERENCE BETWEEN SYMMETRIC AND ASYMMETRIC
MULTIPROCESSING.
 Symmetric system treats all processors are equals, I/O can
processed on any CPU.
 Asymmetric multiprocessing has one master CPU and the
remaining CPUs are slaves. The master distributes tasks
among the slaves. and I/O is usually done by master.
4. MULTIPROCESSOR SYSTEM
 ADVANTAGES OF MULTIPROCESSOR SYSTEM
i. Throughput : Increases because number of processor is
increases
ii. Cost : Multiprocessor System is cheaper than the multiple
single processor system.
iii. Reliability : If one processor fails , there is no effect on
whole system operation.
iv. Response time : less because number of processor are
increased.
5. CLUSTERED SYSTEM
 Clustered system is a group of computer
system connected with a high speed
communication link (LAN).
 Independent systems, with shared common
storage and connected by a high-speed LAN,
working together.
 Clustering systems are integrated
with hardware cluster (supports
sharing of high performance disks)
and software cluster(In form of
unified control of computer system
in a cluster work as a server) Fig-General structure of
a clustered system
 Cluster node(server) contains layer
of cluster software and run it on the
node. Each node(server) monitors
the network whether cluster work
properly or not
5. CLUSTERED SYSTEM
 If monitored computer fails than monitoring computer takes control
and ownership of it’s storage and other resources and restart
application of failed computer
 It is divided in to two parts
 1. Asymmetric Clustering : Here one machine is always in stand by
mode while other machines running it’s applications.
 The stand by machine only monitor the active server. When active
server fails the host standby machines takes control and became
active server.
 2. Symmetric Clustering : More than one servers run the application
and uses all available hard disks for operation
6. Distributed System
• Distributed Systems consist of multiple, possibly
heterogeneous, computers connected together via a network
and cooperating in some way, form, or fashion.
• Networks may range from small tight LANs to broad reaching
WANs.
• WAN = Wide Area Network, such as an international corporation
• MAN =Metropolitan Area Network, covering a region the size of a city
for example.
• LAN =Local Area Network, typical of a home, business, single-site
corporation, or university campus.
• PAN = Personal Area Network, such as the bluetooth connection
between your PC, phone, headset, car, etc.
6. Distributed System
• OS view of the network may range from just a special form of
file access to complex well-coordinated network operating
systems.
• Shared resources may include files, CPU cycles, RAM, printers,
and other resources.
6. Distributed System
• Advantages
• 1. Resource sharing : sharing of software resources like
databases, libraries and hardware resources like CPU cycles,
hard disks, RAM, CDROM, printers.
• 2. Higher reliability : Reliability refers to degree of tolerance
against errors and component failure. Availability is important
aspect of reliability. Availability refers to fraction of time
resources available for use. we can increase availability of
hard disk by having multiple hard disks so if one hard disk fails
or un available , program can use some other hard disks
• 3. Shorter response time and higher throughput.
• 4. Incremental growth : to extend power and functionality of
system by simply adding additional resources to system.
7. Network Operating System
 An operating system oriented to computer networking, to
allow shared file and printer access among multiple
computers in a network, to enable the sharing of data, users,
groups, security, applications, and other networking
functions. Typically over a local area network (LAN),
or private network.

 In network operating system user can login to remote


resources and can access remote resources. there are
multiple machines are connected by communication link. User
can transfer data from their own machine to remote machine.
 Example : Microsoft windows server 2008,Linux
8. Real time Operating System
 Time constraint is key parameter in RTOS.
 When user gives an input to system, it must process it within
time limit and result is send back. Real time system fails if it
does not give result within the time limits.
 A real time kernel is a software that manages time and
resources of micro-processor, micro controller and provides
services to user applications.
Hard real time system :
In Hard RTOS critical task must
SOFT RTOS
RTOS

be completed within time limit


HARD RTOS All delay in system is fixed and
time bounded.
Existing general purpose OS is
does not supports hard RTOS. It
can not keep wait for linger
time without allotting kernel.
8. Real time Operating System
 Soft RTOS : It is less restrictive.
 It can not guarantee that it will able to meet deadline under
all conditions.
 Example : digital telephone or digital audio
 APPLICATION AREAS OF RTOS
 i. transportation : Air traffic control and traffic light system
 ii. Communication: digital telephone
 iii. Detection: radar system
 iV : Flight simulation : Auto pilot mode
 In real time system memory management is less demanding
than other types of OS.
8. Real time Operating System
Difference between hard and soft RTOS
HARD REAL TIME SOFT REAL TIME
OPERATING SYSTEM OPERATING SYSTEM
1. Hard response time is required. 1. Soft response time is required

2. Size of data file is small or medium 2. Size of data file is large.

3. It have little laxity and generally 3.It is more flexible and have greater
provides full deadline compliance laxity and can tolerate certain
amount of deadline misses
4. Safety critical systems are 4. Linux is an example of softRTOS
typically hard real system.
BASIC SERVICES PROVIDED BY OS
 EXPLAIN BASIC SERVICES PROVIDED BY OS ON BARE HARDWARE
MACHINE……. GTU, DEC 2014…….7 marks
 OS provides different kinds of services to different user
programs like load data from memory, allocating disk for
storage, file or directory for open and read..
 Services provided by OS are:

Program Error
Executtion Input Output
Operation detection
Accounting

User
File and Interface
Directory Communica
operation -tion
BASIC SERVICES PROVIDED BY OS
 1. Program Execution : before executing the program it is
loaded to main memory by OS. Once program loads in main
memory it’s execution will be start.
 Program may finishes execution with or without error.
 2. Input output Operation : program is combination of input,
output statements.
 while executing programs it requires input , output devices.
OS provides input, output devices to program.

 3. Error detection : error detection regarding to memory,


CPU, I/O devices.
 In user program execution errors may be like memory is full,
stack overflow, File not found, Director or file is not exist,
printer in not ready, attempt to access illegal memory..
BASIC SERVICES PROVIDED BY OS
 4. File and Directory operations : Os provides services for all
operations of user with files and directories like create,
modify, rename, delete, search file from directory,
 5. Communication :Communication between two processes
may be on same machine or two processes of different
machine can be done by pipe, shared memory, socket or
message passing
 shared memory :here one process will create memory portion
which the other process can use.
 It is faster form of interprocess communication because data
does not need to copied between processors.
 Socket : it is bidirectional communication device that can be
used to communicate with other process on same machine
with process running on another machine.
 Message passing : Here processes communicates with each
BASIC SERVICES PROVIDED BY OS
 6. User interface : User interacts with OS by user interface.
 It plays vital role in making use of application simple and
effective for operation
 It is categorized in to two parts:
 a. GUI (Graphical user interface) : It is interface where all
commands are tagged to the picture objects.
 These picture objects can be pointed using input devices like
mouse.
 It reduces burden of memorizing commands.
 by GUI non computer savvy will able to use the application
effectively without special guideline.
 b. Command line user interface:
 It is another way to issue system commands.
 Here all operations are carried out using manual commands.
BASIC SERVICES PROVIDED BY OS
 7. Accounting :
 It is important task that keeps track of information of
resources and users which types of resources are allocated to
which user and whether particular user has permission for this
type of resources.
SYSTEM CALL
 What is system call in OS ? How it is handled by OS?...DEC
2012, MAY 2012, DEC 2014……………7 marks
 System call provides interface between running program and
kernel of Operating system.
 single CPU computer can execute one instruction at a time.
 Operating system provides services and system call provides
interface to these services.
 If process is running of user program and needs a system
service such as reading data from file. then it has to execute
TRAP function to transfer control from user application to
kernel.
 By system call program execution in user mode can request
kernel’s services.
 API(Application Program Interface) is a function definition
that describe how to obtain that service and returns integer
SYSTEM CALL
 And this number will be transfer to kernel. kernel is a
software program that provides services to input
program of operating system like, input, output,
memory,CPU
 It maintains a table which contains all system call
with it’s number. so by matching number from table,
it’s corresponding service will be provided.
 Result will be send back to user application. as well
as it takes parameter of user function either from
RAM or from CPU register and control transfers from
kernel to user mode.

Kernel : write() with


output device code
….. GCC LIBRARY (API) Monitor
printf(“hi”); 201
stack “hi”
USER SPACE

KERNEL SPACE
CLASSIFICATION OF SYSTEM CALL
 1. File management : File management system calls are to
create file, close file, read file, write file, get and set file
attributes
 examples : read(), write(), open(), close(), etc.
 Every file has some attributes like name of file, type of file,
accounting information, etc.

 2. Process management : useful to create, terminate, execute


processes
 example : fork() – to create process, exit(), wait(), etc.

 3. Inter process communication(IPC): pipe, socket, message


passing and shared memory are used for IPC
 calls : pipe(), shmget() – for shared memory, msg_send(),
msg_receive(), socket()
CLASSIFICATION OF SYSTEM CALL
 4. I/O management: System calls like request() device and
release () device , get and set attributes, read(), write()

 5. Information processing and maintenance:


 set date and time, get time and date, get system data, get
and set processes, files and devices
 like getpid(), date()
OS STRUCTURE
 a. simple structure
 b. Layered approach

 1. simple structure
 Microsoft-Disk Operating system(MS-DOS) is example of simple
structure OS.
 Most of commercial systems do not have well defined
structure. DOS is small and simple in size, when new versions
are introduced, size goes increasing.
 There is no CPU execution mode (user and kernel) and so
error in application can cause whole system to crash.
 MS-DOS consists following layers
 1. Application program layer
 2.System program layer for resident program
OS STRUCTURE
 3. Device driver layer
 4. ROM BIOS device driver layer
 In DOS, application program directly interact with BIOS driver.
If user makes any changes in the BIOS device driver, it creates
the problem and affect all system. Here memory size is also
limited so after use memory must be made free for other
users.
 Another example of layered operating system is UNIX
operating system.
 initially it’s provides limited hardware functionality. UNIX is
divided in to two parts : kernel and system programs.
 Kernel provides system call for CPU scheduling, file
management and memory management. System call uses
application program interface in UNIX. API defines set of user
interface with set of system programs Kernel supports API and
user interface.
LAYERED STRUCTURE
 Second type of operating system is layered approach. OS is
divided in to number of layers. such layer boundary is
properly defined. Bottom layer is called layer 0 and top layer
is called layer N. Layer N provides user interface.
 A function of layer is also fixed. each layer consists of data
structure and set of routines. layer provides services to upper
and lower layer.
LAYERED STRUCTURE
 First layer (layer 0) contains only basic hardware to
implement function. so only first layer is debugged for
checking whole system. If error not found then the system will
work properly. If error encounters while debugging second
layer, then error is related to second layer only.
 Care should be taken while designing the layers. which
functions are added to which layer must be designing
properly. some of the functions included only in lower level.
Device driver, memory management and input output
operation function must be included in lower level.
 Secondary storage will required for all operations, when CPU
changes the process as per scheduling method, currently
executing process is stored o secondary storage. DISK space is
required for this purpose. So CPU scheduling is includes in the
above layer of the secondary storage.
LAYERED STRUCTURE
 Advantages of Layered Approach:
 1. Modularization makes debugging much easier.
 2. Simple to design and implement
 3. Provides transparency between layers
 DISADVANTAGES OF LAYERED APPROACH
 1. less efficient because system call takes longer time
 2. Interaction between layers and parameter passing is
difficult.
Kernel
 Kernel is a software code that reside in central core of OS.
It has complete control over system.
 Kernel does not interact directly
with user, But it interacts
using SHELL and other programs
and hardware.
 When operation system boots, kernel is first part of OS to
load in main memory. Kernel remains in main memory for
entire duration of computer session. The kernel code is
usually loaded in to protected area of memory.
 Kernel performs it’s task like executing processes and
handling interrupts in kernel space. User performs it’s task
in user area of memory. This memory separation is made in
order to prevent user data and kernel data from interfering
with each other.
Kernel
 When computer crashes, it actually means kernel has crashed.
Single program crash is not a kernel crash. kernel provides
services for process management, file management, i/O
management, memory management. System calls are used to
provide this type of services.
 Kernel includes
 a. Scheduler : allocates the kernel’s processing time to
various processes.
 b. Supervisor : it grants permission to use computer system
resources to each process.
 3. Interrupt handler : handles all requests from the various
hardware devices which compete for kernel services.
 4.Memory manager : allocates space in memory for all users
of kernel service.
Kernel
 Types of kernel
 1. Monolithic kernel
 2. Micro kernel
 3. Hybrid kernel
 4. Exo-kernel
Monolithic Kernel
 Traditional UNIX OS uses monolithic kernel. The entire OS runs
as a single program in kernel mode. Program contains
operating system core function and device driver.
 In this approach, most of operations performed by kernel via
system call. LINUX OS uses modern monolithic kernel
architecture. It loads the modules at run time.
USER APPLICATIONS

FILE Memory
I/O Process
Mgmt

I/O Memory Interrupt


Drivers Manager driver

COMPUTER HARDWARES
Monolithic Kernel
 Advantages :
 1. simple to design and implement
 2. It provides speed on hardware
 Dis-advantages:
 1. If code size increases, difficult to maintain.
 2. Fault tolerance is low.
Micro Kernel
 Microkernel provides minimal services like defining
memory address space, IPC and process management.
 It is small operating
code. Hardware
resource management
is implemented
whenever process
is executing.
 The function of microkernel is to provide a communication
facility between the client programmers. For
communication it uses message passing method.
 Microkernel runs in kernel mode and rest run in normal
user processes. It is also provides more security and
reliability. Most of services are running as user rather than
kernel processes.
Micro Kernel
 here device driver and file system running as separate user
processes, a error in one can crash only single component.
 Advantages:
 1. allows addition of new services
 2. Supports objects oriented OS
 3.Modular design helps to enhance reliability.
 4.It lends it self to distributed system support
 5. microkernel architecture support flexibility. User can add
or subtract services according to requirement.
Comparison between monolithic and microkernel
Monolithic Kernel Micro kernel

1. Kernel size is large 1. Kernel size is small

2. OS is complex to design 2. OS is easy to design, implement


and install

3. Request may be serviced faster 3.Request may be serviced slower


than monolithic kernel

4. All the operating system services 4. Kernel provides only IPC and low
are included in kernel level device management services.

5. No message passing, no context 5. It requires message passing and


switching required while kernel is context switching.
performing job.
Reentrant Kernel
 If several processes enters in kernel mode at same time, A
reentrant kernel is able to suspend the current running
process even if process is in kernel mode.
 With reentrant kernel the scheduler will assign CPU to
another process until interrupt from disk controller
indicates that data is available and the earlier thread can
be resumed
 If hardware interrupts occurs, a reentrant kernel is able to
suspend current running process if that process is in kernel
mode. which improves the throughput of the device
controllers that issues inputs.
 Once device has issued interrupt, it waits until the CPU
acknowledges. If the kernel is able to answer quickly, the
device controller will be able to perform other tasks while
CPU handles the interrupt.
Virtual Machine
 Virtualization means it is looking something different than
existing.
 Virtualization deals with extending actual interface so as to
mimic the another system.
 Example VMWARE, XEN,Virtual Private network
Here user
see is this
system
something
different

 Virtual memory : Consider following figure which contains


one memory block which contains 1 to 100 blocks
1
1 but actually the memory is from

1…1000.

there are 10 users but they had


maintained one user interface based
100 on this (all have slot from 1..10)
1000
Virtual Machine
 When user 1 writes data on memory he can uses location
from 1 to 100. and it will be written actually in first 1…to
100 location of actual memory
 Whenever user 2 writes something on it’s location 5, it is
basically written to memory location 105 of actual memory,
but here user 2 thinks that he is writing in line 5..this is
called virtualization of memory
Here in physical machine CPU executes
your process, memory is used to store
data, NIC (network interface card is
used to perform networking task and
RAM contains faster memory inform of
stack)
Virtual Machine
 Physical hardware are processors, memory, I/O bus, devices
 Most of time in PC resource utilization is generally 5% to 10%
which is very less and it leads to under-utilization of resources.
 this problem arises because of hardware is tightly coupled with
operating system and there will be only one OS that controls all
hardware resources one at a
time. time
 Virtual Machine
If we remove OS from here and add
abstract layer of virtualization and
divide hardware in to two parts for two
virtual machines which have their own
OS.
Here these hardware are not physical
H/w but these are virtual h/w .
Virtual h/w: processors,
Vitual Machine architecture
Virtual Machine
 In different virtual machine you can have different OS like
in machine 1 you have Linux and in machine 2 you have
Windows
 Whenever OS try to access CPU it will see it’s virtual CPU, if
OS pass command to execute process, virtual CPU send it to
actual CPU but now actual CPU is also shared by another
Virtual OS/Machine
 If you have 100% utilization than 50% CPU cycles given to
VM1 and other 50% given to VM2.
 If VM1 utilizes 25% cycles out of 50% and VM2 utilizes 0
cycles out of 50% than we can say that total utilization is
25% but VM1 thinks that total utilization is 50%.
 It provides secure multiplexes of hardware resources
VM1 VM2 VM3 VM4 If host contains 4 virtual
machines than 4 parts of 1
0.25 0.25 o.25 0.25
second given to each CPUs
Virtual Machine
 Advantages:
 provides strong guarantees if one of virtual machine
infected by virus, software bugs or crashes, it does not
affect other VMs.
 It increases resource utilization because of multiplexing.

You might also like