Docsity

Android Operating System: History, Architecture, and Comparison with Linux, Study notes of Architecture

Partial preview of the text

Download Android Operating System: History, Architecture, and Comparison with Linux and more Study notes Architecture in PDF only on Docsity!

Android Operating System:

An in depth introduction

CS423 Project Mohammad Alian, Shuomeng Guang, Bo Teng

Outline _____________________________________________

  1. What is Android
  2. History
  3. Android architecture
  4. Android vs Linux
  5. Process Management
  6. Power Management

History __ __________________________

โ Developed by Android, Inc (bought by Google in 2005) โ Unveiled in 2007 โ Android 1. 0, 2008 โ Developed by Open Handset Alliance โ Android 6.0 Marshmallow, 2015

Codename API Distribution Froyo 8 0.10% Gingerbread 10 2.60% Ice Cream Sandwich 15 2.20% Jelly Bean 16-18 21.30% KitKat 19 33.40% Lollipop 21-22 35.80% Marshmallow 23 4.60%

Android is the flagship software of the Open Handset Alliance (OHA), established by Google with members who are chip manufacturers, mobile handset makers, application developers or mobile carriers. Clockwise development

Android was unveiled in 2007, along with the founding of the Open Handset Alliance โ€“ a consortium of hardware, software, and telecommunication companies devoted to advancing open standards for mobile devices.

Android architecture _________ _

Figure from https://source.android.com/index.html

Binder IPC The Binder Inter-Process Communication (IPC) mechanism allows the application framework to cross process boundaries and call into the Android system services code. This enables high level framework APIs to interact with Android system services. At the application framework level, this communication is hidden from the developer and things appear to "just work."

Android layers its PM model on top of standard Linux PM

Hardware Abstraction Layer _________ _

โ Standard interface between software APIs and hardware drivers

โ Two Components: โ Module: HAL implementations โ Shared library modules (.so) files โ Dynamically linked โ Device: abstracts the actual hardware

Implement functionality without modify higher levels. The hardware abstraction layer (HAL) defines a standard interface for hardware vendors to implement and allows Android to be agnostic about lower-level driver implementations.

Storage devices are not managed by HAL HOTPLUG

https://source.android.com/devices/ png: Hardware abstraction layer (HAL) components

(.so file). It contains metadata such as the version, name, and author of the module, which helps Android find and load it correctly.

An audio module can contain a primary audio device, a USB audio device, or a Bluetooth A2DP audio device. A device is represented by the hw_device_t struct. Like a module, each type of device defines a more-detailed version of the generic hw_device_t that contains function pointers for specific features of the hardware.

The hardware abstraction layer (HAL) defines a standard interface for hardware vendors to implement and allows Android to be agnostic about lower-level driver implementations.

Libraries and Android Runtime _________

โ Libraries contains frameworks for web browser (webkit), database (SQLite), multimedia, libc... โ Android Runtime environment โ Core libraries โ Android Runtime(predecessor Dalvik): the managed runtime used by applications and some system services on Android. โ Execute the Dalvik Executable format and Dex bytecode specification. โ Ahead-of-time compiled runtime โ Modern garbage collection โ Development and debugging improvements (Support for sampling profiler; more debugging features; improved diagnostic detail in exceptions and crash reports)

Core libraries: Dalvik VM Specific Libraries/Java Interoperability Libraries/Android Libraries

Android vs. Linux Introduction ____ ___

โ An effort initiated by Google to develop an OS for mobile devices

โ It is based on Linux kernel

โ Device drivers, network stack, power management and other core OS features are taken from Linux

โ Libraries added to enable applications to control the hardware more efficiently

โ It have a different Java Runtime Engine specifically designed for limited resource in mobile devices

Is Android a Linux distribution? The short answer is no. Android is based on the Linux kernel, but is not actually purely a โ€œLinux distributionโ€. A standard Linux distribution has a native windowing system, glibc and some standard utilities. It does not have a layer of abstraction between the user applications and the libraries. In general, it simply looks like this:

Android vs. Linux Core Differences __ __

โ Target Architecture

โ Android is designed for mobile devices (ARM ISA) โ Linux for general purpose processors (x86 ISA)

โ Kernel Modifications

โ Android added alarm driver, power management wrapper, inter processor communication Interface, low memory killer, and kernel debugger and logger

โ Standard C Library

โ Android implements a custom implementation of C library which is proper for low memory

Process Management Overview _________ _

Process Control Block(PCB) and Process Management

Process state Process number Program counter Registers Memory limits List of Open files ...

New Ready Running Exit

Blocked

At base level android PCB is the same and PCB is managed by standard process management

Process Management Zygote _________ _

Zygote : โ€œIt is the initial cell formed when a new organism is producedโ€

โ Parent of all application processes โ Started by init when Android is started โ Have core libraries linked โ Improve launch time performance โ Preload frequently used libraries

Zygote is a daemon service. All application processes are forked from zygote. Compare to creating VM separately for each app process, it improves the performance. All app processes can share VM memory and framework layer resources.

Process Management Application lifecycle 1 ____ _

โ Lifetime of an application process is not directly controlled by application, but rather by process management principles

โ Application lifecycle model gives user the multi-task experience โ Easy to run multiple applications โ Easy to switch between tasks

Process Management______

Application lifecycle 2 _ _

Process Management Priority Hierarchy _____ _

โ Foreground process : A process that is required for what the user is currently doing โ Visible process: A process that doesn't have any foreground components, but still can affect what the user sees on screen โ Service process: A process that is running a service. Started with startService() method โ Background process: A process holding an activity that's not currently visible to the user (the activity's onStop() method has been called) โ Empty process: A process that doesn't hold any active application components. Only alive for caching purposes

Power Management Overview _________ _

โ Android power management extends linux PM

โ More aggressive power management policy than Linux PM

โ Android Power Management Application Framework

โ A java application on top of kernel โ Act like a driver that application can do power management using that

Android Power Management Application Framework is a java application that sits on top of Linux Kernel power management framework and act like a driver for power management. The JNI interface allows application to communicate with the framework