Objective• Having an Android based device capable of running hard real time tasks
Why?• Robust embedded linux kernel• Community supported open souce native libraries• Well thought partitioning between managed and unmanaged code• Well developed/documented APIs for HMI.
What Android lacks• Safety Critical features• Real-Time kernel• Not much support of digital analog I/O. wired interfaces etc. [typically required in SCRT scenarios]
Android Kernel• 2.6.25 kernel modified specifically for low power, low CPU, portable devices.• Translates to 75 edits and 88 new file additions• 5 changes to scheduler mostly to the run- queue locking• IPC Binder is new feature by Google.
Android Applications• Each Android app is a process• Scheduled by the underlying Linux scheduler (SCHED_OTHER)• Memory management however is done by Dalvik VM
Applications in android
RT Suitability• Android Kernel uses the same Completely Fair Scheduler of Linux 2.6• The libc implementation for Android is called bionic and it does not support process level mutexes but supports thread level mutexes and conditions.• No implementation of priority inheritance/ ceiling is present
Available hypervisors• RTAI• RT-Linux• RT patch set for linux• Our own SParK
RTAI• RTAI patch is not compatible with android kernel out of the box. [Already tried that]
RT patch set (PREEMPT_RT)• Uses 2.6’s new features such as CONFIG_PREEMPT• Well documented• Seems doable at the moment
SPaRK• Can it run a rich non RT OS like android on top of it ?• Documentation?• Community Support?
To Summarize• Can we build a system with one periodic HARD REAL TIME task along with Android? – For simplicity we will assume that this task will not share any resources with other Android Processes.
References• http://www.linuxjournal.com/magazine/real-time-linux-kernel- scheduler• Evaluating Android for Real Time Applications (OSPERT -2010)• http://embedded-computing.com/android-rtos-duo-todays- medical-devices• Reliable Real-Time Applications on Android OS• An In-Vehicle Infotainment Software Architecture Based on Google Android• http://www.ibm.com/developerworks/linux/library/l-completely- fair-scheduler/• http://www.ibm.com/developerworks/linux/library/l-cfs/index.html• http://www.scandevconf.se/db/Marakana-Android-Internals.pdf