View source for Android/zh tw
From Openmoko
You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page:
Templates used on this page:
Return to Android/zh tw.
You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page:
Templates used on this page:
Return to Android/zh tw.
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.
詳盡的在FreeRunner上安裝Android (使用 Sean McNeil的kernel及rootfs 套件,及 Qi bootloader) ,何以在http://www.copiesofcopies.org/webl/?p=34此網址找到。
就如同 Ben Leslie 在 blog 中所提到的,在 source code釋出之前,Android 被設計為使用ARMv5TE 架構instruction set architecture (ISA),允許 DSP 擴充的指令。 相較於 ARMv5TE ISA, the Neo1973 及 FreeRunner 電話聽筒都著重在arm920t core,並可以應用到 ARMv4T ISA。
在源碼開放之前,kernel trap handlers 被用來 '模擬' ARMv5TE ISA。雖然這個結果在不同的案例下運作,trapping 是較花成本及效能的一種結果。甚至於,在沒有明確的暸解哪個狀況是被不同的指令所設定的情兄下,如Thumb Mode execution,這個結果成為沒有定論。
隨著 Android釋出 source code,Open Source社群不再受限於使用binary-only 產品。The Open Handset Alliance (OHA)已經讓他們的source code 成為能讓大家致富及受益的產品。
目前,porting 以不同的循環模式運做。Patches需要透過 official Android channels提交。
Koolu,Freerunner 的經銷商, 在http://git.koolu.com釋出了他們搭載FreeRunner的源碼。參考 #Building the Koolu Android Source下的說明可以暸解到如何製作供給Freerunner使用的Android image。
為了要追蹤Android source tree的哪個部份包含了特定的 ARMv5 程式,我製作了包含patches狀態的表格。這個表格可以在 http://spreadsheets.google.com/pub?key=pzDEXnU19gkeTjpD28t-7fw 找到。User:Bricode
Sean McNeil 指出他可以在FreeRunner上執行包含通話功能的 Android。
Ben Leslie 也在android-porting list上指出他可以在Neo 1973 show出他的Android logo。
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)