[Samsung Galaxy Nexus] aosp:
[MENTION=4608636]bsmitty83[/MENTION] [MENTION=4443334]Grarak[/MENTION]

Have you guys tested out Fastswitch on the tuna before?

ARM: mach-omap2 tuna: Fastswitch

Fastswitch implementation for tuna

Features include:

- Loading a kernel image in memory and boot it side by side

with the running kernel

- Switching from one instance to another

http://goo.gl/ZFBJ79

Section 4 Evaluation and limitations

Our prototype of Fastswitch has been implemented on a Galaxy Nexus smartphone. The ARM-based dual core smartphone packages (TODO look for a better word) the TI-manufactured OMAP4460 chip, and includes a variety of devices such as screen, radio, wifi, bluetooth, camera. On the software side, the Galaxy Nexus supports natively the Android OS from the version 4.0 onwards. The first stage and second stage boot loaders are proprietary, and can not be extracted, nor edited.

Due to the scarcity of the available operating systems for the Galaxy Nexus, we implemented Fastswitch on Android 4.0.4 based on Linux 3.0.8, and on Android 4.1.1 based on Linux 3.0.31.*

No modifications were done on the bootloader level.*

Several features, namely the*Sparse memory model, were not available on ARM architecture (or on this version of the kernel) and were ported from other architecture or future versions of the kernel.

About 1700 lines of code have been added to the Linux kernel: about 150 lines of code are platform dependant (one third of them being assembly), about 500 lines of code are architecture dependant. (estimation only).*

We modified no drivers, as we hoped to make Fastswitch functional with minimal changes and knowledge of the drivers implementation.

To control Fastswitch, we implemented a debugfs based interface, accessible from any user. Simple shell scripts can control the various operations, which include:

* Free and reserve a number of sections, starting from an address

* Load a file to a location

* Boot a new instance

* Switch to a*sleeping*instance

* Request a number of sections

This set of operations suffices to accomplish the features intended for Fastswitch.

The evaluation criteria include:

* The ability to host many OS

* How fast we can switch between instances

* If we can retain the full functionality of each instance

* The performance overhead

Hosting many OS

Our implementation platform has 1Gb of RAM, with about one quarter reserved for devices. The memory requirement of Android 4.0 is big (TODO add a source?), therefore we can host at most two instances, with enough memory for each instance to run a few apps. The*initial*instance will have the full memory at its disposition on boot, so there is no differences with a regular mobile device. The*initial*instance is able to make room for a second instance, load and boot it. Boot time of a secondary instance is the same as a regular boot. And once booted, it is possible to switch from one instance to the other (see below). It is also possible for an instance to request a few sections from the other instance.

On another direction, initiating a power off request will effectively power off the device, even if there still are*sleeping*instances.

Switching instance

To switch from an instance to another, the average time reached on our prototype is 1.44 seconds. This time may be larger due to exceptional delays occuring during the procedure, and can be further reduced with unreliable optimizations. Next is the breakdown.

fastswitch-notes http://goo.gl/oZML0b