Please note that User Registration has been temporarily disabled due to a recent increase in automated registrations. If anyone needs an account, please request one here: RequestAccount. Thanks for your patience!--Wmat (talk)
Please email User:Wmat if you experience any issues with the Request Account form.

Difference between revisions of "Android Porting"

From eLinux.org
Jump to: navigation, search
(Porting Issues: add link to Dalvik porting guide)
Line 1: Line 1:
 
This page describes various effort to port Android to new boards and new processors
 
This page describes various effort to port Android to new boards and new processors
 +
 +
== Porting Overview ==
 +
This overview of porting steps was seen on the android-porting list:<br>
 +
See http://www.mail-archive.com/android-porting@googlegroups.com/msg06721.html
 +
 +
This glosses over all the kernel work for a new board, and the android-specific
 +
kernel patches, but has some good discussion about the flash partitioning and file
 +
system bringup process.
 +
 +
<pre>
 +
If the linux kernel is up and running with all drivers in.
 +
(particularly touchscreen and display) it shouldn't be too bad.
 +
 +
IHMO, the easiest way to get you running is to aggregate the initial
 +
ramfs built into the kernel with the Android build, the root Android
 +
root filesystem (system), and the user data section (mounted as /data
 +
I believe) into one root filesystem.
 +
 +
You can then take that root filesystem as one tarball.
 +
 +
Modify the NAND partitioning of the kernel to set aside space for the
 +
whole Android rootfs, and of course rebuild the kernel. (Be sure yaffs
 +
support is in the kernel) Also no need for a ramfs at this point, just
 +
have the kernel look to mtd2 for it's root filesystem, which will be
 +
jffs2
 +
 +
Create yourself a busybox root filesystem too. Make that into a jffs2
 +
image.
 +
 +
So your partitioning would look something similar to this (you'll have
 +
to decide on the sizes of course):
 +
mtd0: bootloader
 +
mtd1: kernel
 +
mtd2: rootfs (jffs2)
 +
mtd3: Android rootfs.
 +
 +
Erase everything on the NAND.
 +
Burn the normal Chumby bootloader to mtd0.
 +
Burn the the new kernel into mtd1.
 +
Burn the jffs2 rootfs image to mtd2.
 +
 +
Boot the device. Hopefully you get yourself to a prompt.
 +
 +
Once you have that prompt mount mtd3 to /mnt/android as a yaffs2
 +
partition.
 +
Untar your Android rootfs into /mnt/android.
 +
Chown and chgrp everything under /mnt/android to "root"
 +
chroot to that mount point "chroot /mnt/android /init"
 +
 +
At this point you should see Android trying to run.
 +
 +
 +
I know that's a bit to chomp on, but it's more of an outline of what
 +
you will need to do. Of course it's assuming you have the ability to
 +
erase the whole nand and put down images amongst other assumptions,
 +
but it should help get your mind around a little bit of the
 +
requirements to get Android running on your device.
 +
 +
Regarding your bootloader question, I'd just stick with the current
 +
one. You'll only need to modify that if/when you go into having
 +
everything compatible with the recovery system. Which is a completely
 +
different discussion.
 +
</pre>
  
 
== Porting Tutorials ==
 
== Porting Tutorials ==

Revision as of 18:56, 4 December 2009

This page describes various effort to port Android to new boards and new processors

Porting Overview

This overview of porting steps was seen on the android-porting list:
See http://www.mail-archive.com/android-porting@googlegroups.com/msg06721.html

This glosses over all the kernel work for a new board, and the android-specific kernel patches, but has some good discussion about the flash partitioning and file system bringup process.

If the linux kernel is up and running with all drivers in.
(particularly touchscreen and display) it shouldn't be too bad.

IHMO, the easiest way to get you running is to aggregate the initial
ramfs built into the kernel with the Android build, the root Android
root filesystem (system), and the user data section (mounted as /data
I believe) into one root filesystem.

You can then take that root filesystem as one tarball.

Modify the NAND partitioning of the kernel to set aside space for the
whole Android rootfs, and of course rebuild the kernel. (Be sure yaffs
support is in the kernel) Also no need for a ramfs at this point, just
have the kernel look to mtd2 for it's root filesystem, which will be
jffs2

Create yourself a busybox root filesystem too. Make that into a jffs2
image.

So your partitioning would look something similar to this (you'll have
to decide on the sizes of course):
mtd0: bootloader
mtd1: kernel
mtd2: rootfs (jffs2)
mtd3: Android rootfs.

Erase everything on the NAND.
Burn the normal Chumby bootloader to mtd0.
Burn the the new kernel into mtd1.
Burn the jffs2 rootfs image to mtd2.

Boot the device. Hopefully you get yourself to a prompt.

Once you have that prompt mount mtd3 to /mnt/android as a yaffs2
partition.
Untar your Android rootfs into /mnt/android.
Chown and chgrp everything under /mnt/android to "root"
chroot to that mount point "chroot /mnt/android /init"

At this point you should see Android trying to run.


I know that's a bit to chomp on, but it's more of an outline of what
you will need to do. Of course it's assuming you have the ability to
erase the whole nand and put down images amongst other assumptions,
but it should help get your mind around a little bit of the
requirements to get Android running on your device.

Regarding your bootloader question, I'd just stick with the current
one. You'll only need to modify that if/when you go into having
everything compatible with the recovery system. Which is a completely
different discussion.

Porting Tutorials


Porting Issues

  • Matt Porter (Mentor Graphics) gave a presentation on difficulties encountered while they were porting Android to MIPS and PPC processors at ELC Europe 2009. His talk was called "Mythbusters: Android" and has lots of good information.

Porting to New Processors

  • Mentor Graphics has ported Android to MIPS and PPC
  • Power.Org supported the work to port Android to PPC