P2: Integrating Android and Linux


klapse

Central Scrutinizer
Joined
Aug 30, 2012
Messages
1,932
Location
Germany
I'd like to start a thread devoted to considerations for integrating Android and Linux on the P2. Craig is eager to provide first class Android game support, while the current Pandora community is vocally requesting a linux implementation at least as full-featured and solid as that of the P1. Following are four approaches to providing both operatng systems:


1) Dual Boot: Simplest to implement, high compatibility, fragmented user experience


2) Run Android apps under Linux (android hardware abstraction layer): incomplete Android compatibility?


http://www.linuxfordevices.com/c/a/News/Myriad-Group-Myriad-Alien-Dalvik/


3) Run Linux under Android: difficult to provide direct access to framebuffer / overlays for linux emus?


http://androlinux.com/


http://www.xda-devel...oject-can-help/


4) Hypervisor - run Linux + Android concurrently: limited SoC support


http://www.openvirtualization.org/


http://www.cnx-software.com/2011/10/30/run-2-os-simultaneously-on-arm-omap4-with-codezero-embedded-hypervisor/


Which approach shows the most promise?


Which gives good android compatibility without hamstringing/stepchilding the linux OS?


How do the different approaches constrain the choice of SoC (meaning it needs to be dealt with early on)?


What solution would be supported by the current Pandora community developers?


Is licensing of a hypervisor or Android HAL feasible for OPT?


Please investigate and share your (informed) comments. :)/>


(edit: fixed links)
 
Last edited by a moderator:
I would personally love for them to be combined, but as you point out the software just isn't there yet.


However I believe they will be merged eventually in an acceptable way, almost certainly in 2013.


Then it's win win for sure.
 
#4 would be ideal if we could do it right.


http://en.wikipedia....wiki/Hypervisor


Either as a Type 1 or with a stripped down command line only bare bones hypervisor OS.


In theory we're talking about a quad core CPU. With a bit of user due dilligence, neither concurrent running OS should be consuming more than one core's worth of tasks when it isn't in the foreground - in theory since the background OS isn't getting actively used, it should drift into sleep mode.


Being able to simply toggle between Android and Linux - without rebooting, without booting one OS inside the other (even though they would both be inside the hypervisor) - that would be very cool.


With a quad core CPU, enough RAM (4GB?), 'disk', a hypervisor and patience, it should be able to run 4-5 OS's simultaneously - just don't expect to have many applications running concurrently inside of those OSs.


Still - being able to toggle between Android and Linux on the fly without disrupting active processes in the background OS - THAT would be a perfect 'dual OS' solution.


(Yes, I copied and pasted my response from the other thread where this question was started.)
 
NOOOOOOOOOOOOOOOOOOOOPE. FUCK virtualization and fuck anything other than dual boot.


We want to offer the best support we can.. not a hacked up bastard child
 
I'll take num 4 bove all , and num 1 is my second choice .
 
If Num4 can be done as Grench describes, then that would be a rather impressive feature and sure to be a selling point... especially if Craig actually *does* put 8Gb ram in there like he said he wanted to. Then, theoretically you should have no problem suspending whichever OS that isn't being used to ram. Wouldn't that free up the fourth core if needed? How fast would one be able to switch between OS's this way? I would assume one could easily copy/paste info between the OS's?


But personally I would have no problem with dual-boot. :)
 
If Num4 can be done as Grench describes, then that would be a rather impressive feature and sure to be a selling point... especially if Craig actually *does* put 8Gb ram in there like he said he wanted to. Then, theoretically you should have no problem suspending whichever OS that isn't being used to ram. Wouldn't that free up the fourth core if needed? How fast would one be able to switch between OS's this way? I would assume one could easily copy/paste info between the OS's?
From what I understand, few to none of our emulators will benefit from an additional core, so even a dual core setup with hypervisor and one core per OS would run all our emulators fullspeed on an A9 or A15.


I was unable to find any information on cut+paste capability between OSes under either hypervisor. To implement this feature requires software installed on each guest OS (like VMWare tools) to handle the hand-off.


I am glad Craig noticed the thread. Hopefully OPT will make time to evaluate dual OS options when they have prototype boards. Right now it is possible to run tests on the pandaboard, for example.


One advantage that #2: Myriad Dalvik would have is no overhead for native linux emulators. It even claims faster execution than native dalvik (though I do not understand how this is achieved)
 
@klapse:


Running emulators is only one aspect of the Pandora.


What about high-end Android games to be released in the next few years that could potentially make use of all four cores? I'm not saying this is going to happen, but...


Also, I would imagine that the more cores for multi-tasking cpu intensive applications the better. Who knows what kind of software devs will manage to port to the P2?


I'm just saying that if it were possible to freeze an OS and suspend it to ram, while operating the other OS with full access to every core, it should be looked into - after all, I'm pretty sure one of the moto's for the P2 will be something akin to: 'No limits'.
 
@FaeMinx: I don't know how android games use multiple cores, your question is a good one.


Further down the road there is also:


5) Android Mainlining Project


http://elinux.org/Android_Mainlining_Project


"The goal of this project is to ultimately mainline all patches required to run the current released version of Android. The purpose of mainlining these patches is 3-fold:


1. to allow a developer to use the latest released version of the Linux kernel to run an Android system, without requiring patches to their kernel "


This would mean running linux and android apps side by side with no overhead required by virtualization. Bringing android kernel features into linux kernel (mainlining) means android apps would run natively, whether they are using the dalvik vm or not.
 
This would mean running linux and android apps side by side with no overhead required by virtualization. Bringing android kernel features into linux kernel (mainlining) means android apps would run natively, whether they are using the dalvik vm or not.
How is this possible without a dalvik vm ?
 
This would mean running linux and android apps side by side with no overhead required by virtualization. Bringing android kernel features into linux kernel (mainlining) means android apps would run natively, whether they are using the dalvik vm or not.
How is this possible without a dalvik vm ?
It would use the dalvik VM that comes with Android.
 
I would expect to see 1, I would like to see 4 eventually if its possible in the future.


A minimal host with several virtuals running on top. Being able to add or remove wanted os' s as needed. Maybe even build some qemu functionality into it if possible.


That part might be dreaming but going from linux to android to emulated x86 windows etc on the fly would be awesome.
 
I'll add another interesting (somewhat mysterious) app for running Android apks in linux:


6) apkenv -environment wrapper for native android apks.


Homepage: http://thp.io/2012/apkenv/


Discussion: http://talk.maemo.org/showthread.php?t=87496


Readme: https://github.com/thp/apkenv/blob/master/README


Currently for N900 but could be easily built for Pandora. It might work to run a few android games on the pandora, within superzaxxon. Pretty amazing that some android apps run with a stock linux kernel.
 
Last edited by a moderator:
I vote for hardware VM support, and we just switch between whatever OS we like, alt-tab style. Yup, it will be done on ARM soon enough, its already hit some silicon ..
 
This would mean running linux and android apps side by side with no overhead required by virtualization. Bringing android kernel features into linux kernel (mainlining) means android apps would run natively, whether they are using the dalvik vm or not.
How is this possible without a dalvik vm ?
It would use the dalvik VM that comes with Android.
I'm not into Androids inner works so forgive me if the question is stupid, but what about the mechanism/resources that outreach the "simple" functionality of a vm? Wouldn't we need all the filesystem structures, databases, etc. and does this bear possible conflict potential with the Linux distribution used in parallel / as host
 
Back
Top