<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://wiki.openmoko.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.openmoko.org/api.php?action=feedcontributions&amp;user=Bricode&amp;feedformat=atom</id>
		<title>Openmoko - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.openmoko.org/api.php?action=feedcontributions&amp;user=Bricode&amp;feedformat=atom"/>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Special:Contributions/Bricode"/>
		<updated>2013-05-25T19:22:23Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.19.6</generator>

	<entry>
		<id>http://wiki.openmoko.org/wiki/User:Bricode</id>
		<title>User:Bricode</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/User:Bricode"/>
				<updated>2008-10-24T00:46:33Z</updated>
		
		<summary type="html">&lt;p&gt;Bricode: New page: You can contact me at Brian.Code@koolu.com&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You can contact me at Brian.Code@koolu.com&lt;/div&gt;</summary>
		<author><name>Bricode</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Android</id>
		<title>Android</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Android"/>
				<updated>2008-10-24T00:46:06Z</updated>
		
		<summary type="html">&lt;p&gt;Bricode: /* Current State */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
This page is dedicated to porting the [http://www.android.com Android OS] to the [[Neo 1973]] and [[Neo FreeRunner]] handsets. Since the Android OS was [http://source.android.com/posts/opensource  publically released] on 20081021, [http://benno.id.au/blog/2007/11/21/android-neo1973 work] [http://perpetual-notion.blogspot.com/search/label/android is] [http://groups.google.com/group/android-porting currently underway] to port Android to the [[Neo1973 Hardware|Neo 1973]] and [[Neo_FreeRunner_GTA02_Hardware|FreeRunner]] handsets.&lt;br /&gt;
&lt;br /&gt;
== Goals ==&lt;br /&gt;
# Systematically introduce patches for ARMv4T in the Android codebase&lt;br /&gt;
# Provide Neo1973 and Neo FreeRunner hardware-dependent patches in the Android codebase, leveraging the work already done by the Openmoko developers, without forcing Android-specific changes upstream&lt;br /&gt;
# Provide a useable Android filesystem and kernel on the [[Distributions]] page that conform to current Openmoko installation routines&lt;br /&gt;
&lt;br /&gt;
== Early Attempts ==&lt;br /&gt;
As [http://benno.id.au Ben Leslie] had pointed out on his [http://benno.id.au/blog/2007/11/21/android-neo1973 blog] far before the source code was released, [http://www.android.com Android] was originally designed to work with the ARMv5TE [http://en.wikipedia.org/wiki/Instruction_set_architecture instruction set architecture] (ISA), which allows for [http://en.wikipedia.org/wiki/ARM_architecture#DSP_Enhancement_Instructions DSP enhanced instructions]. Contrary to the ARMv5TE ISA, the Neo1973 and FreeRunner handsets both feature an arm920t core, which comply to the ARMv4T ISA.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Current State ==&lt;br /&gt;
&lt;br /&gt;
With the release of the Android [http://source.android.com 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.&lt;br /&gt;
&lt;br /&gt;
Currently, porting efforts are underway in many circles. Patches should be submitted via the [http://source.android.com/submit-patches official Android channels].&lt;br /&gt;
&lt;br /&gt;
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]]&lt;br /&gt;
&lt;br /&gt;
= How to Help =&lt;br /&gt;
&lt;br /&gt;
== Getting Started ==&lt;br /&gt;
&lt;br /&gt;
You can start by following the instructions to download and build the Android source from scratch. Please see [http://source.android.com/download http://source.android.com/download] and follow the instructions for your architecture.&lt;br /&gt;
&lt;br /&gt;
== Publicize Your Efforts ==&lt;br /&gt;
&lt;br /&gt;
It's generally a good idea to make your efforts known via wiki systems, public mailing lists, forums, and publically open version control systems.&lt;br /&gt;
&lt;br /&gt;
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 (??).&lt;br /&gt;
&lt;br /&gt;
If you create something new and have the ability to designate the license for it, please consider license compatibility issues.&lt;br /&gt;
&lt;br /&gt;
== Porting Strategy ==&lt;br /&gt;
&lt;br /&gt;
* Analysis and leverage of the existing build system&lt;br /&gt;
** buid/core/combo/arm-linux.mk&lt;br /&gt;
*** -D__ARCH_ARM_4__ -D__ARCH_ARM_4T__&lt;br /&gt;
*** -march=armv4t -mcpu=arm920t&lt;br /&gt;
** fix various static references to 'armv5'&lt;br /&gt;
* Isolating ARMv5TE ISA dependent code&lt;br /&gt;
** e.g. grep -n -R -i &amp;quot;${armv5te_isa_pattern}&amp;quot; ~/android&lt;br /&gt;
* Abstracting&lt;br /&gt;
** ( C/C++ ) Use inlined functions / #ifdef statments to implement functions in a portable manner&lt;br /&gt;
** ( ASM ) #ifdef statements ?&lt;br /&gt;
&lt;br /&gt;
For each ARMv5TE instruction, one could potentially&lt;br /&gt;
* Implement the instruction using general registers instead of DSP calls (i.e. eabi / softfloat)&lt;br /&gt;
* If that is a) nondeterministic, or b) slow, then sections of code need to be analyzed and hand-optimized for the ARMv4T isa&lt;br /&gt;
&lt;br /&gt;
== List of Unsupported Instructions ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
* the requirement of additional context&lt;br /&gt;
* the tendencies of certain opcodes to change condition registers that may or may not be present in the arm920t core&lt;br /&gt;
&lt;br /&gt;
=== Opcodes ===&lt;br /&gt;
&lt;br /&gt;
{{scroll box|height=150px|text=&lt;br /&gt;
* blx&lt;br /&gt;
* clz&lt;br /&gt;
* ldrd&lt;br /&gt;
* pld&lt;br /&gt;
* smla&lt;br /&gt;
** smlabb&lt;br /&gt;
** smlabt&lt;br /&gt;
** smlatt&lt;br /&gt;
* smlal&lt;br /&gt;
* smlaw&lt;br /&gt;
** smlawb&lt;br /&gt;
** smlawt&lt;br /&gt;
* smul&lt;br /&gt;
** smulbb&lt;br /&gt;
** smulbt&lt;br /&gt;
** smull&lt;br /&gt;
** smultt&lt;br /&gt;
* smulw&lt;br /&gt;
** smulwb&lt;br /&gt;
** smulwt&lt;br /&gt;
* qadd&lt;br /&gt;
* qdadd&lt;br /&gt;
* qsub&lt;br /&gt;
* qdsub&lt;br /&gt;
* strd&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
(Please keep the opcode list in alphabetical order)&lt;br /&gt;
&lt;br /&gt;
TODO: Turn the list into a table with short descriptions of the opcodes.&lt;br /&gt;
&lt;br /&gt;
=== Scanning for Files That Use the ARMv5TE ISA ===&lt;br /&gt;
&lt;br /&gt;
Using the above list of opcodes, one can scan the Android source code for ARMv4T-incompatible instruction sequences.&lt;br /&gt;
&lt;br /&gt;
'''Code:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
opcodes=&amp;quot;blx clz ldrd pld smlabb smlabt smlatt smlal smlawb smlawt smulbb smulbt smull smultt smulwb&lt;br /&gt;
  smulwt qadd qdadd qsub qdsub strd&amp;quot;;&lt;br /&gt;
opcodePat=$(echo ${opcodes} | sed -e s: :\\\|:g);&lt;br /&gt;
fileList=&amp;quot;$(grep -R -i &amp;quot;\(${opcodePat}\)&amp;quot; * 2&amp;gt;/dev/null | grep -v &amp;quot;^Binary file&amp;quot; |&lt;br /&gt;
  sed -e 's/:.*//' | sort -u)&amp;quot;;&lt;br /&gt;
fileList=&amp;quot;$(echo ${fileList} | grep -v &amp;quot;README\|^\(kernel/)\|\(\.txt\)$&amp;quot;)&amp;quot;;&lt;br /&gt;
for i in ${fileList}; do echo &amp;quot;* ${i}&amp;quot;; done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Source Files in Android that Use the ARMv5TE ISA ===&lt;br /&gt;
&lt;br /&gt;
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?).&lt;br /&gt;
&lt;br /&gt;
{{scroll box|height=150px|text=&lt;br /&gt;
* bionic/libc/arch-arm/bionic/memcmp.S&lt;br /&gt;
* bionic/libc/arch-arm/bionic/memcmp16.S&lt;br /&gt;
* bionic/libc/arch-arm/bionic/memcpy.S&lt;br /&gt;
* bionic/libc/arch-arm/bionic/strlen.c&lt;br /&gt;
* bionic/libc/kernel/arch-arm/asm/arch/irqs.h&lt;br /&gt;
* bionic/libc/tools/gensyscalls.py&lt;br /&gt;
* bootloader/legacy/nandwrite/init.S&lt;br /&gt;
* bootloader/legacy/usbloader/init.S&lt;br /&gt;
* dalvik/vm/arch/arm/CallEABI.S&lt;br /&gt;
* dalvik/vm/arch/arm/CallOldABI.S&lt;br /&gt;
* dalvik/vm/mterp/armv5/OP_AGET_WIDE.S&lt;br /&gt;
* dalvik/vm/mterp/armv5/OP_APUT_WIDE.S&lt;br /&gt;
* dalvik/vm/mterp/armv5/OP_IGET_WIDE.S&lt;br /&gt;
* dalvik/vm/mterp/armv5/OP_IGET_WIDE_QUICK.S&lt;br /&gt;
* dalvik/vm/mterp/armv5/OP_IPUT_WIDE.S&lt;br /&gt;
* dalvik/vm/mterp/armv5/OP_IPUT_WIDE_QUICK.S&lt;br /&gt;
* dalvik/vm/mterp/armv5/OP_SGET_WIDE.S&lt;br /&gt;
* dalvik/vm/mterp/armv5/OP_SPUT_WIDE.S&lt;br /&gt;
* dalvik/vm/mterp/out/InterpAsm-armv5.S&lt;br /&gt;
* dalvik/vm/oo/Object.h&lt;br /&gt;
* development/emulator/qtools/armdis.cpp&lt;br /&gt;
* development/emulator/qtools/thumbdis.cpp&lt;br /&gt;
* external/elfutils/src/Makefile&lt;br /&gt;
* external/elfutils/src/Makefile.am&lt;br /&gt;
* external/elfutils/src/Makefile.in&lt;br /&gt;
* external/freetype/include/freetype/config/ftconfig.h&lt;br /&gt;
* external/jpeg/jidctfst.S&lt;br /&gt;
* external/neven/Embedded/common/src/b_BasicEm/Math.c&lt;br /&gt;
* external/opencore/codecs_v2/audio/aac/dec/src/calc_sbr_synfilterbank.cpp&lt;br /&gt;
* external/opencore/codecs_v2/audio/aac/dec/src/fxp_mul32_arm_gcc.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/aac/dec/src/fxp_mul32_arm_v4.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/aac/dec/src/fxp_mul32_arm_v4_gcc.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/aac/dec/src/fxp_mul32_arm_v5.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/aac/dec/src/pv_normalize.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/aac/dec/src/trans4m_freq_2_time_fxp.cpp&lt;br /&gt;
* external/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op_arm_gcc_v5.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op_arm_v5.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_add.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_mac.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_msu.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_mult.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_sub.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mpy_32.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mpy_32_16.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mult.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/norm_l.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/normalize_amr_wb.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwbdecoder_basic_op_armv5.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwbdecoder_basic_op_gcc_armv5.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/mp3/dec/src/asm/pvmp3_dct_16_gcc.s&lt;br /&gt;
* external/opencore/codecs_v2/audio/mp3/dec/src/asm/pvmp3_dct_9.s&lt;br /&gt;
* external/opencore/codecs_v2/audio/mp3/dec/src/asm/pvmp3_dct_9_gcc.s&lt;br /&gt;
* external/opencore/codecs_v2/audio/mp3/dec/src/asm/pvmp3_mdct_18.asm&lt;br /&gt;
* external/opencore/codecs_v2/audio/mp3/dec/src/asm/pvmp3_mdct_18.s&lt;br /&gt;
* external/opencore/codecs_v2/audio/mp3/dec/src/asm/pvmp3_mdct_18_gcc.s&lt;br /&gt;
* external/opencore/codecs_v2/audio/mp3/dec/src/asm/pvmp3_polyphase_filter_window.asm&lt;br /&gt;
* external/opencore/codecs_v2/audio/mp3/dec/src/asm/pvmp3_polyphase_filter_window.s&lt;br /&gt;
* external/opencore/codecs_v2/audio/mp3/dec/src/asm/pvmp3_polyphase_filter_window_gcc.s&lt;br /&gt;
* external/opencore/codecs_v2/audio/mp3/dec/src/pv_mp3dec_fxd_op_arm.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/mp3/dec/src/pv_mp3dec_fxd_op_arm_gcc.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/mp3/dec/src/pvmp3_normalize.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/sbc/enc/src/sbcenc_filter.h&lt;br /&gt;
* external/opencore/codecs_v2/video/avc_h264/dec/src/vlc.cpp&lt;br /&gt;
* external/opencore/codecs_v2/video/m4v_h263/enc/src/dct_inline.h&lt;br /&gt;
* external/opencore/codecs_v2/video/m4v_h263/enc/src/fastquant_inline.h&lt;br /&gt;
* external/opencore/codecs_v2/video/m4v_h263/enc/src/vlc_encode_inline.h&lt;br /&gt;
* external/opencore/fileformats/avi/parser/include/pv_avifile_streamlist.h&lt;br /&gt;
* external/opencore/fileformats/avi/parser/src/pv_avifile_streamlist.cpp&lt;br /&gt;
* external/openssl/crypto/bn/bn_prime.c&lt;br /&gt;
* external/qemu/target-arm/translate.c&lt;br /&gt;
* external/qemu/trace.c&lt;br /&gt;
* external/skia/include/corecg/SkFixed.h&lt;br /&gt;
* external/skia/include/corecg/SkMath.h&lt;br /&gt;
* external/skia/libcorecg/Sk64.cpp&lt;br /&gt;
* external/skia/libcorecg/SkMatrix.cpp&lt;br /&gt;
* external/skia/libsgl/effects/SkColorMatrixFilter.cpp&lt;br /&gt;
* external/skia/libsgl/sgl/SkBitmap.cpp&lt;br /&gt;
* external/skia/libsgl/sgl/SkBitmapShader.cpp&lt;br /&gt;
* external/skia/libsgl/sgl/SkGraphics.cpp&lt;br /&gt;
* external/srec/config/en.us/dictionary/c0.6.ok&lt;br /&gt;
* frameworks/base/libs/audioflinger/AudioMixer.cpp&lt;br /&gt;
* frameworks/base/libs/audioflinger/AudioResamplerSinc.cpp&lt;br /&gt;
* frameworks/base/opengl/libagl/iterators.S&lt;br /&gt;
* frameworks/base/opengl/libagl/matrix.h&lt;br /&gt;
* system/core/include/private/pixelflinger/ggl_fixed.h&lt;br /&gt;
* system/core/libpixelflinger/codeflinger/ARMAssembler.cpp&lt;br /&gt;
* system/core/libpixelflinger/codeflinger/ARMAssemblerInterface.cpp&lt;br /&gt;
* system/core/libpixelflinger/codeflinger/disassem.c&lt;br /&gt;
* system/core/libpixelflinger/codeflinger/texturing.cpp&lt;br /&gt;
* system/core/libpixelflinger/rotate90CW_4x4_16v6.S&lt;br /&gt;
* system/core/libpixelflinger/t32cb16blend.S&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Updates ==&lt;br /&gt;
&lt;br /&gt;
Feel free to post a link to any of your work in the list below&lt;br /&gt;
&lt;br /&gt;
* 20081021 [[User:Cfriedt]] Android -&amp;gt; FreeRunner updates on my [http://perpetual-notion.blogspot.com/search/label/android blog]&lt;br /&gt;
* 20081022 [[User:Cfriedt]] I was able to 'trivially' compile all of the Android source code without error for the ARMv4T architecture by removing v5TE instructions. Although it will definitely not run anything predictably, at least now that I know the build system will work with a few simple substitutions in build/core/combo/arm-linux.mk. At this point I am able to go ahead and re-implement v5TE instructions as v4T instruction sequences instead (or re-implement entire sections of assembly with hand-optimized v4T instructions).&lt;br /&gt;
* 20081023 [[User:Bricode]] 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&lt;br /&gt;
&lt;br /&gt;
= Important Links =&lt;br /&gt;
(Please Update Me)&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://source.android.com/documentation Android Documentation]&lt;br /&gt;
* [http://www.arm.com/documentation/ ARM Documentation], (keywords: armv4t, armv5t, armv5te, arm920t, arm926ej-s)&lt;br /&gt;
== Instruction Set References ==&lt;br /&gt;
* [http://infocenter.arm.com/help/topic/com.arm.doc.dvi0025b/DVI0025.pdf ARMv4T] (See section 1.4.13)&lt;br /&gt;
* [http://infocenter.arm.com/help/topic/com.arm.doc.dvi0014a/DVI0014A_ARM10T_PO.pdf ARMv5T] (See section 4.16)&lt;br /&gt;
* [http://www.arm.com/pdfs/ARM-DSP.pdf ARM DSP Enhanced Instruction Set]&lt;br /&gt;
&lt;br /&gt;
== Hardware Reference ==&lt;br /&gt;
&lt;br /&gt;
* [[Neo1973 Hardware]]&lt;br /&gt;
* [[Neo FreeRunner GTA02 Hardware]]&lt;br /&gt;
&lt;br /&gt;
== Communities ==&lt;br /&gt;
* [http://source.android.com/discuss Android Public Mailing Lists]&lt;br /&gt;
* [http://forum.koolu.org/viewforum.php?f=10 Android on FreeRunner] at KoolU.com&lt;br /&gt;
* [[Openmoko Local Groups]]&lt;br /&gt;
* [[Openmoko:Community_Portal]]&lt;br /&gt;
&lt;br /&gt;
= See also =&lt;br /&gt;
&lt;br /&gt;
* [[Debug_Board]]&lt;br /&gt;
&lt;br /&gt;
= External Links =&lt;br /&gt;
&lt;br /&gt;
[[Category:Distributions]]&lt;/div&gt;</summary>
		<author><name>Bricode</name></author>	</entry>

	<entry>
		<id>http://wiki.openmoko.org/wiki/Android</id>
		<title>Android</title>
		<link rel="alternate" type="text/html" href="http://wiki.openmoko.org/wiki/Android"/>
				<updated>2008-10-24T00:43:48Z</updated>
		
		<summary type="html">&lt;p&gt;Bricode: /* Updates */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
This page is dedicated to porting the [http://www.android.com Android OS] to the [[Neo 1973]] and [[Neo FreeRunner]] handsets. Since the Android OS was [http://source.android.com/posts/opensource  publically released] on 20081021, [http://benno.id.au/blog/2007/11/21/android-neo1973 work] [http://perpetual-notion.blogspot.com/search/label/android is] [http://groups.google.com/group/android-porting currently underway] to port Android to the [[Neo1973 Hardware|Neo 1973]] and [[Neo_FreeRunner_GTA02_Hardware|FreeRunner]] handsets.&lt;br /&gt;
&lt;br /&gt;
== Goals ==&lt;br /&gt;
# Systematically introduce patches for ARMv4T in the Android codebase&lt;br /&gt;
# Provide Neo1973 and Neo FreeRunner hardware-dependent patches in the Android codebase, leveraging the work already done by the Openmoko developers, without forcing Android-specific changes upstream&lt;br /&gt;
# Provide a useable Android filesystem and kernel on the [[Distributions]] page that conform to current Openmoko installation routines&lt;br /&gt;
&lt;br /&gt;
== Early Attempts ==&lt;br /&gt;
As [http://benno.id.au Ben Leslie] had pointed out on his [http://benno.id.au/blog/2007/11/21/android-neo1973 blog] far before the source code was released, [http://www.android.com Android] was originally designed to work with the ARMv5TE [http://en.wikipedia.org/wiki/Instruction_set_architecture instruction set architecture] (ISA), which allows for [http://en.wikipedia.org/wiki/ARM_architecture#DSP_Enhancement_Instructions DSP enhanced instructions]. Contrary to the ARMv5TE ISA, the Neo1973 and FreeRunner handsets both feature an arm920t core, which comply to the ARMv4T ISA.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Current State ==&lt;br /&gt;
&lt;br /&gt;
With the release of the Android [http://source.android.com 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.&lt;br /&gt;
&lt;br /&gt;
Currently, porting efforts are underway in many circles. Patches should be submitted via the [http://source.android.com/submit-patches official Android channels].&lt;br /&gt;
&lt;br /&gt;
= How to Help =&lt;br /&gt;
&lt;br /&gt;
== Getting Started ==&lt;br /&gt;
&lt;br /&gt;
You can start by following the instructions to download and build the Android source from scratch. Please see [http://source.android.com/download http://source.android.com/download] and follow the instructions for your architecture.&lt;br /&gt;
&lt;br /&gt;
== Publicize Your Efforts ==&lt;br /&gt;
&lt;br /&gt;
It's generally a good idea to make your efforts known via wiki systems, public mailing lists, forums, and publically open version control systems.&lt;br /&gt;
&lt;br /&gt;
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 (??).&lt;br /&gt;
&lt;br /&gt;
If you create something new and have the ability to designate the license for it, please consider license compatibility issues.&lt;br /&gt;
&lt;br /&gt;
== Porting Strategy ==&lt;br /&gt;
&lt;br /&gt;
* Analysis and leverage of the existing build system&lt;br /&gt;
** buid/core/combo/arm-linux.mk&lt;br /&gt;
*** -D__ARCH_ARM_4__ -D__ARCH_ARM_4T__&lt;br /&gt;
*** -march=armv4t -mcpu=arm920t&lt;br /&gt;
** fix various static references to 'armv5'&lt;br /&gt;
* Isolating ARMv5TE ISA dependent code&lt;br /&gt;
** e.g. grep -n -R -i &amp;quot;${armv5te_isa_pattern}&amp;quot; ~/android&lt;br /&gt;
* Abstracting&lt;br /&gt;
** ( C/C++ ) Use inlined functions / #ifdef statments to implement functions in a portable manner&lt;br /&gt;
** ( ASM ) #ifdef statements ?&lt;br /&gt;
&lt;br /&gt;
For each ARMv5TE instruction, one could potentially&lt;br /&gt;
* Implement the instruction using general registers instead of DSP calls (i.e. eabi / softfloat)&lt;br /&gt;
* If that is a) nondeterministic, or b) slow, then sections of code need to be analyzed and hand-optimized for the ARMv4T isa&lt;br /&gt;
&lt;br /&gt;
== List of Unsupported Instructions ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
* the requirement of additional context&lt;br /&gt;
* the tendencies of certain opcodes to change condition registers that may or may not be present in the arm920t core&lt;br /&gt;
&lt;br /&gt;
=== Opcodes ===&lt;br /&gt;
&lt;br /&gt;
{{scroll box|height=150px|text=&lt;br /&gt;
* blx&lt;br /&gt;
* clz&lt;br /&gt;
* ldrd&lt;br /&gt;
* pld&lt;br /&gt;
* smla&lt;br /&gt;
** smlabb&lt;br /&gt;
** smlabt&lt;br /&gt;
** smlatt&lt;br /&gt;
* smlal&lt;br /&gt;
* smlaw&lt;br /&gt;
** smlawb&lt;br /&gt;
** smlawt&lt;br /&gt;
* smul&lt;br /&gt;
** smulbb&lt;br /&gt;
** smulbt&lt;br /&gt;
** smull&lt;br /&gt;
** smultt&lt;br /&gt;
* smulw&lt;br /&gt;
** smulwb&lt;br /&gt;
** smulwt&lt;br /&gt;
* qadd&lt;br /&gt;
* qdadd&lt;br /&gt;
* qsub&lt;br /&gt;
* qdsub&lt;br /&gt;
* strd&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
(Please keep the opcode list in alphabetical order)&lt;br /&gt;
&lt;br /&gt;
TODO: Turn the list into a table with short descriptions of the opcodes.&lt;br /&gt;
&lt;br /&gt;
=== Scanning for Files That Use the ARMv5TE ISA ===&lt;br /&gt;
&lt;br /&gt;
Using the above list of opcodes, one can scan the Android source code for ARMv4T-incompatible instruction sequences.&lt;br /&gt;
&lt;br /&gt;
'''Code:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
opcodes=&amp;quot;blx clz ldrd pld smlabb smlabt smlatt smlal smlawb smlawt smulbb smulbt smull smultt smulwb&lt;br /&gt;
  smulwt qadd qdadd qsub qdsub strd&amp;quot;;&lt;br /&gt;
opcodePat=$(echo ${opcodes} | sed -e s: :\\\|:g);&lt;br /&gt;
fileList=&amp;quot;$(grep -R -i &amp;quot;\(${opcodePat}\)&amp;quot; * 2&amp;gt;/dev/null | grep -v &amp;quot;^Binary file&amp;quot; |&lt;br /&gt;
  sed -e 's/:.*//' | sort -u)&amp;quot;;&lt;br /&gt;
fileList=&amp;quot;$(echo ${fileList} | grep -v &amp;quot;README\|^\(kernel/)\|\(\.txt\)$&amp;quot;)&amp;quot;;&lt;br /&gt;
for i in ${fileList}; do echo &amp;quot;* ${i}&amp;quot;; done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Source Files in Android that Use the ARMv5TE ISA ===&lt;br /&gt;
&lt;br /&gt;
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?).&lt;br /&gt;
&lt;br /&gt;
{{scroll box|height=150px|text=&lt;br /&gt;
* bionic/libc/arch-arm/bionic/memcmp.S&lt;br /&gt;
* bionic/libc/arch-arm/bionic/memcmp16.S&lt;br /&gt;
* bionic/libc/arch-arm/bionic/memcpy.S&lt;br /&gt;
* bionic/libc/arch-arm/bionic/strlen.c&lt;br /&gt;
* bionic/libc/kernel/arch-arm/asm/arch/irqs.h&lt;br /&gt;
* bionic/libc/tools/gensyscalls.py&lt;br /&gt;
* bootloader/legacy/nandwrite/init.S&lt;br /&gt;
* bootloader/legacy/usbloader/init.S&lt;br /&gt;
* dalvik/vm/arch/arm/CallEABI.S&lt;br /&gt;
* dalvik/vm/arch/arm/CallOldABI.S&lt;br /&gt;
* dalvik/vm/mterp/armv5/OP_AGET_WIDE.S&lt;br /&gt;
* dalvik/vm/mterp/armv5/OP_APUT_WIDE.S&lt;br /&gt;
* dalvik/vm/mterp/armv5/OP_IGET_WIDE.S&lt;br /&gt;
* dalvik/vm/mterp/armv5/OP_IGET_WIDE_QUICK.S&lt;br /&gt;
* dalvik/vm/mterp/armv5/OP_IPUT_WIDE.S&lt;br /&gt;
* dalvik/vm/mterp/armv5/OP_IPUT_WIDE_QUICK.S&lt;br /&gt;
* dalvik/vm/mterp/armv5/OP_SGET_WIDE.S&lt;br /&gt;
* dalvik/vm/mterp/armv5/OP_SPUT_WIDE.S&lt;br /&gt;
* dalvik/vm/mterp/out/InterpAsm-armv5.S&lt;br /&gt;
* dalvik/vm/oo/Object.h&lt;br /&gt;
* development/emulator/qtools/armdis.cpp&lt;br /&gt;
* development/emulator/qtools/thumbdis.cpp&lt;br /&gt;
* external/elfutils/src/Makefile&lt;br /&gt;
* external/elfutils/src/Makefile.am&lt;br /&gt;
* external/elfutils/src/Makefile.in&lt;br /&gt;
* external/freetype/include/freetype/config/ftconfig.h&lt;br /&gt;
* external/jpeg/jidctfst.S&lt;br /&gt;
* external/neven/Embedded/common/src/b_BasicEm/Math.c&lt;br /&gt;
* external/opencore/codecs_v2/audio/aac/dec/src/calc_sbr_synfilterbank.cpp&lt;br /&gt;
* external/opencore/codecs_v2/audio/aac/dec/src/fxp_mul32_arm_gcc.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/aac/dec/src/fxp_mul32_arm_v4.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/aac/dec/src/fxp_mul32_arm_v4_gcc.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/aac/dec/src/fxp_mul32_arm_v5.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/aac/dec/src/pv_normalize.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/aac/dec/src/trans4m_freq_2_time_fxp.cpp&lt;br /&gt;
* external/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op_arm_gcc_v5.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op_arm_v5.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_add.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_mac.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_msu.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_mult.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_sub.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mpy_32.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mpy_32_16.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mult.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/norm_l.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/normalize_amr_wb.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwbdecoder_basic_op_armv5.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwbdecoder_basic_op_gcc_armv5.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/mp3/dec/src/asm/pvmp3_dct_16_gcc.s&lt;br /&gt;
* external/opencore/codecs_v2/audio/mp3/dec/src/asm/pvmp3_dct_9.s&lt;br /&gt;
* external/opencore/codecs_v2/audio/mp3/dec/src/asm/pvmp3_dct_9_gcc.s&lt;br /&gt;
* external/opencore/codecs_v2/audio/mp3/dec/src/asm/pvmp3_mdct_18.asm&lt;br /&gt;
* external/opencore/codecs_v2/audio/mp3/dec/src/asm/pvmp3_mdct_18.s&lt;br /&gt;
* external/opencore/codecs_v2/audio/mp3/dec/src/asm/pvmp3_mdct_18_gcc.s&lt;br /&gt;
* external/opencore/codecs_v2/audio/mp3/dec/src/asm/pvmp3_polyphase_filter_window.asm&lt;br /&gt;
* external/opencore/codecs_v2/audio/mp3/dec/src/asm/pvmp3_polyphase_filter_window.s&lt;br /&gt;
* external/opencore/codecs_v2/audio/mp3/dec/src/asm/pvmp3_polyphase_filter_window_gcc.s&lt;br /&gt;
* external/opencore/codecs_v2/audio/mp3/dec/src/pv_mp3dec_fxd_op_arm.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/mp3/dec/src/pv_mp3dec_fxd_op_arm_gcc.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/mp3/dec/src/pvmp3_normalize.h&lt;br /&gt;
* external/opencore/codecs_v2/audio/sbc/enc/src/sbcenc_filter.h&lt;br /&gt;
* external/opencore/codecs_v2/video/avc_h264/dec/src/vlc.cpp&lt;br /&gt;
* external/opencore/codecs_v2/video/m4v_h263/enc/src/dct_inline.h&lt;br /&gt;
* external/opencore/codecs_v2/video/m4v_h263/enc/src/fastquant_inline.h&lt;br /&gt;
* external/opencore/codecs_v2/video/m4v_h263/enc/src/vlc_encode_inline.h&lt;br /&gt;
* external/opencore/fileformats/avi/parser/include/pv_avifile_streamlist.h&lt;br /&gt;
* external/opencore/fileformats/avi/parser/src/pv_avifile_streamlist.cpp&lt;br /&gt;
* external/openssl/crypto/bn/bn_prime.c&lt;br /&gt;
* external/qemu/target-arm/translate.c&lt;br /&gt;
* external/qemu/trace.c&lt;br /&gt;
* external/skia/include/corecg/SkFixed.h&lt;br /&gt;
* external/skia/include/corecg/SkMath.h&lt;br /&gt;
* external/skia/libcorecg/Sk64.cpp&lt;br /&gt;
* external/skia/libcorecg/SkMatrix.cpp&lt;br /&gt;
* external/skia/libsgl/effects/SkColorMatrixFilter.cpp&lt;br /&gt;
* external/skia/libsgl/sgl/SkBitmap.cpp&lt;br /&gt;
* external/skia/libsgl/sgl/SkBitmapShader.cpp&lt;br /&gt;
* external/skia/libsgl/sgl/SkGraphics.cpp&lt;br /&gt;
* external/srec/config/en.us/dictionary/c0.6.ok&lt;br /&gt;
* frameworks/base/libs/audioflinger/AudioMixer.cpp&lt;br /&gt;
* frameworks/base/libs/audioflinger/AudioResamplerSinc.cpp&lt;br /&gt;
* frameworks/base/opengl/libagl/iterators.S&lt;br /&gt;
* frameworks/base/opengl/libagl/matrix.h&lt;br /&gt;
* system/core/include/private/pixelflinger/ggl_fixed.h&lt;br /&gt;
* system/core/libpixelflinger/codeflinger/ARMAssembler.cpp&lt;br /&gt;
* system/core/libpixelflinger/codeflinger/ARMAssemblerInterface.cpp&lt;br /&gt;
* system/core/libpixelflinger/codeflinger/disassem.c&lt;br /&gt;
* system/core/libpixelflinger/codeflinger/texturing.cpp&lt;br /&gt;
* system/core/libpixelflinger/rotate90CW_4x4_16v6.S&lt;br /&gt;
* system/core/libpixelflinger/t32cb16blend.S&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Updates ==&lt;br /&gt;
&lt;br /&gt;
Feel free to post a link to any of your work in the list below&lt;br /&gt;
&lt;br /&gt;
* 20081021 [[User:Cfriedt]] Android -&amp;gt; FreeRunner updates on my [http://perpetual-notion.blogspot.com/search/label/android blog]&lt;br /&gt;
* 20081022 [[User:Cfriedt]] I was able to 'trivially' compile all of the Android source code without error for the ARMv4T architecture by removing v5TE instructions. Although it will definitely not run anything predictably, at least now that I know the build system will work with a few simple substitutions in build/core/combo/arm-linux.mk. At this point I am able to go ahead and re-implement v5TE instructions as v4T instruction sequences instead (or re-implement entire sections of assembly with hand-optimized v4T instructions).&lt;br /&gt;
* 20081023 [[User:Bricode]] 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&lt;br /&gt;
&lt;br /&gt;
= Important Links =&lt;br /&gt;
(Please Update Me)&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://source.android.com/documentation Android Documentation]&lt;br /&gt;
* [http://www.arm.com/documentation/ ARM Documentation], (keywords: armv4t, armv5t, armv5te, arm920t, arm926ej-s)&lt;br /&gt;
== Instruction Set References ==&lt;br /&gt;
* [http://infocenter.arm.com/help/topic/com.arm.doc.dvi0025b/DVI0025.pdf ARMv4T] (See section 1.4.13)&lt;br /&gt;
* [http://infocenter.arm.com/help/topic/com.arm.doc.dvi0014a/DVI0014A_ARM10T_PO.pdf ARMv5T] (See section 4.16)&lt;br /&gt;
* [http://www.arm.com/pdfs/ARM-DSP.pdf ARM DSP Enhanced Instruction Set]&lt;br /&gt;
&lt;br /&gt;
== Hardware Reference ==&lt;br /&gt;
&lt;br /&gt;
* [[Neo1973 Hardware]]&lt;br /&gt;
* [[Neo FreeRunner GTA02 Hardware]]&lt;br /&gt;
&lt;br /&gt;
== Communities ==&lt;br /&gt;
* [http://source.android.com/discuss Android Public Mailing Lists]&lt;br /&gt;
* [http://forum.koolu.org/viewforum.php?f=10 Android on FreeRunner] at KoolU.com&lt;br /&gt;
* [[Openmoko Local Groups]]&lt;br /&gt;
* [[Openmoko:Community_Portal]]&lt;br /&gt;
&lt;br /&gt;
= See also =&lt;br /&gt;
&lt;br /&gt;
* [[Debug_Board]]&lt;br /&gt;
&lt;br /&gt;
= External Links =&lt;br /&gt;
&lt;br /&gt;
[[Category:Distributions]]&lt;/div&gt;</summary>
		<author><name>Bricode</name></author>	</entry>

	</feed>