0% found this document useful (0 votes)
151 views

Cs3451 Ios Unit 5 Notes

Uploaded by

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

Cs3451 Ios Unit 5 Notes

Uploaded by

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

lOMoARcPSD|5506738

CS3451-IOS-Unit 5 Notes

introduction to operating systems (Anna University)

Scan to open on Studocu

Studocu is not sponsored or endorsed by any college or university


Downloaded by Sheik Mohideen ([email protected])
lOMoARcPSD|5506738

UNIT V

VIRTUAL MACHINES AND MOBILE OS

Syllabus:

Virtual Machines - History, Benefits and Features, Building Blocks, Types of Virtual
Machines and their Implementations, Virtualization and Operating-System Components;
Mobile OS iOS and Android.

5.1. OVERVIEW

Idea: To abstract the hardware of a single computer like CPU, memory, disk drives etc., into
several different execution environments, thus creates the illusion that each separate
environment is running on its own private computer.

Virtual machine implementations involve several components.


 Base is host-hardware system that runs virtual machines.
 virtual machine manager (VMM) also known as a hypervisor creates and runs virtual
machines by providing an interface that is identical to the host
 Each guest process (an operating system) is provided with a virtual copy of the host.

Hence a single physical machine can run multiple operating systems concurrently, each in its
own virtual machine.

(a) Non virtual machine (b) Virtual machine

Uses of Virtualization:
 for data-center operations,
 for efficient application development, and
 software testing

5.2. HISTORY

Virtual machines commercially released by IBM mainframes in 1972 as IBM VM operating


system. IBM VM/370 divided a mainframe into multiple virtual machines, each running its
own operating system.

Downloaded by Sheik Mohideen ([email protected])


lOMoARcPSD|5506738

Difficulty with VM approach is it involves disk systems. Suppose the physical machine had
three disk drives but need to support seven VM. Then cannot allocate a disk drive to each
VM.

Solution: provides virtual disks-called as minidisks in IBM's VM operating system.


Minidisks similar to system's hard disks except size. System implemented each minidisk by
allocating as many tracks on physical disks as minidisk needed. Once the VM's were created,
users could run any operating systems or software packages that were available on the
underlying machine.

Most systems could not support virtualization. However, virtualization establishes the system
requirements and a target for functionality. Virtualization requirements are:
 Fidelity. AVMM provides an environment for programs that is identical to the
original machine.
 Performance. Programs running within that environment have minor performance
decreases.
 Safety. The VMM is in complete control of system resources.

By late 1990s, Intel 80x86 CPUs had become common, fast, and rich in features.

5.3. BENEFITS AND FEATURES


Advantages:
The ability to share the same hardware and can run several different execution environments
concurrently.
Virtual machines are completely isolated from each other. Hence no protection problems.
The host system is protected from the virtual machines. A virus inside a guest operating
system might damage that operating system not the host or other guests.
Disadvantages:
 Isolation - prevents sharing of resources.
 There are 2 approaches for sharing.
o As it is possible to share a file-system volume and hence the files can be
shared.
o It is possible to define a network of virtual machines that can send information
over virtual communications network.
 VMM allows any number of guests to use physical resources like a physical network
connection where the guests communicate via the physical network.

FEATURES

1. Ability to freeze or suspend a running Virtual Machine.


o VMMs allow to take many copies and snapshots to be made of the guest. The
snapshot records a point in time, and the guest can be reset to that point if
necessary. For example, snapshots might record a guest's state every day for a
month, making restoration to any of those snapshot states possible.
o The copy is used to create a new VM or to move a VM from one machine to
another with its current state intact. The guest can then resume where it was, as if
on its original machine, creating a clone.
o A virtual machine system is a perfect medium for operating-system research and
development. As it allows more than one operating system to work
simultaneously, hence it doesn't destroy or cause error in the operating system's
file system.
o To test an operating system that runs on and controls the entire machine, must be
stopped and taken out of use for a while then the changes are made and tested.

Downloaded by Sheik Mohideen ([email protected])


lOMoARcPSD|5506738

This period is called as system-development time. This operation can be done


easily with VM.
o Another advantage of VM for developers as the multiple operating systems can
run concurrently.
o Similarly, quality assurance engineers can test their applications in multiple
environments without buying, powering, and maintaining a computer for each
environment.
o A major advantage of virtual machines in production data-center use is system
consolidation that involves taking two or more separate systems and running them
in virtual machines on one system. Such physical-to-virtual conversions need
resource optimization.
o Virtualization can improve not only resource utilization but also resource
management.
2. VMMs supports a live migration
o This feature that moves a running guest from one physical server to another
without interrupting its operation or active network connections.
o If a server is overloaded, it frees resources on the source host without disrupting
the guest.
o "Open Virtual Machine Format" provides standardization, and it unifies the virtual
machine formats.
o Cloud computing is made possible by virtualization in which resources such as
CPU, memory, and I/O are provided as services to customers using Internet
technologies.

5.4. BUILDING BLOCKS

The ability to virtualize depends on the features of CPU. If features are sufficient, then VMM
(Virtual Machine Manager) can be written that provides a guest environment. Otherwise,
virtualization is impossible.

VMMS use several techniques to implement virtualization, including trap-andemulate and


binary translation.

5.4.1. Trap-and-Emulate
On dual-mode system, virtual machine guest can execute only in user mode. The
kernel runs in kernel mode, and it is not safe to allow user-level code to run in kernel mode.
Following procedure is followed to perform the transfer:
When the kernel in the guest attempts to execute a privileged instruction, that is an
error (because the system is in user mode) and causes a trap to the VMM in the real machine.

 But kernel mode privilege mode code runs slower due to trap-and-emulate

Downloaded by Sheik Mohideen ([email protected])


lOMoARcPSD|5506738

o Especially a problem when multiple guests running, each needing trap-and-


emulate
 CPUs adding hardware support, mode CPU modes to improve virtualization
performance.

5.4.2. Binary Translation

 Some CPUs don’t have clean separation between privileged and nonprivileged
instructions
 Earlier Intel x86 CPUs are among them
o Earliest Intel CPU designed for a calculator
 Backward compatibility means difficult to improve
 Consider Intel x86 popf instruction
o Loads CPU flags register from contents of the stack
o If CPU in privileged mode -> all flags are replaced
o If CPU in user mode -> only some flags replaced
o No trap is generated

In this method, caching provides the solution. The replacement code for each instruction that
needs to be translated is cached. All later executions of that instruction run from the
translation cache and need not be translated again. If the cache is large enough, this method
can greatly improve performance.

Fig. 5.3. Binary translation virtualization implementation

 Issue in virtualization: memory management, specifically the page tables. How


VMM keep page-table state both for guests and for VMM itself?
 A common method, used with both trap-and-emulate and binary translation, is to use
Nested Page Tables (NPTs).
 Each guest operating system maintains one or more page tables to translate from
virtual to physical memory.
 The VMM maintains NPTs to represent the guest's page-table state. The VMM knows
when the guest tries to change its page table, and it makes the equivalent change in
the NPT.
 Although the binary translation method creates large amounts of overhead, it
performed well enough.

5.4.3. Hardware Assistance

Downloaded by Sheik Mohideen ([email protected])


lOMoARcPSD|5506738

Without some level of hardware support, virtualization would be impossible. More the
hardware support available within a system, the more feature-rich and stable virtual machines
can be and they can perform better.

In Intel x86 CPU family, Intel added new virtualization support (VT-x instructions) in
successive generations. No binary translation is needed.

Figure. Nested Page tables.

In fact, all major general-purpose CPUs now provide extended hardware support for
virtualization. Example: AMD virtualization technology (AMDV).

It defines two new modes of operation - host and guest - thus moving from a dual-mode to a
multimode processor.

The VMM can enable host mode, define the characteristics of each guest virtual machine, and
then switch the system to guest mode, passing control of the system to a guest operating
system that is running in virtual machine. In guest mode, the virtualized operating system
thinks it is running on native hardware and sees whatever devices are included in the host's
definition of the guest.

If the guest tries to access a virtualized resource, then control is passed to the VMM to
manage that interaction.

Downloaded by Sheik Mohideen ([email protected])


lOMoARcPSD|5506738

A nested page-table violation caused by an attempt to access unavailable memory can result
in the guest's exit. With AMD's RVI memorymanagement enhancements, VMMs no longer
need to implement software NPTs. In essence, these

CPUs implement nested page tables in hardware to allow the VMM to fully control paging
while the CPUs accelerate the translation from virtual to physical
addresses. The NPTs add a new layer, one representing the guest's view of logical-tophysical
address translation.

The CPU page-table walking function includes this new layer as necessary, walking through
the guest table to the VMM table to find the physical address desired.

o ATLB miss results in a performance penalty, because more tables must be traversed
to complete the lookup.
o Figure shows the extra translation work performed by the hardware to translate from a
guest virtual address to a final physical address.
o First, the VMM sets up protection domains to tell the CPU which physical memory
belongs to each guest. Next, it assigns the I/O devices to the protection domains,
allowing them direct access to those memory regions and only those regions.
o The hardware then transforms the address in a DMA request issued by an I/O device
to the host physical memory address associated with the I/O.
o In this manner, DMA transfers are passed through between a guest and a device
without VMM interference.
o Similarly, interrupts must be delivered to the appropriate guest and must not be visible
to other guests.
o By providing an interrupt remapping feature, CPUs with virtualization hardware
assistance automatically deliver an interrupt destined for a guest to a core that is
currently running a thread of that guest.

5.5. TYPES OF VIRTUAL MACHINES AND IMPLEMENTATIONS

5.5.1. The Virtual Machine Life Cycle

o While a virtual machine is created, whatever be the hypervisor type, its creator gives
the VMM certain parameters.
o These parameters include the number of CPUs, amount of memory, networking
details, and storage details that the VMM will take into account when creating the
guest.
o Example, if a user wants to create a new guest with two virtual CPUs, 4 GB of
memory, 10 GB of disk space, one network interface that gets its IP address via
DHCP, and access to the DVD drive. The VMM then creates the virtual machine with
those parameters.

5.5.2. Types of VMs - Type 0 Hypervisor

o Type 0 hypervisors exists with the names "partitions" and "domains." They are a
hardware feature.
o The VMM itself is encoded in the firmware and loaded at boot time.
o In turn, it loads the guest images to run in each partition.
o The feature set of type 0 hypervisor is smaller than other types because it is
implemented in hardware.

Downloaded by Sheik Mohideen ([email protected])


lOMoARcPSD|5506738

o For example, a system might be split into four virtual systems, each with edicated
CPUs, memory, and I/O devices. Each guest believes that it has dedicated hardware
because of simplifying many implementation details.
o Making the I/O available has some difficulty, as it is not easy to dedicate I/O devices
to guests if there are not enough.
o Solution: hypervisor manages the shared access or grants all devices to a control
partition. In control partition, a guest operating system provides services via daemons
to other guests, and the hypervisor routes I/O requests appropriately.
o Some type 0 hypervisors can move physical CPUs and memory between running
guests. In this case, the guests are paravirtualized, aware of virtualization and
assisting in its execution.
o A guest must watch for signals from the hardware or VMM that a hardware change
has occurred, probe its hardware devices to detect the change, and add or subtract
CPUs or memory from its available resources.
o A type 0 hypervisor can run multiple guest operating systems one in each hardware
partition.
o All of those guests, as they run on raw hardware it can be VMMs.
o Each guest operating system in type 0 hypervisor is a native operating system with a
subset of hardware made available to it. Hence, it can have its own guest operating
systems.
o Other types of hypervisors cannot provide this virtualization-withinvirtualization
functionality.

Fig. 5.5. Type 0 Hypervisor


5.5.3. Type 1 Hypervisor

o Type 1 Hypervisors are found in company data centers to become "the datacenter
operating system."
o These are special-purpose operating systems that run natively on the hardware, to
support system calls and other interfaces for running programs, they create, run, and
manage guest operating systems.
o Type 1 hypervisors run in kernel mode by taking the advantage of hardware
protection, where the host CPU allows, to use multiple modes and gives guest
operating systems their own control and improved performance.
o Because they are operating systems, they must provide CPU scheduling, memory
management, I/O management, protection, and even security. They provide APIs that
support applications in guests or external applications that supply features like
backups, monitoring, and security.
o Many type 1 hypervisors are closed-source commercial offerings, such as VMware
ESX, while some are open source or hybrids of open and closed source, such as Citrix
XenServer and its open Xen counterpart.
o By using type 1 hypervisors, data-center managers can control and manage the
operating systems and applications.

Downloaded by Sheik Mohideen ([email protected])


lOMoARcPSD|5506738

o Advantage: Ability to consolidate more operating systems and applications onto fewer
systems.
o For example, rather than having ten systems running at 10 percent utilization each, a
data center might have one server manage the entire load.
o If utilization increases, guests and their applications can be moved to lessloaded
systems live, without interruption of service.
o Using snapshots and cloning, system can save the states of guests and duplicate those
states are easily.
o These hypervisors provide fewer virtualization features than other type 1 hypervisors.
o They treat a guest operating system as another process, but provide special handling
when the guest tries to execute special instructions.

5.5.4. Type 2 Hypervisor

o Type 2 hypervisors have very little operating-system involvement in these application


level virtual machine managers.
o This type of VMM is another process run and managed by the host, and even the host
does not know that virtualization is happening within the VMM.
o Type 2 hypervisors have limits not associated with some of the other types.
o For example, a user needs administrative privileges to access many hardware
assistance features of modern CPUs. If VMM is run by a standard user without
additional privileges, then VMM cannot take the advantage of these features.
o Due to this limitation, extra overhead of running a general-purpose operating system
and guest operating systems, type 2 hypervisors have poorer overall performance than
type 0 or type 1.
o Limitations of type 2 hypervisors have the benefits. They run on a variety of general-
purpose operating systems, and running them requires no changes to the host
operating system.
o Example: A student can use a type 2 hypervisor, to test a non-native operating system
without replacing the native operating system.

5.5.5. Paravirtualization

o Paravirtualization presents the guest with a system that is similar but not identical to
the guest's preferred system.
o The guest must be modified to run on the paravirtualized virtual hardware. The gain
for this extra work is more efficient use of resources and a smaller virtualization layer.
o Xen VMM became the leader in paravirtulization by implementing several techniques
to optimize the performance of guests and the host system.
o For example, Xen VMM provides clean and simple device abstractions that allow
efficient I/O communication between the guest and VMM. For each device used by
each guest, there was a circular buffer shared by the guest and VMM via shared
memory. Read and write data are placed in this buffer, as shown in Figure below.
o For memory management in Xen each guest had its own set of page tables, set to
read-only. Xen required the guest to use a hypercall to the hypervisor VMM, when a
page-table change was needed.
o This means that the guest operating system's kernel code must have been changed
from the default code to these Xen-specific methods. To optimize the performance,
Xen allowed the guest to queue up multiple page-table changes asynchronously via
hypercalls and then checked to ensure that the changes were complete before
continuing operation.

Downloaded by Sheik Mohideen ([email protected])


lOMoARcPSD|5506738

o Xen allowed virtualization of x86 CPUs without the use of binary translation.
o Xen has taken advantage of hardware features supporting virtualization. Hence it does
not require modified guests and does not need the paravirtualization method.

5.5.6. Programming-Environment Virtualization

o Virtualization based on a different execution model, is the virtualization of


programming environments. Here, a programming language is designed to run within
a custom-built virtualized environment.
o For example, Oracle's Java has many features by running in the Java virtual machine
(JVM), including specific methods for security and memory management.
o Virtualization is not only the duplication of hardware. Virtual environment is based
on APIs that provides a set of features that is made available for a particular language
and programs written in that language.
o Java programs run within the JVM environment, and the JVM is compiled to be a
native program on systems on which it runs. This means that Java programs are
written once and then can run on any system on which a JVM is available.
o The same can be said of interpreted languages, which run inside programs that read
each instruction and interpret it into native operations.

5.5.7. Emulation

o Virtualization is the common method for running applications designed for one
operating system on a different operating system, but on the same CPU.
o It works efficiently because the applications were compiled for the instruction set that
the target system uses.
o But what if an application or operating system needs to run on a different CPU?
Translate all source CPU's instructions into the equivalent instructions of the target
CPU. Such an environment is no longer virtualized but is fully emulated.
o Emulation is useful when the host system has one system architecture and the guest
system was compiled for a different architecture.
o Example, suppose a company has replaced its outdated computer system with a new
system but would like to continue to run certain important programs that were
compiled for the old system.

Downloaded by Sheik Mohideen ([email protected])


lOMoARcPSD|5506738

o The programs could be run in an emulator that translates each of the outdated system's
instructions into the native instruction set of the new system.
o Emulation can increase the life of programs and allow exploring old architectures
without having an actual old machine.

Challenge of Emulation

o Performance: Instruction-set emulation may run an order of magnitude slower than


native instructions.
o It is difficult to create a correct emulator because this task involves writing an entire
CPU in software.
o Emulation is particularly used in many popular video games which are written for
platforms that are no longer in production. Users who want to run those games
frequently can find an emulator of such a platform and run the game unmodified
within the emulator.

5.5.8. Application Containment

o Goal of virtualization: Provide a method to segregate applications, manage their


performance and resource use, and create an easy way to start, stop,. move, and
manage them.
o If the applications are all compiled for the same operating system, then there is no
need for complete virtualization to provide these features, instead use application
containment.

Example of application containment

o Oracle Solaris version 10 has included containers, or zones, that create a virtual layer
between the operating system and the applications.
o In this system, only one kernel is installed, and the hardware is not virtualized. It
provides processes within a zone with the impression that they are the only processes
on the system.
o Each zone can run its own scheduler to optimize the performance of its applications
on the allotted resources.
o Figure below shows a Solaris 10 system with two containers and the standard
"global" user space.
o Containers are much lighter weight than other virtualization methods. They use fewer
system resources and are faster to instantiate and destroy.
o Hence it is used in cloud computing.
o FreeBSD was the first operating system to include a container-like feature (called
"jails"), and AIX has a similar feature.

Fig. 5.7. A Solaris 10 system with two containers


Downloaded by Sheik Mohideen ([email protected])
lOMoARcPSD|5506738

VIRTUALIZATION AND OPERATING-SYSTEM COMPONENTS

 Operating-system aspects of virtualization include how the VMM provides core


operating-system functions like scheduling, I/O, and memory management.
 How do VMMs schedule CPU use when guest operating systems believe they have
dedicated CPUs?
 How can memory management work when many guests require large amounts of
memory?

5.6.1. CPU Scheduling


 A system with virtualization, even a single-CPU system, acts like a multiprocessor
system.
 The virtualization software presents one or more virtual CPUs to each of the virtual
machines running on the system and then schedules the use of the physical CPUs
among the virtual machines.

General case of VMM scheduling

 The VMM has a number of physical CPUs available and a number of threads to run
on those CPUs.
 The threads can be VMM threads or guest threads. Guests are configured with a
certain number of virtual CPUs at creation time, and that number can be adjusted
throughout the life of the VM.
 When there are enough CPUs to allocate the requested number to each guest, the
VMM can treat the CPUs as dedicated and schedule only a given guest's threads on
that guest's CPUs. In this situation, the guests act like native operating systems
running on native CPU.
 In some other situations, there may not be enough CPUs to go around. The VMM
itself needs some CPU cycles for guest management and I/O management and can
steal cycles from the guests by scheduling its threads across all the system CPUs.

Case of over-commitment

o It is more difficult where the guests are configured for more CPUs than exist in the
system.
o VMM can use standard scheduling algorithms to make progress on each thread but
can add a fairness aspect to those algorithms.
o Example, if there are 6 hardware CPUs needs to be allocated to 12 guest, the VMM
can allocate CPU resources proportionally, giving each guest half of the CPU
resources it believes it has.
o The VMM can still present all 12 virtual CPUs to the guests, but in mapping them
onto physical CPUs, the VMM can use its scheduler to distribute them appropriately.
o The time-of-day clocks in virtual machines are incorrect because timers take longer to
trigger than they would on dedicated CPUs.
o To correct this, the VMM makes an application available for each type of operating
system that the system administrator can install into the guests. This application
corrects clock drift and can have other functions, such as virtual device management.

5.6.2. Memory Management

o Efficient memory use in general-purpose operating systems is a major key to


performance.

Downloaded by Sheik Mohideen ([email protected])


lOMoARcPSD|5506738

o In virtualized environments, there are more users of memory leading to more pressure
on memory use. Further adding to this pressure is that VMMs typically overcommit
memory, so that the total memory allocated to guests exceeds the amount that
physically exists in the system.
o The extra need for efficient memory use is not lost on the implementers of VMMs,
who take extensive measures to ensure the optimal use of memory.
o Example, VMware ESX uses several methods of memory management. Before
memory optimization can occur, the VMM must establish how much real memory
each guest should use.

To do that, the VMM first evaluates each guest's maximum memory size.

o General-purpose operating systems do not expect the amount of memory in the


system to change, so VMMs must maintain the illusion that the guest has that amount
of memory.
o Next, the VMM computes a target real-memory allocation for each guest based on the
configured memory for that guest and other factors, such as over commitment and
system load.
o It then uses the three low-level mechanisms listed below to reclaim memory from the
guests.

1. A guest believes it controls memory allocation via its page table management, but in
reality VMM maintains a nested page table that translates the guest page table to real
page table. The VMM optimize the guest's use of memory without the guest's knowledge
or help. One approach is to provide double paging.
o Here, the VMM has its own page-replacement algorithms and loads pages into a
backing store that the guest believes is physical memory.
o VMM knows less about the guest's memory access patterns than the guest does, so
its paging is less efficient, creating performance problems.
o ● VMMs do use this method when other methods are not available or are not
providing enough free memory. However, it is not the preferred approach.
A pseudo-device driver uses device-driver interfaces, appearing to the kernel to be a device
driver, but does not actually control a device. Rather, it is an easy way to add kernel-mode
code without directly modifying the kernel.

2. VMM install in each guest a pseudo- device driver or kernel module that the VMM
controls. This balloon memory manager communicates with the VMM and is told to
allocate or deallocate memory.
o If told to allocate, it allocates memory and tells the operating system to pin the
allocated pages into physical memory hence it cannot be moved or paged out. To the
guest, these pinned pages appear to decrease the amount of physical memory it has
available, creating memory pressure.
o The guest then may free up other physical memory to be sure it has enough free
memory. Meanwhile, the VMM, knowing that the pages pinned by the balloon
process will never be used, removes those physical pages from the guest and allocates
them to another guest.
o At the same time, the guest is using its own memory-management and paging
algorithms to manages the available memory.
o If memory pressure within the entire system decreases, the VMM will tell the balloon
process within the guest to unpin and free some or all of the memory, allowing the
guest more pages for its use.

Downloaded by Sheik Mohideen ([email protected])


lOMoARcPSD|5506738

3. Another common method for reducing memory pressure is for the VMM to determine if
the same page has been loaded more than once. In this case, VMM reduces the number of
copies of the page to one and maps the other users of the page to that one copy.
o Example: VMware randomly samples guest memory and creates a hash for each page
sampled. That hash value is a "thumbprint" of the page.
o The hash of every page examined is compared with other hashes stored in a hash
table. If there is a match, the pages are compared byte by byte to see if they really are
identical. If they are, one page is freed, and its logical address is mapped to the other's
physical address.
o If multiple guests run the same operating system, then only one copy of the active
operating-system pages need be in memory. Similarly, multiple guests could be
running the same set of applications, again a likely source of memory sharing.
o The overall effect is to enable guests to behave and perform as if they had the full
amount of memory requested, although in reality they have less.

5.6.3. I/O

o Hypervisors are less concerned with how they represent the underlying hardware to
their guests.
o To deal with variety of I/O devices, operating systems uses flexible I/O mechanisms.
o Device-driver provides a uniform interface to the operating system whatever the I/O
device.
o They are designed to allow third-party hardware manufacturers to provide device
drivers connecting their devices to the operating system.
o Usually, device drivers can be dynamically loaded and unloaded. Virtualization takes
advantage and provides specific virtualized devices to guest operating systems.
o I/O devices may be dedicated to guests or the VMM may have device drivers onto
which it maps guest I/O.
o I/O in virtual environments is complicated and requires VMM design and
implementation.
o With type 0 hypervisors that provide direct device access, guests often run at the same
speed as native operating systems. When it instead provide shared devices,
performance may suffer.
o With direct device access in type 1 and 2 hypervisors, performance can be similar to
that of native operating systems if certain hardware support is present. The hardware
needs to provide DMA pass-through with facilities like VT-d, as well as direct
interrupt delivery. Given how frequently interrupts occur, the guests on hardware
without these features have worse performance than if they were running natively.
o VMMS provide shared access to devices. Consider a disk drive to which multiple
guests have access. The VMM must provide protection while the device is being
shared, assuring that a guest can access only the blocks specified in the guest's
configuration. In such instances, the VMM must be part of every I/O, checking it for
correctness as well as routing the data to and from the appropriate devices and guests.

5.6.4. Storage Management

 Virtualized environments need to approach storage management differently than do


native operating systems.
 Even the standard multiboot method of slicing the boot disk into partitions, installing
a boot manager in one partition, and installing each other operating system in another
partition is not sufficient, because partitioning has limits that would prevent it from
working for tens or hundreds of virtual machines.

Downloaded by Sheik Mohideen ([email protected])


lOMoARcPSD|5506738

 Solution to this problem depends on the type of hypervisor.


 Type 0 hypervisors often allow root disk partitioning, partly because these systems
tend to run fewer guests than other systems. Alternatively, a disk manager may be part
of the control partition, and that disk manager may provide disk space (including boot
disks) to the other partitions.
 Type 1 hypervisors store the guest root disk and configuration information in one or
more files in the file systems provided by the VMM.
 Type 2 hypervisors store the same information in the host operating system's file
systems.

5.6.5. Live Migration

One of the features found in type 0 and type 1 hypervisors is the live migration of a running
guest from one system to another.

Working principle of live migration


o A running guest on one system is copied to another system running the same VMM.
o The copy occurs with little interruption of service that users logged in to the guest, as
well as network connections to the guest, continue without noticeable impact is very
powerful in resource management and hardware administration.
o After all, compare it with the steps necessary without virtualization: warn the users to
shut down the processes, possibly move the binaries, and restart the processes on the
new system.
o Only then can users access the services again.
o Live migration can decrease the load on an overloaded system or make hardware or
system changes with no discernable disruption for users.
o Live migration is done by well-defined interface between each guest and the VMM
and the limited state the VMM maintains for the guest.

The VMM migrates a guest via the following steps:

1. The source VMM establishes a connection with the target VMM and confirms that it
is allowed to send a guest.
2. The target creates a new guest by creating a new VCPU, new nested page table, and
other state storage.
3. The source sends all read-only memory pages to the target.
4. The source sends all read-write pages to the target, marking them as clean.

Fig. 5.8. Live migration of a guest between two servers

Downloaded by Sheik Mohideen ([email protected])


lOMoARcPSD|5506738

● Live migration used to manage data center. Example: virtualization management tools
(Optimizes electricity & cooling) can monitor all the VMMs in an environment and
automatically balance resource use by moving guests between the VMMs.

Android Operating System


 Android is a mobile operating system based on a modified version of the Linux kernel
and other open-source software, designed primarily for touchscreen mobile devices
such as smartphones and tablets.
 It is free and open-source software.
 Its source code is Android Open Source Project (AOSP), primarily licensed under the
Apache License.
 About 70% of Android Smartphone runs Google's ecosystem, some with vendor-
customized user interface and some with software suite, such as TouchWizand
later One UI by Samsung, and HTC Sense.

Features of Android Operating System


Below are the following unique features and characteristics of the android operating
system, such as:
1. Near Field Communication (NFC)rd Skip 10s
Most Android devices support NFC, which allows electronic devices to interact across
short distances easily. The main goal here is to create a payment option that is simpler than
carrying cash or credit card.
2. Infrared Transmission
The Android operating system supports a built-in infrared transmitter that allows you
to use your phone or tablet as a remote control.
3. Automation
The Tasker app allows control of app permissions and also automates them.
4. Wireless App Downloads
You can download apps on your PC by using the Android Market or third-party
options like AppBrain. Then it automatically syncs them to your Droid, and no plugging is
required.
5. Storage and Battery Swap
Android phones also have unique hardware capabilities. Google's OS makes it
possible to upgrade, replace, and remove your battery that no longer holds a charge. In
addition, Android phones come with SD card slots for expandable storage.
6. Custom Home Screens
While it's possible to hack certain phones to customize the home screen, Android
comes with this capability from the get-go. Download a third-party launcher like Apex, Nova,
and you can add gestures, new shortcuts, or even performance enhancements for older-model
devices.
7. Widgets
Apps are versatile, but sometimes you want information at a glance instead of having
to open an app and wait for it to load. Android widgets let you display just about any feature
you choose on the home screen, including weather apps, music widgets, or productivity tools
that helpfully remind you of upcoming meetings or approaching deadlines.
8. Custom ROMs
Because the Android operating system is open-source, developers can twist the
current OS and build their versions, which users can download and install in place of the
stock OS. Some are filled with features, while others change the look and feel of a device.
Chances are, if there's a feature you want, someone has already built a custom ROM for it.
Architecture of Android OS
The android architecture contains a different number of components to support any android
device needs. Android software contains an open-source Linux Kernel with many C/C++
libraries exposed through application framework services.
An android operating system is a stack of software components roughly divided into five
sections and four main layers, as shown in the below architecture diagram.

Downloaded by Sheik Mohideen ([email protected])


lOMoARcPSD|5506738

o Applications
o Application Framework
o Android Runtime
o Platform Libraries
o Linux Kernel

1. Applications
An application is the top layer of the android architecture. The pre-installed
applications like camera, gallery, home, contacts, etc., and third-party applications
downloaded from the play store like games, chat applications, etc., will be installed on this
layer.
It runs within the Android run time with the help of the classes and services provided
by the application framework.
2. Application framework
Application Framework provides several important classes used to create an Android
application. It provides a generic abstraction for hardware access and helps in managing the
user interface with application resources.
It includes different types of services, such as activity manager, notification manager,
view system, package manager etc., which are helpful for the development of our application
according to the prerequisite.
The Application Framework layer provides many higher-level services to applications in
the form of Java classes. Application developers are allowed to make use of these services in
their applications. The Android framework includes the following key services:
o Activity Manager: Controls all aspects of the application lifecycle and activity stack.
o Content Providers: Allows applications to publish and share data with other
applications.
o Resource Manager: Provides access to non-code embedded resources such as
strings, colour settings and user interface layouts.
o Notifications Manager: Allows applications to display alerts and notifications to the
user.
o View System: An extensible set of views used to create application user interfaces.
3. Application runtime
Android Runtime environment contains components like core libraries and the Dalvik
virtual machine (DVM). It provides the base for the application framework and powers our
application with the help of the core libraries.
Like Java Virtual Machine (JVM), Dalvik Virtual Machine (DVM) is a register-
based virtual machine designed and optimized for Android to ensure that a device can run
multiple instances efficiently.
It depends on the layer Linux kernel for threading and low-level memory
management. The core libraries enable us to implement android applications using the
standard JAVA or Kotlin programming languages.
Downloaded by Sheik Mohideen ([email protected])
lOMoARcPSD|5506738

4. Platform libraries
The Platform Libraries include various C/C++ core libraries and Java-based libraries such as
Media, Graphics, Surface Manager, OpenGL, etc., to support Android development.
o app: Provides access to the application model and is the cornerstone of all Android
applications.
o content: Facilitates content access, publishing and messaging between applications
and application components.
o database: Used to access data published by content providers and includes SQLite
database, management classes.
o OpenGL: A Java interface to the OpenGL ES 3D graphics rendering API.
o os: Provides applications with access to standard operating system services, including
messages, system services and inter-process communication.
o text: Used to render and manipulate text on a device display.
o view: The fundamental building blocks of application user interfaces.
o widget: A rich collection of pre-built user interface components such as buttons,
labels, list views, layout managers, radio buttons etc.
o WebKit: A set of classes intended to allow web-browsing capabilities to be built into
applications.
o media: Media library provides support to play and record an audio and video format.
o surface manager: It is responsible for managing access to the display subsystem.
o SQLite: It provides database support, and FreeType provides font support.
o SSL: Secure Sockets Layer is a security technology to establish an encrypted link
between a web server and a web browser.
5. Linux Kernel
Linux Kernel is the heart of the android architecture. It manages all the available
drivers such as display, camera, Bluetooth, audio, memory, etc., required during the runtime.
The features of the Linux kernel are:
o Security: The Linux kernel handles the security between the application and the
system.
o Memory Management: It efficiently handles memory management, thereby
providing the freedom to develop our apps.
o Process Management: It manages the process well, allocates resources to processes
whenever they need them.
o Network Stack: It effectively handles network communication.
o Driver Model: It ensures that the application works properly on the device and
hardware manufacturers responsible for building their drivers into the Linux build.
Android Applications
Android applications are usually developed in the Java language using the Android Software
Development Kit. Once developed, Android applications can be packaged easily and sold out
either through a store such as Google Play, SlideME, Opera Mobile Store, Mobango, F-
droid or the Amazon Appstore.

Android Emulator
The Emulator is a new application in the Android operating system. The Emulator is a new
prototype used to develop and test android applications without using any physical device.
The android emulator has all of the hardware and software features like mobile devices
except phone calls.
Advantages of Android Operating System
o Android Google Developer
o Android Users
o Android Multitasking
o Google Play Store App
o Android Notification and Easy Access
o Android Widget
Disadvantages of Android Operating System
o Android Advertisement pop-ups

Downloaded by Sheik Mohideen ([email protected])


lOMoARcPSD|5506738

o Android require Gmail ID


o Android Battery Drain
o Android Malware/Virus/Security

IOS
IOS is a Mobile Operating System that was developed by Apple Inc. for iPhones,
iPads, and other Apple mobile devices. iOS is the second most popular and most used
Mobile Operating System after Android.
The structure of the iOS operating System is Layered based. Its communication
doesn’t occur directly. The layer’s between the Application Layer and the Hardware layer
will help for Communication. The lower level gives basic services on which all applications
rely and the higher-level layers provide graphics and interface-related services. Most of the
system interfaces come with a special package called a framework.
A framework is a directory that holds dynamic shared libraries like .a files, header
files, images, and helper apps that support the library. Each layer has a set of frameworks
that are helpful for developers.

Architecture of IOS

CORE OS Layer:
All the IOS technologies are built under the lowest level layer i.e. Core OS layer. These
technologies include:
1. Core Bluetooth Framework
2. External Accessories Framework
3. Accelerate Framework
4. Security Services Framework
5. Local Authorization Framework etc.
It supports 64 bit which enables the application to run faster.
CORE SERVICES Layer:
Some important frameworks are present in the CORE SERVICES Layer which helps the
iOS operating system to cure itself and provide better functionality. It is the 2nd lowest
layer in the Architecture as shown above. Below are some important frameworks present in
this layer:
1. Address Book Framework-
The Address Book Framework provides access to the contact details of the user.
2. Cloud Kit Framework-
This framework provides a medium for moving data between your app and iCloud.
3. Core Data Framework-
This is the technology that is used for managing the data model of a Model View
Controller app.
4. Core Foundation Framework-
This framework provides data management and service features for iOS applications.
5. Core Location Framework-
This framework helps to provide the location and heading information to the
application.
6. Core Motion Framework-
All the motion-based data on the device is accessed with the help of the Core Motion
Framework.

Downloaded by Sheik Mohideen ([email protected])


lOMoARcPSD|5506738

7. Foundation Framework-
Objective C covering too many of the features found in the Core Foundation
framework.
8. HealthKit Framework-
This framework handles the health-related information of the user.
9. HomeKit Framework-
This framework is used for talking with and controlling connected devices with the
user’s home.
10. Social Framework-
It is simply an interface that will access users’ social media accounts.
11. StoreKit Framework-
This framework supports for buying of contents and services from inside iOS apps.
MEDIA Layer:
With the help of the media layer, we will enable all graphics video, and audio technology of
the system. This is the second layer in the architecture. The different frameworks of
MEDIA layers are:
1. ULKit Graphics-
This framework provides support for designing images and animating the view content.
2. Core Graphics Framework-
This framework support 2D vector and image-based rendering and it is a native drawing
engine for iOS.
3. Core Animation-
This framework helps in optimizing the animation experience of the apps in iOS.
4. Media Player Framework-
This framework provides support for playing the playlist and enables the user to use
their iTunes library.
5. AV Kit-
This framework provides various easy-to-use interfaces for video presentation,
recording, and playback of audio and video.
6. Open AL-
This framework is an Industry Standard Technology for providing Audio.
7. Core Images-
This framework provides advanced support for motionless images.
8. GL Kit-
This framework manages advanced 2D and 3D rendering by hardware-accelerated
interfaces.
COCOA TOUCH:
COCOA Touch is also known as the application layer which acts as an interface for the
user to work with the iOS Operating system. It supports touch and motion events and many
more features. The COCOA TOUCH layer provides the following frameworks :
1. EvenKit Framework-
This framework shows a standard system interface using view controllers for viewing
and changing events.
2. GameKit Framework-
This framework provides support for users to share their game-related data online using
a Game Center.
3. MapKit Framework-
This framework gives a scrollable map that one can include in your user interface of the
app.
4. PushKit Framework-
This framework provides registration support.

Features of iOS operating System:

 Highly Securer than other operating systems.

Downloaded by Sheik Mohideen ([email protected])


lOMoARcPSD|5506738

 iOS provides multitasking features like while working in one application we can
switch to another application easily.
 iOS’s user interface includes multiple gestures like swipe, tap, pinch, Reverse pinch.
 iBooks, iStore, iTunes, Game Center, and Email are user-friendly.
 It provides Safari as a default Web Browser.
 It has a powerful API and a Camera.
 It has deep hardware and software integration

Applications of IOS Operating System:


 iOS Operating System is the Commercial Operating system of Apple Inc. and is
popular for its security.
 iOS operating system comes with pre-installed apps which were developed by
Apple like Mail, Map, TV, Music, Wallet, Health, and Many More.
 Swift Programming language is used for Developing Apps that would run on
IOS Operating System.
 In iOS Operating System we can perform Multitask like Chatting along with
Surfing on the Internet.

Advantages of IOS Operating System:

 More secure than other operating systems.


 Excellent UI and fluid responsive
 Suits best for Business and Professionals
 Generate Less Heat as compared to Android.
Disadvantages of IOS Operating System:

 More Costly.
 Less User Friendly as Compared to Android Operating System.
 Not Flexible as it supports only IOS devices.
 Battery Performance is poor.

Downloaded by Sheik Mohideen ([email protected])

You might also like