You are on page 1of 18

UNIT V – NOTES

A. VIRTUALIZATION
Virtualization is the concept of hosting several operating systems on the same physical
hardware by running them on top of a software layer known as a hypervisor that simulates a
hardware platform. The hypervisor handles provisioning and sharing of the common hardware
resources between the operating system instances, which does not normally need to be
virtualization aware. The components of virtualization are:
• The physical machine is referred to as the host
• the hypervisor or Virtual Machine Manager (VMM)
• the virtualized operating system instances running on top of VMMs are known as
guests, or more commonly, virtual machines.

Implementation of VMMs
Vary greatly, with options including:
Type 0 hypervisors - Hardware-based solutions that provide support for
virtual machine creation and management via firmware
 IBM LPARs and Oracle LDOMs are examples
Type 1 hypervisors - Operating-system-like software built to provide
virtualization
 Including VMware ESX, Joyent SmartOS, and Citrix XenServer
Type 1 hypervisors – Also includes general-purpose operating systems that
provide standard functions as well as VMM functions
 Including Microsoft Windows Server with HyperV and RedHat Linux
with KVM
Type 2 hypervisors - Applications that run on standard operating systems but
provide VMM features to guest operating systems
 Including VMware Workstation and Fusion, Parallels Desktop, and
Oracle VirtualBox
Other variations include:
Paravirtualization - Technique in which the guest operating system is
modified to work in cooperation with the VMM to optimize performance
Programming-environment virtualization - VMMs do not virtualize real
hardware but instead create an optimized virtual system
 Used by Oracle Java and Microsoft.Net
Emulators – Allow applications written for one hardware environment to run
on a very different hardware environment, such as a different type of CPU
Application containment - Not virtualization at all but rather provides
virtualization-like features by segregating applications from the operating
system, making them more secure, manageable
 Including Oracle Solaris Zones, BSD Jails, and IBM AIX WPARs
Much variation due to breadth, depth and importance of virtualization in modern
computing
----------------------------------------------------------------------------------------------------------------
B. CPU SCHEDULING
• Even single-CPU systems act like multiprocessor ones when virtualized
i. One or more virtual CPUs per guest
• 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 much like
native operating systems running on native CPUs.
• CPU overcommitment, in which the guests are configured for more CPUs than exist
in the system. Here, a VMM can use standard scheduling algorithms to make progress
on each thread but can also add a fairness aspect to those algorithms.
• Cycle stealing by VMM and oversubscription of CPUs means guests don’t get CPU
cycles they expect
i. Consider timesharing scheduler in a guest trying to schedule 100ms time slices
-> each may take 100ms, 1 second, or longer
▪ Poor response times for users of guest
▪ Time-of-day clocks incorrect
• Some VMMs provide application to run in each guest to fix time-of-day and provide
other integration features
----------------------------------------------------------------------------------------------------------------

C. MEMORY MANAGEMENT
• Also suffers from oversubscription and thus requires extra management efficiency from
VMM
• For example, VMware ESX guests have a configured amount of physical memory, then
ESX uses 3 methods of memory management
i. Double-paging, in which the guest page table indicates a page is in a physical
frame but the VMM moves some of those pages to backing store
ii. Install a pseudo-device driver in each guest (it looks like a device driver to the
guest kernel but really just adds kernel-mode code to the guest)
▪ Balloon memory manager communicates with VMM and is told to
allocate or deallocate memory to decrease or increase physical memory
use of guest, causing guest OS to free or have more memory available
iii. Deduplication by VMM determining if same page loaded more than once,
memory mapping the same page into multiple guests
----------------------------------------------------------------------------------------------------------------
D. LIVE MIGRATION
• Taking advantage of VMM features leads to new functionality not found on general
operating systems such as live migration
• Running guest can be moved between systems, without interrupting user access to the
guest or its apps
• Very useful for resource management, maintenance downtime windows, etc
i. The source VMM establishes a connection with the target VMM
ii. The target creates a new guest by creating a new VCPU, etc
iii. The source sends all read-only guest memory pages to the target
iv. The source sends all read-write pages to the target, marking them as clean
v. The source repeats step 4, as during that step some pages were probably
modified by the guest and are now dirty
vi. When cycle of steps 4 and 5 becomes very short, source VMM freezes guest,
sends VCPU’s final state, sends other state details, sends final dirty pages, and
tells target to start running the guest
▪ Once target acknowledges that guest running, source terminates guest

----------------------------------------------------------------------------------------------------------------

E. LINUX SYSTEM - DESIGN PRINCIPLES


Linux is a multiuser, multitasking system with a full set of UNIX-compatible tools.
Its file system adheres to traditional UNIX semantics, and it fully implements the standard
UNIX networking model.Linux is designed to be compliant with the relevant POSIX
documents; at least two Linux distributions have achieved official POSIX certification.
The Linux programming interface adheres to the SVR4 UNIX semantics, rather than to
BSD behavior.
As PCs became more powerful and as memory and hard disks became cheaper, the original,
minimalist Linux kernels grew to implement more UNIX functionality.Speed and
efficiency are still important design goals, but much recent and current work on Linux has
concentrated on a third major design goal: standardization. One of the prices paid for the
diversity of UNIX implementations currently available is that source code written for one
may not necessarily compile or run correctly on another. Even when the same system calls
are present on two different UNIX systems, they do not necessarily behave in exactly the
same way.
Linux is designed to be compliant with the relevant POSIX documents; at least two Linux
distributions have achieved official POSIX certification.
A. Components of a Linux System
1. Kernel. The kernel is responsible for maintaining all
the important features of the operating system such as
virtual memory and processes.
2. System libraries. The system libraries define a
standard set of functions through which applications
can interact with the kernel. The most important
system library is the C library, known as libc.
3. System utilities. The system utilities are programs
that perform individual, specialized management
tasks. Some system utilities are invoked just once to initialize and configure some aspect of
the system. Others —known as daemons in UNIX terminology—run permanently, handling
such tasks as responding to incoming network connections, accepting logon requests from
terminals, and updating log files.
B. Modes of execution
All the kernel code executes in the processor’s privileged mode with full access to all
the physical resources of the computer. Linux refers to this privileged mode as kernel mode.
Any operating-system-support code that does not need to run in kernel mode is placed into the
system libraries and runs in user mode. Unlike kernel mode, user mode has access only to a
controlled subset of the system’s resources
C. Kernel
The kernel is created as a single, monolithic binary-all kernel code and data structures
are kept in a single address space, no context switches are necessary when a process calls an
operating-system function or when a hardware interrupt is delivered. The kernel can pass data
and make requests between various subsystems using C function invocation and not by
complicated interprocess communication (IPC). This single address space contains not only
the core scheduling and virtual memory code but all kernel code, including all device drivers,
file systems, and networking code.
D. System Libraries
System libraries allow applications to make system calls to the Linux kernel. Making a
system call involves transferring control from unprivileged user mode to privileged kernel
mode. The libraries take care of collecting the system-call arguments and, if necessary,
arranging those arguments in the special form necessary to make the system call.
• The libraries also provide more complex versions of the basic system calls. For
example, the C language’s buffered file-handling functions are all implemented in the
system libraries.
• The libraries also provide routines that do not correspond to system calls at all, such as
sorting algorithms, mathematical functions, and string-manipulation routines.
E. System Utilities
The system utilities include all the programs necessary to initialize and then administer
the system, such as those to set up networking interfaces and to add and remove users from the
system.
User utilities are also necessary to the basic operation of the system but do not require
elevated privileges to run. They include simple file-management utilities such as those to copy
files, create directories, and edit text files. Example: shell, the standard command-line
interface on UNIX systems.
----------------------------------------------------------------------------------------------------------------
--
F. KERNEL MODULES
The module support under Linux has four components:
1. The module-management system allows modules to be loaded into memory and to
communicate with the rest of the kernel.
2. The module loader and unloader, which are user-mode utilities, work with the module-
management system to load a module into memory.
3. The driver-registration system allows modules to tell the rest of the kernel that a new
driver has become available.
4. A conflict-resolution mechanism allows different device drivers to reserve hardware
resources and to protect those resources from accidental use by another driver.
A. Module Management
Loading a module loads its binary contents into kernel memory. The system must also
make sure that any references the module makes to kernel symbols are updated to point to the
correct locations in the kernel’s address space. The loading of the module is performed in two
stages.
• First, the module loader utility asks the kernel to reserve a continuous area of virtual
kernel memory for the module. The kernel returns the address of the memory allocated,
and the loader utility can use this address to relocate the module’s machine code to the
correct loading address.
• A second system call then passes the module, plus any symbol table that the new
module wants to export, to the kernel. The module itself is now copied into the
previously allocated space, and the kernel’s symbol table is updated with the new
symbols
The final module-management component is the module requester. The kernel will
inform the management process whenever a process requests a device driver, file system, or
network service that is not currently loaded and the manager load that service. The manager
process regularly queries the kernel to see whether a dynamically loaded module is still in use
and unloads that module when it is no longer actively needed
B. Driver Registration
When a module is loaded the kernel calls a module’s startup routine and when it is
unloaded it calls the module’s cleanup routine. These routines are responsible for registering
the module’s functionality. The kernel maintains tables of all known drivers and provides a set
of routines to allow drivers to be added to or removed from these tables at any time
Registration tables include Device drivers, File systems, Network protocols, Binary format
etc
C. Conflict Resolution
Linux provides a central conflict-resolution mechanism to help arbitrate access to certain
hardware resources. Its aims are as follows:
• To prevent modules from clashing over access to hardware resources
• To prevent autoprobes—device-driver probes that auto-detect device configuration—from
interfering with existing device drivers
• To resolve conflicts among multiple drivers trying to access the same hardware—as, for
example, when both the parallel printer driver and the parallel line IP (PLIP) network driver
try to talk to the parallel port

G. MOBILE OS
A mobile operating system (or mobile OS) is an operating system for phones, tablets,
smartwatches, or other mobile devices. While computers such as typical laptops are 'mobile',
the operating systems usually used on them are not considered mobile ones, as they were
originally designed for desktop computers that historically did not have or need specific mobile
features. This distinction is becoming blurred in some newer operating systems that are hybrids
made for both uses.
Mobile operating systems combine features of a personal computer operating system with
other features useful for mobile or handheld use; usually including, and most of the following
considered essential in modern mobile systems; a touchscreen, cellular, Bluetooth, Wi-Fi
Protected Access, Wi-Fi, Global Positioning System (GPS) mobile navigation, video- and
single-frame picture cameras, speech recognition, voice recorder, music player, near field
communication, and infrared blaster. By Q1 2018, over 383 million smartphones were sold
with 85.9 percent running Android and 14.1 percent running iOS.[1] Android alone is more
popular than the popular desktop operating system Windows, and in general smartphone use
(even without tablets) outnumber desktop use.
Mobile devices with mobile communications abilities (e.g., smartphones) contain two mobile
operating systems – the main user-facing software platform is supplemented by a second low-
level proprietary real-time operating system which operates the radio and other hardware.
Research has shown that these low-level systems may contain a range of security
vulnerabilities permitting malicious base stations to gain high levels of control over the mobile
device.[2]
Mobile operating systems have majority use since 2017 (measured by web use); with even
only the smartphones running them (excluding tablets) more used than any other kind of
device. Thus traditional desktop OS is now a minority used kind of OS; see usage share of
operating systems. However, variations occur in popularity by regions, while desktop-minority
also applies on some days in regions such as United States and United Kingdom.
Some of the popular Mobile OS are
• Android OS (Google Inc.)
• Bada (Samsung Electronics)
• BlackBerry OS (Research In Motion)
• iPhone OS / iOS (Apple)
• MeeGoOS (Nokia and Intel)
• Palm OS (Garnet OS)
• Symbian OS (Nokia)
• webOS (Palm/HP)
----------------------------------------------------------------------------------------------------------------
H. iOS 4 Architecture and SDK Frameworks
I. An Overview of the iOS 4 Architecture
iOS consists of a number of different software layers, each provides programming frameworks
for the development of applications that run on top of the underlying hardware.
An app can directly call down any of the layers of the stack to
perform tasks on the physical device.
Each operating system layer provides an increasing level of
abstraction away from the complexity of working with the hardware.
As an iOS developer always look for solutions for the programming
in the frameworks located in the higher level iOS layers before
writing code that reaches down to the lower level layers. In general,
the higher level of layer you program to, the less effort and fewer lines of code you will have
to write to achieve your objective.
1. The Cocoa Touch Layer
The Cocoa Touch layer sits at the top of the iOS stack and contains the frameworks that are
most commonly used by iPhone application developers. Cocoa Touch is primarily written in
Objective-C, is based on the standard Mac OS X Cocoa API (as found on Apple desktop and
laptop computers) and has been extended and modified to meet the needs of the iPhone.
The Cocoa Touch layer provides the following frameworks for iPhone app development:
a) 3 UIKit Framework (UIKit.framework)
The UIKit framework is a Objective-C based programming interface. Some of the key features
of UIKit are as follows:
• User interface creation and management (text fields, buttons, labels, colors, fonts etc)
• Application lifecycle management
• Application event handling (e.g. touch screen user interaction)
• Multitasking
• Wireless Printing
• Data protection via encryption
• Cut, copy, and paste functionality
• Web and text content presentation and management
• Data handling
• Inter-application integration
• Push notification in conjunction with Push Notification Service
• Local notifications (a mechanism whereby an application running in the background
can gain the user’s attention)
• Accessibility
• Accelerometer, battery, proximity sensor, camera and photo library interaction.
• Touch screen gesture recognition
• File sharing (the ability to make application files stored on the device available via
iTunes)
• Blue tooth based peer to peer connectivity between devices
• Connection to external displays.
• Map Kit Framework (MapKit.framework)
The Map Kit framework provides a programming interface that enables you to build map
based capabilities into your own applications. This allows you to, amongst other things, display
scrollable maps for any location, display the map corresponding to the current geographical
location of the device and annotate the map in a variety of ways.
b) Push Notification Service
The Push Notification Service allows applications to notify users of an event even when the
application is not currently running on the device. Typically when there is breaking news the
service will generate a message on the device with the news headline and provide the user the
option to load the corresponding news app to read more details. This alert is typically
accompanied by an audio alert and vibration of the device.
c) Message UI Framework (MessageUI.framework)
The Message UI framework provides everything you need to allow users to compose and send
email messages from within your application. In fact, the framework even provides the user
interface elements through which the user enters the email addressing information and message
content. Alternatively, this information can be pre-defined within your application and then
displayed for the user to edit and approve prior to sending.
d) Address Book UI Framework (AddressUI.framework)
The primary purpose of the framework is to enable you to access, display, edit and enter
contact information from the iPhone address book from within your own application.
e) Game Kit Framework (GameKit.framework)
The Game Kit framework provides peer-to-peer connectivity and voice communication
between multiple devices and users allowing those running the same app to interact.
f) iAd Framework (iAd.framework)
The purpose of the iAd Framework is to allow developers to include banner advertising within
their applications.
g) Event Kit UI Framework
The Event Kit UI framework was introduced in iOS 4 and is provided to allow the calendar
events to be accessed and edited from within an application.
----------------------------------------------------------------------------------------------------------------
II. The iOS Media Layer
The role of the Media layer is to provide iOS with audio, video, animation and graphics
capabilities. As with the other layers comprising the iOS stack, the Media layer comprises a
number of frameworks that may be utilized when developing iPhone apps.
a) Core Video Framework (CoreVideo.framework)
This framework provides buffering support for the Core Media framework.
b) Core Text Framework (CoreText.framework)
The iOS Core Text framework is a C-based API designed to handle advanced text layout and
font description requirements.
c) Image I/O Framework (ImageIO.framework)
The Image IO framework facilitate the importing and exporting of image data and image
metadata. The framework supports a wide range of image formats including PNG, JPEG, TIFF
and GIF.
d) Assets Library Framework (AssetsLibrary.framework)
The Assets Library provides a mechanism for locating and retrieving video and photo files
located on the iPhone device. In addition to accessing existing images and videos, this
framework also allows new photos and videos to be saved to the standard device photo album.
e) Core Graphics Framework (CoreGraphics.framework)
The iOS Core Graphics Framework (otherwise known as the Quartz 2D API) provides a
lightweight two dimensional rendering engine. Features of this framework include PDF
document creation and presentation, vector based drawing, transparent layers, path based
drawing, anti-aliased rendering, color manipulation and management, image
rendering,gradients etc
f) Quartz Core Framework (QuartzCore.framework)
The purpose of the Quartz Core framework is to provide animation capabilities on the iPhone.
It provides the foundation for the visual effects and animation used by the UIKit framework
and provides an Objective-C based programming interface for creation of specialized
animation within iPhone apps.
g) OpenGL ES framework (OpenGLES.framework)
An industry standard for high performance 2D and 3D graphics drawing is OpenGL. OpenGL
for Embedded Systems (ES) is a lightweight version of the full OpenGL specification designed
specifically for smaller devices such as the iPhone.
h) iOS Audio Support
iOS is capable of supporting audio in AAC, Apple Lossless (ALAC), A-law, IMA/ADPCM,
Linear PCM, μ-law, DVI/Intel IMA ADPCM, Microsoft GSM 6.10 and AES3-2003 formats
through the support provided by the following frameworks.
i) AV Foundation framework (AVFoundation.framework)
An Objective-C based framework designed to allow the playback, recording and management
of audio content.
j) Core Audio Frameworks (CoreAudio.framework, AudioToolbox.framework and
AudioUnit.framework)
The frameworks that comprise Core Audio for iOS define supported audio types, playback and
recording of audio files and streams and also provide access to the device’s built-in audio
processing units.
k) Open Audio Library (OpenAL)
OpenAL is a cross platform technology used to provide high-quality, 3D audio effects (also
referred to as positional audio). Positional audio can be used in a variety of applications though
is typically using to provide sound effects in games.
l) Media Player framework (MediaPlayer.framework)
The iOS Media Player framework is able to play video in .mov, .mp4, .m4v, and .3gp formats
at a variety of compression standards, resolutions and frame rates.
m) Core Midi Framework (CoreMIDI.framework)
The Core MIDI framework provides an API for applications to interact with MIDI
compliant devices such as synthesizers and keyboards via the iPhone’s dock connector.
--------------------------------------------------------------------------------------------------------------
III. The iOS Core Services Layer
The iOS Core Services layer provides much of the foundation on which the previously
referenced layers are built and consists of the following frameworks.
a) Address Book framework (AddressBook.framework)
The Address Book framework provides programmatic access to the iPhone Address Book
contact database allowing applications to retrieve and modify contact entries.
b) CFNetwork Framework (CFNetwork.framework)
The CFNetwork framework provides a C-based interface to the TCP/IP networking protocol
stack and low level access to BSD sockets. This enables application code to be written that
works with HTTP, FTP and Domain Name servers and to establish secure and encrypted
connections using Secure Sockets Layer (SSL) or Transport Layer Security (TLS).
c) Core Data Framework (CoreData.framework)
This framework is provided to ease the creation of data modeling and storage in Model-View-
Controller (MVC) based applications. Use of the Core Data framework significantly reduces
the amount of code that needs to be written to perform common tasks when working with
structured data in an application.
d) Core Foundation Framework (CoreFoundation.framework)
The Core Foundation is a C-based Framework that provides basic functionality such as data
types, string manipulation, raw block data management, URL manipulation, threads and run
loops, date and times, basic XML manipulation and port and socket communication.
e) Core Media Framework (CoreMedia.framework)
The Core Media framework is the lower level foundation upon which the AV Foundation layer
is built. Whilst most audio and video tasks can, and indeed should, be performed using the
higher level AV Foundation framework, access is also provided for situations where lower
level control is required by the iOS application developer.
f) Core Telephony Framework (CoreTelephony.framework)
The iOS Core Telephony framework is provided to allow applications to interrogate the device
for information about the current cell phone service provider and to receive notification of
telephony related events.
g) EventKit Framework (EventKit.framework)
An API designed to provide applications with access to the calendar and alarms on the device.
h) Foundation Framework (Foundation.framework)
The Foundation framework is the standard Objective-C framework that will be familiar to
those that have programmed in Objective-C on other platforms (most likely Mac OS X).
Essentially, this consists of Objective-C wrappers around much of the C-based Core
Foundation Framework.
i) Core Location Framework (CoreLocation.framework)
The Core Location framework allows you to obtain the current geographical location of the
device (latitude and longitude) and compass readings from with your own applications. The
method used by the device to provide coordinates will depend on the data available at the time
the information is requested and the hardware support provided by the particular iPhone model
on which the app is running (GPS and compass are only featured on recent models). This will
either be based on GPS readings, Wi-Fi network data or cell tower triangulation (or some
combination of the three).
j) Mobile Core Services Framework (MobileCoreServices.framework)
The iOS Mobile Core Services framework provides the foundation for Apple’s Uniform Type
Identifiers (UTI) mechanism, a system for specifying and identifying data types. A vast range
of predefined identifiers have been defined by Apple including such diverse data types as text,
RTF, HTML, JavaScript, PowerPoint .ppt files, PhotoShop images and MP3 files.
k) Store Kit Framework (StoreKit.framework)
The purpose of the Store Kit framework is to facilitate commerce transactions between your
application and the Apple App Store. Prior to version 3.0 of iOS, it was only possible to charge
a customer for an app at the point that they purchased it from the App Store. iOS 3.0 introduced
the concept of the “in app purchase” whereby the user can be given the option make additional
payments from within the application. This might, for example, involve implementing a
subscription model for an application, purchasing additional functionality or even buying a
faster car for you to drive in a racing game.
l) SQLite library
Allows for a lightweight, SQL based database to be created and manipulated from within your
iPhone application.
m) System Configuration Framework (SystemConfiguration.framework)
The System Configuration framework allows applications to access the network configuration
settings of the device to establish information about the “reachability” of the device (for
example whether Wi-Fi or cell connectivity is active and whether and how traffic can be routed
to a server).
n) Quick Look Framework (QuickLook.framework)
One of the many new additions included in iOS 4, the Quick Look framework provides a useful
mechanism for displaying previews of the contents of files types loaded onto the device
(typically via an internet or network connection) for which the application does not already
provide support. File format types supported by this framework include iWork, Microsoft
Office document, Rich Text Format, Adobe PDF, Image files, public.text files and comma
separated (CSV).
----------------------------------------------------------------------------------------------------------------
IV. The iOS Core OS Layer
The Core OS Layer occupies the bottom position of the iOS stack and, as such, sits directly on
top of the device hardware. The layer provides a variety of services including low level
networking, access to external accessories and the usual fundamental operating system services
such as memory management, file system handling and threads.
a) Accelerate Framework (Accelerate.framework)
Introduced with iOS 4, the Accelerate Framework provides a hardware optimized C-based API
for performing complex and large number math, vector, digital signal processing (DSP) and
image processing tasks and calculations
b) External Accessory framework (ExternalAccessory.framework)
Provides the ability to interrogate and communicate with external accessories connected
physically to the iPhone via the 30-pin dock connector or wirelessly via Bluetooth.
c) Security Framework (Security.framework)
The iOS Security framework provides all the security interfaces you would expect to find on a
device that can connect to external networks including certificates, public and private keys,
trust policies, keychains, encryption, digests and Hash-based Message Authentication Code
(HMAC).
d) System (LibSystem)
. This layer includes the operating system and device drivers. The kernel is the foundation on
which the entire iOS is built and provides the low level interface to the underlying hardware.
Amongst other things the kernel is responsible for memory allocation, process lifecycle
management, input/output, inter-process communication, thread management, low level
networking, file system access and thread management.
As an app developer your access to the System interfaces is restricted for security and
stability reasons. Those interfaces that are available to you are contained in a C-based library
called LibSystem. As with all other layers of the iOS stack, these interfaces should be used
only when you are absolutely certain there is no way to achieve the same objective using a
framework located in a higher iOS layer.
----------------------------------------------------------------------------------------------------------------
I. Android System Architecture
The Android software stack generally consists of a Linux kernel and a collection of
C/C++ libraries that is exposed through an application framework that provides services, and
management of the applications and run time.

A. Linux Kernel
Android was created on the open source kernel of Linux. One main reason for choosing
this kernel was that it provided proven core features on which to develop the Android operating
system. The features of Linux kernel are:
1. Security:
The Linux kernel handles the security between the application and the system.
2. Memory Management:
It efficiently handles the memory management thereby providing the freedom to develop
our apps.
3. Process Management:
It manages the process well, allocates resources to processes whenever they need them.
4. Network Stack:
It effectively handles the network communication.
5. Driver Model:
It ensures that the application works. Hardware manufacturers can build their drivers into
the Linux build.

B. Libraries:
Running on the top of the kernel, the Android framework was developed with various
features. It consists of various C/C++ core libraries with numerous of open source tools. Some
of these are:
1. The Android runtime:
The Android runtime consist of core libraries of Java and ART(the Android RunTime).
Older versions of Android (4. x and earlier) had Dalvik runtime.
2. Open GL(graphics library):
This cross-language, cross-platform application program interface (API) is used to
produce 2D and 3D computer graphics.
3. WebKit:
This open source web browser engine provides all the functionality to display web
content and to simplify page loading.
4. Media frameworks:
These libraries allow you to play and record audio and video.
5. Secure Socket Layer (SSL):
These libraries are there for Internet security.

C. Android Runtime:
It is the third section of the architecture. It provides one of the key components which
is called Dalvik Virtual Machine. It acts like Java Virtual Machine which is designed specially
for Android. Android uses it’s own custom VM designed to ensure that multiple instances run
efficiently on a single device.
The Delvik VM uses the device’s underlying Linux kernel to handle low-level functionality,
including security, threading and memory management.

D. Application Framework
The Application Framework is a set of services that collectively form the environment
in which Android applications run and are managed. This framework implements the concept
that Android applications are constructed from reusable, interchangeable and replaceable
components. This concept is taken a step further in that an application is also able to publish
its capabilities along with any corresponding data so that they can be found and reused by other
applications.
The Android framework includes the following key services:
• Activity Manager – Controls all aspects of the application lifecycle and activity stack.
• Content Providers – Allows applications to publish and share data with other
applications.
• Resource Manager – Provides access to non-code embedded resources such as strings,
color settings and user interface layouts.
• Notifications Manager – Allows applications to display alerts and notifications to the
user.
• View System – An extensible set of views used to create application user interfaces.
• Package Manager – The system by which applications are able to find out information
about other applications currently installed on the device.
• Telephony Manager – Provides information to the application about the telephony
services available on the device such as status and subscriber information.
• Location Manager – Provides access to the location services allowing an application to
receive updates about location changes.
E. Applications:
Android applications can be found at the topmost layer. At application layer we write
our application to be installed on this layer only. Examples of applications are Games,
Messages, and Contacts etc.
I. Android SDK Framework:

The Android software development kit (SDK) includes everything you need to initiate
development, testing and debugging of android applications.
Following are included in the SDK:
A. The Android APIs: The core of the SDK (Software Development Kit) is the Android
API libraries that provide developer to access to the Android stack. These are the
same libraries used at Google to create native Android applications.
B. Development Tools: To turn Android source code into executable Android
applications and the SDK includes several development tools that let us of the
compile and debug our Android applications.
C. The Android Emulator: The Android Emulator is a fully communicating Android
device emulator featuring several alternative skins. Using the emulator that we can
see how can our applications will look and behave on a real Android device (That is
not a virtual concept). All Android applications run within the Dalvik Virtual
Machine so that the software emulator is a brilliant situation. It is very vital point that
devices are hardware-neutral. This devices are also provides a better independent test
environment than any single hardware implementation.
D. Full Documentation: The SDK (Software Development Kit) includes extensive
code-level reference information detailing from exactly which we included in each
package and class and also know that the using procedure them. In addition to the
code documentation and Android’s reference certification explicates process to get
started and gives the detailed explanations of the fundamentals behind Android
development System.
E. Sample Code: The Android SDK (Software Development Kit) includes a selection of
sample applications that prove some of the possibilities available using Android the
process also as simple programs that highlight how to use individual API(Application
Programming Interfaces) features.
F. Online Support: Online support is no doubt very vital point that despite it’s relative
to youth. Android has generated a vibrant developer community. The Google Groups
at groups are active forums for the Android developers with regular input from the
Android development team at Google.
In that purpose we are using the popular Eclipse IDE. The Android has released a special
plug-in that simplifies project creation and tightly integrates Eclipse with the Android
Emulator and debugging tools.
I. REAL TIME OPERATING SYSTEMS (RTOS)

Real time operating systems need to respond to events in a timely and predictable manner.
By definition, real time means that missed or late responses by these systemsconstitute a
failure. For hard real-time, a failure would likely lead to catastrophic consequences up to and
including loss of human life. This is the case for aircraft collision avoidance, anti-lock brake,
pacemaker and anti-missile systems. For soft real- time applications like communication
switching systems and streaming audio or video, predictable response is required but
occasional failures can be tolerated.
J. LynxOS
LynxOS, the first real time operating system developed by LynuxWorks, was introduced
in 1988.

LynxOS Design Goals


Four design goals:
1. The operating system kernel had to be preemptive and reentrant. This was important
so time-critical tasks will execute promptly.
2. The kernel supports multithreading. User programs, device drivers and other kernel
services can create their own tasks that are called kernel threads. More detail on
kernel threads including scheduling and advantages are provided later inthis paper.
3. LynxOS uses a processor's page memory management unit (MMU) to provide each
instance of a user process its own protected logical address space. The MMU also
protects the kernel by placing it in a separate address space.
4. LynxOS utilizes Unix and POSIX APIs, allowing:
o a variety of Unix programs to be ported to LynxOS and
o offering a shallow learning curve for those programmers already familiar
with the interface

LynxOS Approach
In order to achieve the first two goals (prompt execution and multithreading), LynxWorks
developed techniques known as kernel threads and priority tracking. To address goal three
(memory protection), LynuxWorks utilizes the processor's page memory management unit
(MMU). For the last noted goal (portabilityand less steep learning curve), LynxOS utilizes
Unix and POSIX APIs. Each of these approaches is discussed below.

Process Management
In order to explore the techniques known as kernel threads and priority tracking we needto
understand the issues associated with task scheduling and execution.

The basic LynxOS scheduling entity is the thread and LynxOS scheduling is preemptive,
reentrant and based on one of three selected scheduling policies:
▪ First-In First-Out
▪ Round Robin
▪ Priority Based Quantum – Lynx proprietary policy that is similar to round robinbut
includes a configurable time quantum for each priority level.
A primary issue with task scheduling is known as priority inversion. As shown in figure1,
priorty inversion is the situation where a high priority task is running but is preemptedby an
asynchronous interrupting device for a lower priority task.

In order to understand how LynuxWorks deals with priority inversion, it is important to


understand that LynxOS is POSIX-conformant and that the basic LynxOS scheduling entity
is the thread. This means that threads are the running entities of LynxOS.

By the LynxOS approach, the driver's interrupt handler does a minimum of work and signals
the kernel thread that interrupt-related data is available. LynxOS then treats thesethreads like
normal user threads, with software rather than interrupt priorities.
As shown in figure 2, by incorporating a technique known as priority tracking, kernel
threads can process interrupts but, at the same time, will be scheduled along with user threads
based on an “appropriate” thread priority.

Address Space Protection


The MMU is used to physically isolate processes from each another so that they cannot
trample on each other's memory. The MMU translates the virtual addresses referenced by
the thread into physical addresses. If a process attempts to address a page that is notcurrently
mapped to it, the MMU generates an exception.

The MMU also allows the process’ memory regions to grow and shrink in order to meet
changing needs of the executing thread. With this, each process has its own protected
address space and can communications between processes through kernel services.
Utilization of Unix and POSIX APIs
In order to achieve portability, 90% of LynxOS is written in C. By utilizing readily available
interfaces, the development learning curve is substantiallyflattened and allows programmers
that already know the APIs to quickly become productive.

K. VxWorks
VxWorks, a popular real-time operating system providing hard real-time support. VxWorks,
commercially developed by Wind River Systems, is widely used in automobiles, consumer
and industrial devices, and networking equipment such as switches and routers. VxWorks is
also used to control the two rovers—Spirit and Opportunity—that began exploring the planet
Mars in 2004. The organization of VxWorks is shown in the following figure:

VxWorks is centered around the Wind microkernel. Microkernels are designed so that the
operating-system kernel provides a bare minimum of features; additional utilities, such as
networking, file systems, and graphics, are provided in libraries outside of the kernel. This
approach offers many benefits, including minimizing the size of the kernel—a desirable
feature for an embedded system requiring a small footprint.
The Wind microkernel supports the following basic features:
• Scalable OS
• VxWorks deploys a preemptive scheduler
• VxWorks RTOS schedules the ISRs separately and has special functions for interrupt
handling
• VxWorks has system level functions for RTOS initiation and start, system clock ticks
initiation, ISR fucntions
• VxWorks provides pipes for IPC
• VxWorks includes POSIX library
• Supports kernel mode of execution of tasks
• Processes. The Wind microkernel provides support for individual processes and
threads (using the Pthread API). However, similar to Linux, VxWorks does not
distinguish between processes and threads, instead referring to both as tasks.
• Protection features – for example, if a task is expecting a message from another task,
which is being deleted by using the task-delete function, then RTOS inhibits the
deletion
• No priority inversion problem

Semaphore functions for Synchronization


• event signal flag,
• mutually exclusive access using resource key (mutex) and
• counting mechanism using three type of semaphores in the tasks and ISRs
• P-V semaphore functions when POSIX library included

Two ways in which a pending task among the pending tasks unblock
(a) as per task priority
(b) as a FIFO, when accepting or taking an IPC

Task functions
• Task creation and activation distinct states
• Functions for the task creating, running, waiting, suspending (inhibiting task-
execution) and resuming, spawning (creating followed by activating), task-pending
cum suspending and pending cum suspension with timeout functions
__________________________________________________________________________

You might also like