evaluating android os for embedded real-time syst em
DESCRIPTION
Evaluating Android OS for Embedded Real-Time Syst em. Background Introduction Android OS Architecture Feasibility and Necessity Android RTS Architecture Limitation Improvement Lei Cui. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Evaluating Android OS for Embedded Real-Time Syst em](https://reader036.vdocuments.net/reader036/viewer/2022081514/56816921550346895de053cc/html5/thumbnails/1.jpg)
Background IntroductionAndroid OS ArchitectureFeasibility and Necessity
Android RTS ArchitectureLimitation
Improvement
Lei Cui
Evaluating Android OS for Embedded Real-Time System
![Page 2: Evaluating Android OS for Embedded Real-Time Syst em](https://reader036.vdocuments.net/reader036/viewer/2022081514/56816921550346895de053cc/html5/thumbnails/2.jpg)
Background IntroductionAndroid platform has been instantly improved either in terms of features or supported hardware, as well as the extension-based new types of devices, which has attracted much attention from the various industries fields gradually. In other words, the utilization of Android OS based on Linux kernel has covered the whole daily life related to the E-control.
However, there is a feature that has not been explored yet - the RT capabilities. This paper provides an idea of adding some RT features into Android platform to make it a RT architecture in order to be used in open real-time environment.
![Page 3: Evaluating Android OS for Embedded Real-Time Syst em](https://reader036.vdocuments.net/reader036/viewer/2022081514/56816921550346895de053cc/html5/thumbnails/3.jpg)
Android OS Architecture
Android Architecture
Application Uppermost layer; a core set of applications; out of the box
ApplicationFramework
APIs; Services;
Libraries libc: the standard C system library for embedded Linux-based devices
Android Runtime
Android VM (Dalvik): target for memory/CPU-constrained devices; Infinite register-based machine
Linux Kernel
Drivers; Resource Management; Power Management; Hardware Control Management, etc; HAL: interaction with HW via Drivers
Details of Android Architecture
![Page 4: Evaluating Android OS for Embedded Real-Time Syst em](https://reader036.vdocuments.net/reader036/viewer/2022081514/56816921550346895de053cc/html5/thumbnails/4.jpg)
Android OS Architecture(DVM)1. Why does Android architecture utilize DVM but JVM?
Less instruction dispatch and memory access——30%Less CPU resource and computation timeMore bytes in the instruction stream——35%
2. What is the principle of Dalvik VM?
![Page 5: Evaluating Android OS for Embedded Real-Time Syst em](https://reader036.vdocuments.net/reader036/viewer/2022081514/56816921550346895de053cc/html5/thumbnails/5.jpg)
Dalvik-VMLinux Kernel
Resource Management Capability
Feasibility and Necessity
![Page 6: Evaluating Android OS for Embedded Real-Time Syst em](https://reader036.vdocuments.net/reader036/viewer/2022081514/56816921550346895de053cc/html5/thumbnails/6.jpg)
Feasibility and Necessity(Dalvik-VM)
Fork()
VM father process
Child processes
Pre-initialization&
Pre-loadingOf Android APIs and Classes
(initial Andriod Runtime & setup VM)
All the scheduling
activities are delegated by the VM to the
kernel
![Page 7: Evaluating Android OS for Embedded Real-Time Syst em](https://reader036.vdocuments.net/reader036/viewer/2022081514/56816921550346895de053cc/html5/thumbnails/7.jpg)
Feasibility and Necessity(Linux Kernel)
![Page 8: Evaluating Android OS for Embedded Real-Time Syst em](https://reader036.vdocuments.net/reader036/viewer/2022081514/56816921550346895de053cc/html5/thumbnails/8.jpg)
Feasibility and Necessity(Resource Management Capability)
![Page 9: Evaluating Android OS for Embedded Real-Time Syst em](https://reader036.vdocuments.net/reader036/viewer/2022081514/56816921550346895de053cc/html5/thumbnails/9.jpg)
Android RTS Architecture
Android Full RT Platform
Prospredict priority inversion; better resource management; more-seamless integration; predictability and determinism;ConsDrivers supported natively implement during integration phase; Android Extended
Difference(RTSJ)
Both works ensure resource reservation & RT tasks scheduling in order to guarantee resource bandwidth to apps, within an interval of time
Pros: beneficial for incorporating a more deterministic RT behavior in the VM level;
Con: keep up with release cycle of Android
Pros: bound-based memory management; RT scheduler in RT-JVM; better synchronisation mechanisms; avoid priority inversion;Cons: integration issues
![Page 10: Evaluating Android OS for Embedded Real-Time Syst em](https://reader036.vdocuments.net/reader036/viewer/2022081514/56816921550346895de053cc/html5/thumbnails/10.jpg)
Android RTS Architecture
Android Partly RT Android with a RT Hypervisor
Guest OS
Parallel
High PriorityHigh Priority
No need for VM
Apps that need VM will not benefit from this model
Apps are limited by RT Hypervisor;If RT apps hangs, the sys may hang;
Low Integration
![Page 11: Evaluating Android OS for Embedded Real-Time Syst em](https://reader036.vdocuments.net/reader036/viewer/2022081514/56816921550346895de053cc/html5/thumbnails/11.jpg)
RT Linux Limitation
1. Linux system scheduling unit is 10ms, which is coarse-granularity and cannot provide the precise timing;
2. Until now, when a task or process is called into kernel state from userland it is unpreempted that cannot guarantee the predictability & undeterministics;
3. The utilization of virtual memory technology;
4. …….
5. Lack of effective and efficient RT scheduling algorithms & policies;
![Page 12: Evaluating Android OS for Embedded Real-Time Syst em](https://reader036.vdocuments.net/reader036/viewer/2022081514/56816921550346895de053cc/html5/thumbnails/12.jpg)
Improvement
1. Improve the accuracy of the CPU clock via Clock Counter Register to solve the Linux coarse-granularity issues; eg. RT-Linux & Kurt-Linux;
2. By insert preempted points into kernel functions to solve unpreempted issues that cannot guarantee the predictability & undeterministics; for instance, RED-Linux;
3. …….
4. Define OS scheduling RT framework & algorithms to solve the issues lack of effective and efficient RT scheduling algorithms & policies; RED-Linux, Qlinux, H-SFQ, Cello, SILK, etc.
![Page 13: Evaluating Android OS for Embedded Real-Time Syst em](https://reader036.vdocuments.net/reader036/viewer/2022081514/56816921550346895de053cc/html5/thumbnails/13.jpg)
Background Introduction
Architecture
Implementation & Evaluation
Lei Cui
Real-Time Android: Deterministic Ease of Use
![Page 14: Evaluating Android OS for Embedded Real-Time Syst em](https://reader036.vdocuments.net/reader036/viewer/2022081514/56816921550346895de053cc/html5/thumbnails/14.jpg)
Background IntroductionThe preferences of end-usersDevelopers with consistent usability A convenient development environment
Android Platform(upper)
Rich & Mature feature set Linux Kernel(bottom)
Android Architecture
Android stack with RT capabilitiesin a minimally invasive way via adding a crucial Linux building block
Exclusive concern in the industrial embedded domain
Remedies for user & programmerof embedded RTS
![Page 15: Evaluating Android OS for Embedded Real-Time Syst em](https://reader036.vdocuments.net/reader036/viewer/2022081514/56816921550346895de053cc/html5/thumbnails/15.jpg)
Architecture
Linux Kernel(Kernel State)
Android Framework (User State)
Communication & Data exchange
![Page 16: Evaluating Android OS for Embedded Real-Time Syst em](https://reader036.vdocuments.net/reader036/viewer/2022081514/56816921550346895de053cc/html5/thumbnails/16.jpg)
Architecture---Linux Kernel
RT support by the OS kernel is obviously a mandatory requirement for RT architectures
RTAIRTLinux,Xenomai
Preempt_rtLitmus-RT
…Preempt_rt is not a RT kernel owing to the complexity of the Linux kernel
——impossible to prove upper bounds on all operations under all possible circumstances——allow to determine upper latency bounds
![Page 17: Evaluating Android OS for Embedded Real-Time Syst em](https://reader036.vdocuments.net/reader036/viewer/2022081514/56816921550346895de053cc/html5/thumbnails/17.jpg)
Architecture--- User State
Android Full RT Platform Android Extended
The Android userland is heavily based on the Dalvik VM, based on register rather than stack architecture. Obsolete--why
Exceed constrained developer resources
Provide an insufficient return on investment
Linux C without translation by VM
![Page 18: Evaluating Android OS for Embedded Real-Time Syst em](https://reader036.vdocuments.net/reader036/viewer/2022081514/56816921550346895de053cc/html5/thumbnails/18.jpg)
Architecture--- Data exchange
Communication Channel
Reject unbounded delays
Shared-memory & Mutual exclusion avoid data corruptionEasily result in unbounded
latenciesShared-memory & Synchronization algorithm lock-free & wait-free
![Page 19: Evaluating Android OS for Embedded Real-Time Syst em](https://reader036.vdocuments.net/reader036/viewer/2022081514/56816921550346895de053cc/html5/thumbnails/19.jpg)
Implementation & Evaluation
A. Basis Component IntegrationBased on the preempt_rt release 2.6.33, back-
port the BSP from 36 to 33, and forward-port the Android patch set from 32 to 33.
B. Shared-memory
1. A system service creates a shared-memory via mmap() sys call;2. The service registers at Binder;3. All programs acquire reference via Binder call; 4. Native clients receive pointer directly;JNI library provides access methods to Android apps.
![Page 20: Evaluating Android OS for Embedded Real-Time Syst em](https://reader036.vdocuments.net/reader036/viewer/2022081514/56816921550346895de053cc/html5/thumbnails/20.jpg)
Implementation & EvaluationC. Demo
D. Latency Measurements E. Efforts