Languages: |
English • العربية • Български • Česky • Dansk • Deutsch • Esperanto • Eesti • Español • فارسی • Suomi • Français • עברית • Magyar • Italiano • 한국어 • Nederlands • Norsk (bokmål) • Polski • Português • Română • Русский • Svenska • Slovenčina • Українська • 中文(中国大陆) • 中文(台灣) • Euskara • Català |
Android is one of the many distributions that currently work on the Openmoko phones. You can compare a distribution with an Operating System on normal computers. It gives the phone all the software needed for operating. For more information about the different flavors, see distributions.
This page is dedicated to porting the Android OS to the Neo 1973 and Neo FreeRunner handsets. Since the Android OS was publically released on 20081021, work is currently underway to port Android to the Neo 1973 and FreeRunner handsets.
As Ben Leslie had pointed out on his blog far before the source code was released, Android was originally designed to work with the ARMv5TE instruction set architecture (ISA), which allows for DSP enhanced instructions. Contrary to the ARMv5TE ISA, the Neo1973 and FreeRunner handsets both feature an arm920t core, which comply to the ARMv4T ISA.
Before the source code was released, kernel trap handlers were implemented to 'emulate' the ARMv5TE ISA. Although the results worked in many cases, trapping is costly and performance suffered as a result. Moreover, without explicitly knowing which conditions were set by various instructions, such as Thumb Mode execution, the result became nondeterministic.
With the release of the Android source code, the Open Source community is no longer limited to dealing with a binary-only product. The Open Handset Alliance (OHA) has let their source code become their product for everyone enrich and benefit from.
Currently, porting efforts are underway in many circles. Patches should be submitted via the official Android channels.
Koolu, a Freerunner distributor, has released the source code of their Android port at http://git.koolu.com. See the #Building the Koolu Android Source instructions below for how to build an Android image for Freerunner.
To track the status of which parts of the Android source tree contain ARMv5 specific code, I've created a table of where it is contained, and the status of patches. It can be found at: http://spreadsheets.google.com/pub?key=pzDEXnU19gkeTjpD28t-7fw User:Bricode
Sean McNeil said that he was able to get Android running (including telephony) in his Freerunner source.
Ben Leslie mentioned on the android-porting list that he was able to get the 'Android' logo to appear on his Neo 1973.
TARGET_TOOLS_PREFIX := /opt/android-toolchain/bin/armv4t-android-eabi- TARGET_PRODUCT := freerunner
as documented at http://trac.koolu.org/wiki/Toolchain.
$ make
You can use this script:
#!/bin/sh currentdir=`pwd` ANDROID_OUT=out ANDROID_DEVICE=freerunner EXPORT_ROOT=$currentdir/build_jffs2_tmp Usage() { echo "Usage: $0 release|debug jffs2filename" } BuildImage() { if [ -d $1 ] then echo "[INFO] Copying from... $1" sudo rm -rf $EXPORT_ROOT mkdir $EXPORT_ROOT mkdir $EXPORT_ROOT/root # Copy the image... cd $1 tar cf - root | (cd $EXPORT_ROOT; sudo tar xf -) tar cf - system | (cd $EXPORT_ROOT/root; sudo tar xf -) # Change owner and permissions... cd $EXPORT_ROOT sudo chown -R root:root root sudo chmod -R 777 root cd $currentdir # Make the JFFS2 file mkfs.jffs2 --pad=0x700000 -o $2 -e 0x20000 -n -d$EXPORT_ROOT/root/ echo "[INFO] Image written to $2" sudo rm -rf $EXPORT_ROOT else echo "$1 does not exist!" fi } if [ $# != 2 ] then Usage else case $1 in release) BuildImage $ANDROID_OUT/target/product/$ANDROID_DEVICE $2 ;; debug) BuildImage $ANDROID_OUT/debug/target/product/$ANDROID_DEVICE $2 ;; *) Usage esac fi
There is currently no documented way to build a Freerunner/Android kernel. Sean McNeil has been releasing kernels at http://people.openmoko.org/sean_mcneil/. Most of the patches required to run Android have be incorporated into the andy-tracking kernel branch, which will eventually be the new stable kernel. Once all the patches are in the kernel, it should be possible to run Android with a stock kernel.
It is possible to get Windows to at least recognize the Android "Ethernet Gadget" and charge the FreeRunner using the Android USB Windows driver (http://dl.google.com/android/android_usb_windows.zip) by modifying the android_usb.inf file in that package before attempting to install the driver. The following modifications are required:
Add the following to the [Google.NTx86] section of the android_usb.inf file:
; Neo FreeRunner %USB\VID_1457&PID_5117.DeviceDescRelease%=androidusb.Dev, USB\VID_1457&PID_5117 %USB\VID_1457&PID_5117&MI_01.DeviceDescRelease%=androidusb.Dev, USB\VID_1457&PID_5117&MI_01
and add the following to the to the [Strings] section of the android_usb.inf file:
USB\VID_1457&PID_5117.DeviceDescRelease="Neo FreeRunner" USB\VID_1457&PID_5117&MI_01.DeviceDescRelease="Neo FreeRunner Composite ADB Interface"
The Windows version of adb does not appear to recognize the connected device yet but at least the FreeRunner charges and the device driver indicates that "This device is working properly."
You can start by following the instructions to download and build the Android source from scratch. Please see http://source.android.com/download and follow the instructions for your architecture.
It's generally a good idea to make your efforts known via wiki systems, public mailing lists, forums, and publically open version control systems.
Always take credit for your work but please don't do it in the form of comments. Some code is already hard enough to read without comments polluting the text. The best thing to do is to create a patch and put a header with your information at the top. Collaboration systems such as git might already do this for you (??).
If you create something new and have the ability to designate the license for it, please consider license compatibility issues.
For each ARMv5TE instruction, one could potentially
This is a list of opcodes, extracted from the Android source, that are unsupported for ARMv4T compliant processors (specifically the arm920t). The opcodes represent instructions available for ARMv5, ARMv5T, and ARMv5TE architectures, which are not present in the ARMv4T ISA. The list was obtained by exhaustively editing the recompiling the Android source code until it compiled without error.
Please keep in mind, that in some cases, translating these instructions into a sequence of ARMv4T instructions will be impossible and / or result in nondeterministic execution because of
|
Using the above list of opcodes, one can scan the Android source code for ARMv4T-incompatible instruction sequences.
Code:
#!/bin/sh # $1 is the android directory if [ $# -ne 1 ]; then exit -1 fi cd "${1}" opcodes="blx clz ldrd pld smlabb smlabt smlatt smlal smlawb smlawt smulbb smulbt smultt smulwb smulwt qadd qdadd qdsub qsub strd" for op in ${opcodes}; do echo "* ${op} =====================================" if [ ! -e .files.${op} ]; then files="$(grep -R -i "${op} " * 2>/dev/null)" files="$(echo $files | grep -v "^Binary file" | sed -e 's/:.*//')" files="$(echo $files| grep -v "CREDIT\|README\|^\(kernel/\|.git/\)\|\(\.txt\)$" | sort -u)" echo "${files}" > .files.${op} else files="$(cat .files.${op})" fi for fil in ${files}; do lines="$(grep -n -i "${op} " ${fil} | sed -e 's/:.*//g' )" lines="$(echo $lines | sed -e 's/ /,/g')" echo "** ${fil}: lines {${lines}}" done done |
The list of files below may or may not be complete. There might also be some assembly code that is generated with a python script (verification?).
|
The file
system/core/libpixelflinger/codeflinger/ARMAssembler.cpp
will need special attention. It's responsible for dynamic generation of DSP code.
(Please Update Me)