Modern Operating Systems by Herbert Bos ...
Modern_Operating_Systems_by_Herbert_Bos_and_Andrew_S._Tanenbaum_4th_Ed.pdf-M ODERN O PERATING S YSTEMS
Showing 840-841 out of 1137
Modern Operating Systems by Herbert Bos and Andrew...
Modern_Operating_Systems_by_Herbert_Bos_and_Andrew_S._Tanenbaum_4th_Ed.pdf-M ODERN O PERATING S YSTEMS
Modern Operating Systems by Herbert...
Modern_Operating_Systems_by_Herbert_Bos_and_Andrew_S._Tanenbaum_4th_Ed.pdf-M ODERN O PERATING S YSTEMS
Page 840
SEC. 10.8
ANDROID
809
10.8.4 Android Architecture
Android is built on top of the standard Linux kernel, with only a few signifi-
cant extensions to the kernel itself that will be discussed later.
Once in user space,
however, its implementation is quite different from a traditional Linux distribution
and uses many of the Linux features you already understand in very different ways.
As in a traditional Linux system, Android’s first user-space process is
init
,
which is the root of all other processes.
The daemons Android’s
init
process starts
are different, however, focused more on low-level details (managing file systems
and hardware access) rather than higher-level user facilities like scheduling cron
jobs. Android also has an additional layer of processes, those running Dalvik’s
Java language environment, which are responsible for executing all parts of the
system implemented in Java.
Figure 10-39 illustrates the basic process structure of Android.
First is the
init
process, which spawns a number of low-level daemon processes.
One of these is
zygote
, which is the root of the higher-level Java language processes.
appN
phone
system_server
Dalvik
Dalvik
Dalvik
zygote
Daemons
System
processes
App
processes
app1
app2
Dalvik
Dalvik
installd
servicemanager
init
adbd
Kernel
Dalvik
Figure 10-39.
Android process hierarchy.
Android’s
init
does not run a shell in the traditional way, since a typical
Android device does not have a local console for shell access.
Instead, the daemon
process
adbd
listens for remote connections (such as over USB) that request shell
access, forking shell processes for them as needed.
Since most of Android is written in the Java language, the
zygote
daemon and
processes it starts are central to the system.
The first process
zygote
always starts


Page 841
810
CASE STUDY 1: UNIX, LINUX, AND ANDROID
CHAP. 10
is called
system
server
, which contains all of the core operating system services.
Key parts of this are the power manager, package manager, window manager, and
activity manager.
Other processes will be created from
zygote
as needed.
Some of these are
‘‘persistent’’ processes that are part of the basic operating system, such as the tele-
phony stack in the phone process, which must remain always running.
Additional
application processes will be created and stopped as needed while the system is
running.
Applications interact with the operating system through calls to libraries pro-
vided by it, which together compose the
Android framework
.
Some of these li-
braries can perform their work within that process, but many will need to perform
interprocess communication with other processes, often services in the
sys-
tem
server
process.
Figure 10-40 shows the typical design for Android framework APIs that inter-
act with system services, in this case the
package manager
.
The package manager
provides a framework API for applications to call in their local process, here the
PackageManager
class. Internally, this class must get a connection to the corres-
ponding service in the
system
server
.
To accomplish this, at boot time the
sys-
tem
server
publishes each service under a well-defined name in the
service man-
ager
, a daemon started by
init
. The
PackageManager
in the application process
retrieves a connection from the
service manager
to its system service using that
same name.
Once the
PackageManager
has connected with its system service, it can make
calls on it.
Most application calls to
PackageManager
are implemented as
interprocess communication using Android’s
Binder
IPC mechanism, in this case
making calls to the
PackageManagerService
implementation in the
system
server
.
The implementation of
PackageManagerService
arbitrates interactions across all
client applications and maintains state that will be needed by multiple applications.
10.8.5 Linux Extensions
For the most part, Android includes a stock Linux kernel providing standard
Linux features.
Most of the interesting aspects of Android as an operating system
are in how those existing Linux features are used.
There are also, however,
serveral significant extensions to Linux that the Android system relies on.
Wake Locks
Power management on mobile devices is different than on traditional comput-
ing systems, so Android adds a new feature to Linux called
wake locks
(also called
suspend blockers
) for managing how the system goes to sleep.
On a traditional computing system, the system can be in one of two power
states: running and ready for user input, or deeply asleep and unable to continue


Ace your assessments! Get Better Grades
Browse thousands of Study Materials & Solutions from your Favorite Schools
Concordia University
Concordia_University
School:
Operating_Systems
Course:
Great resource for chem class. Had all the past labs and assignments
Leland P.
Santa Clara University
Introducing Study Plan
Using AI Tools to Help you understand and remember your course concepts better and faster than any other resource.
Find the best videos to learn every concept in that course from Youtube and Tiktok without searching.
Save All Relavent Videos & Materials and access anytime and anywhere
Prepare Smart and Guarantee better grades

Students also viewed documents