Alberto Embedded & Open experience

Notes on my experience on Open Source Embedded Systems

Archive for the ‘android’ Category

On Android smoothness

with 2 comments

Currently I am working on Android optimizations for Freescale i.MX SoCs.

I am frustrate because of a lot of CPU utilization in jobs where the load should not be as heavy as it looks.. But I am working on! And solutions are coming up.
I found by chance this  Freescale video, where one Freescale engineer present the opportunity to develop Android based embedded projects on an MPC8536 (Power III based SoC that works at 1.25 GHz) provided board.
He say “Optimized implementation of  Android operating system” but look at time 2:18! How smooth is this Optimized implementation 🙂


Written by Alberto!

25/02/2010 at 12:53 am

Posted in android

Tagged with , , , ,

Developing kernel on a Virtual Machine (First try)

with one comment

To save writing cycles of the Armadillo NAND flash, in those days I had  searched a way to execute the developing kernel on an ARM emulator.

First try: Android Emulator

I am working on Android? so why not using the Android Emulator tool??

I am not a guru on this, so maybe I’m wrong with something.. Someone will correct me if there were an easier way.

Android emulator is known to be build over the Qemu Open Source Process Emulator but Google tend to do things harder than they are: they have introduced a new virtual hardware device based on ARMv5te architecture called Goldfish.

Qemu emulate so well the ARM Integrator platform (same processor architecture), why build another? why create another buggy linux platform? buggy in the sense that it work for the kernel version that is developed, but must be maintained in the successive kernel release and who do this work? Maybe unanswerable question..

I’ve tried to port in mainline the Goldfish platform taking it from the android-goldfish-2.6.29 branch, correcting all the Coding Style problems given by resulting in: early support, console output  and maybe network ability, but no ability to mount initrd images or nand images -> no rootfilesystem ability and so I not spend here so many time describing this developing path.

Fortunately the light bulb come up my head and through the Qemu home page I’ve found that the reference machine platform for ARM emulation is the ARM Integrator, well supported in mainline Linux kernel and within the downloads I’ve found a reference kernel plus initrd file to use within.
Good! Second try!

Written by Alberto!

24/11/2009 at 9:55 am

Posted in android

Tagged with ,

Android subsystem is gonna die

with 3 comments

As you can see on linux webgit log the Android subsystem resident on mainline kernel developing tree is gonna die:

Staging: android: mark subsystem as broken

It’s causing lots of build errors, so just mark it as broken.  It is
scheduled to be removed in 2.6.33 anyway.

Signed-off-by: Greg Kroah-Hartman <>

A BROKEN subsystem is a piece of kernel code that the build system do not visit in the build process.

The true problem is that Google has stopped to support mainline code leaving it at an embryonic state: no Coding Style corrections and no update on new kernel API changes.

Another important thing is that the android subsystem that live now in mainline kernel is incomplete: many parts of Google layer were not merged with mainline linux, producing an eternal incomplete subsystem.

What the mess with this? Why the mainline part of Android is important? There is always the android branch hosted by Google no?

Yes is true, but what about the next device porting? what about quality on device porting? A mainline architecture support code is controlled and accepted by a number of Community Developers that know better than a lot of people how this things must be done, and sure, also the better developer make mistakes!

Developing a new hardware platform in the Google android branch make this job harder and full of traps.

The aim of my job now is to recover this situation, taking the present mainline android subsystem on the right way in terms of quality and readability and then completing it with the missing things!

So, good Job Alberto!

Written by Alberto!

23/11/2009 at 6:11 pm

Sul repository locale del kernel

leave a comment »

Nella cartella “master/prebuilt/android-arm/kernel/” troviamo un bellissimo file “PREBUILT” che recita:

To rebuild the emulator kernel:

% git clone git:// kernel
% cd kernel
% export ARCH=arm
% export CROSS_COMPILE=arm-eabi-
% make goldfish_defconfig
% make

If kernel/common.git is mapped into your repo client, you can
just built it from there instead of re-cloning it.

ehm.. un pò da adattare dato che non menziona il branch android-goldfish-2.6.27 (nel branch common del kernel non c’è il file goldfish_defconfig) e che la toolchain di crosscompilazione non è (per ora) nel path d’esecuzione principale (non abbiamo modificato PATH).
Ma almeno abbiam trovato delle informazioni 🙂

Written by Alberto!

07/03/2009 at 11:29 am

Posted in android, linux-arm

Tagged with , , ,

Il nostro nuovo Android sull’emulatore!!

leave a comment »

Bene bene, compilato il Kernel 2.6.27 per la macchina goldfish eseguiamo il tutto sull’emulatore!
Raccimoliamo tutti i file di output dei processi di build necessari che sono:

  • Kernel, l’immagine compressa:
  • Android, i file immagine per ramdisk userdata e system nella cartella:

Io ho copiato la zImage nella cartella di output di android:

$ cd PATH_GIUSTO/alberdroid/master/out/target/product/generic/
$ cp PATH_GIUSTO/alberdroid/kernel-goldfish/.repo/manifests/arch/arm/boot/zImage .

e via all’emulatore!

$ emulator -system . -kernel zImage -show-kernel

Così l’emulatore cercherà i file ramdisk.img userdata.img e system.img nella cartella corrente (-system .), utilizzerà zImage come immagine del kernel (..non utilizzare l’immagine Image ma quella compressa zImage) e nella shell corrente mostrerà l’output del kernel!

Written by Alberto!

07/03/2009 at 10:57 am

Kernel per Android..

leave a comment »

Link di riferimento:
Allora, la sottocartella kernel esiste in master! e perché non viene compilata????
Urc! solita ricerca in rete e vien fuori che la versione che ho non è propriamente la versione per goldfish -> attiviamo il branch giusto!
..consiglio, creiamo un’altra directory per il nostro kernel:

$ mkdir -p alberdroid/kernel-goldfish
$ cd alberdroid/kernel-goldfish
$ repo init -u git:// -b android-goldfish-2.6.27
$ repo sync

Solito tempo che passa…..

Edit: perché ha salvato i sorgenti in .repo/manifests ??
cmq, dal precedente codice shell

$ cd .repo/manifests

e si continua con:

$ export ARCH=arm
$ export CROSS_COMPILE=PATHGIUSTO/alberdroid/master/prebuilt/linux-x86/toolchain/arm-eabi-4.2.1/bin/arm-eabi-
$ make goldfish_defconfig
$ make

Verrà così creato un buon kernel per l’emulatore 🙂

Written by Alberto!

06/03/2009 at 4:15 pm

Posted in android

Tagged with , , , ,

Prima Build!

leave a comment »

Dopo il sync con i sorgenti via al processo di make!
se si vuol compilare il sistema per l’emulatore goldfish (emulatore arm v5) allora dalla directory madre eseguiamo:

$ cd ~/alberdroid/master
$ make

Il processo è abbastanza lungo (più di un’ora nel mio portatile) e necessita di molta memoria! 1GB di ram non basta…..

Ma al termine, con il comando:

$ emulator -system out/target/product/generic/ \
-kernel prebuilt/android-arm/kernel/kernel-qemu -show-kernel

Vedremo apparire il nostro caro emulatore arm con android funzionante!!
Chiaro.. dovremmo avere l’emulatore installato correttamente.. rimando all’installzione dell’sdk per le applicazioni di android.. ma notiamo una cosa fondamentale: Il kernel!
In quasi due ore di compilazione il processo make non ha compilato il kernel! ho dovuto usarne uno che stà nella cartella prebuilt!

Ma siamo contenti d’aver compilato tutto il resto dai..! Il prossimo post sarà dedicato al kernel!

Written by Alberto!

06/03/2009 at 4:04 pm

Posted in android

Tagged with , , , ,