OpenMoko Freerunner

38 views
Skip to first unread message

ArteQ

unread,
Oct 22, 2008, 3:13:27 AM10/22/08
to android-porting
Maybe anyone working on compiling Android for the Openmoko Freerunner
GTA02 ?

Christopher Friedt

unread,
Oct 22, 2008, 10:23:51 AM10/22/08
to android-porting
I'm working on it.

http://perpetual-notion.blogspot.com/search/label/android

The code is pretty well written, so it shouldn't be too hard to port
to a different ARM ISA.

I've compiled it 'trivially' already for ARMv4T - that is, by simply
removing all instructions a part of the v5 extension.

With a list of v5 instructions, one can grep through the source tree
and uniquely sort individual files that use the ARMv5 extension. What
we have, at this point, is a list of unsupported instructions (all of
ARMv5TE), and a list of files that need to be patched.

My general strategy for bridging the code from ARMv5TE to ARMv4T is
to

1) [ Individual Instruction Translation ] effectively translate the v5
instruction using a sequence of v4 instructions, if possible, while
still being time efficient (not necessarily possible)
2) [ Routine Re-implementation ] if the above isn't possible, find the
context where the v5 instruction is used and then replace it with an
optimized v4 ISA routine. For something like memcmp.S, this is
relatively easy.

However, many userspace libraries have v5 instructions encoded pretty
heavily. In many cases, the hardware dependent portion of is
abstracted out using an inline function - this is a good thing.
Hopefully the code will not get too complex if we just use #ifdef
statements everywhere to differentiate between compiling for ARMv4 or
v5.

Incidentally, does anyone know which symbols are defined for the
target arch? __ARM_ARCH_5__, __ARM_ARCH_5T__, __ARM_ARCH_5TE__ ? I
think I've also even seen others... it could get messy. I'm also not
100% sure how the build system differentiates targets and devices ...
Any ideas? So far, I've just adjusted build/core/combo/linux-arm.mk
and changed GLOBAL_CFLAGS to

$(combo_target)GLOBAL_CFLAGS += \
-march=armv4t -mtune=arm920t \
-msoft-float -fpic \
-mthumb-interwork \
-ffunction-sections \
-funwind-tables \
-fstack-protector \
-D__ARM_ARCH_4__ -D__ARM_ARCH_4T__ \
-include $(call select-android-config-h,linux-arm)

Although, in hindsight, it would be wiser to store the armv5te /
armv4t global cflag lines in variables, and then just select between
the two. In any case, it builds using this method, after removing all
v5E instructions.


Chris

Ben Leslie

unread,
Oct 22, 2008, 10:48:34 AM10/22/08
to android...@googlegroups.com
Hi,

I'm looking at porting to the Neo 1973 at the moment (don't have a
freerunner yet).

Cheers,

Benno

Jim Ancona

unread,
Oct 22, 2008, 7:36:04 AM10/22/08
to android-porting
On Oct 22, 3:13 am, ArteQ <art...@gmail.com> wrote:
> Maybe anyone working on compiling Android for the Openmoko Freerunner
> GTA02 ?

It sounds like a port is pretty far along. See this thread on the
openmoko-kernel list:

http://lists.openmoko.org/pipermail/openmoko-kernel/2008-October/005966.html

Also, Koolu, a Freerunner distributor in Canada, claims they will have
a beta Android port available in November:

http://koolu.com/

So I hoping we don't have long to wait!

Jim

Jim Ancona

unread,
Oct 22, 2008, 12:53:28 PM10/22/08
to android-porting
On Oct 22, 7:36 am, Jim Ancona <scarh...@gmail.com> wrote:
> Also, Koolu, a Freerunner distributor in Canada, claims they will have
> a beta Android port available in November:
>
> http://koolu.com/

Koolu now has kernel patches available at http://forum.koolu.org/

Christopher Friedt

unread,
Oct 22, 2008, 1:59:21 PM10/22/08
to android...@googlegroups.com
Hmm... site requires registration... well... ok!

Christopher Friedt

unread,
Oct 22, 2008, 3:12:23 PM10/22/08
to android...@googlegroups.com
I've put up an Android page on the OpenMoko Wiki.

http://wiki.openmoko.org/wiki/Android

Please make any changes / corrections that you see fit / necessary.

Jim Ancona

unread,
Oct 22, 2008, 4:50:36 PM10/22/08
to android-porting, j...@anconafamily.com
On Oct 22, 3:12 pm, "Christopher Friedt" <chrisfri...@gmail.com>
wrote:
> I've put up an Android page on the OpenMoko Wiki.
>
> http://wiki.openmoko.org/wiki/Android
>
> Please make any changes / corrections that you see fit / necessary.

Nice page! I've been able to do a vanilla Android build on my system.
I've got decent Java and C skills, but haven't done assembler in a
looong time. If there's any way I can help you out, please let me
know.

Jim

>
> On Wed, Oct 22, 2008 at 1:59 PM, Christopher Friedt
>
> <chrisfri...@gmail.com> wrote:
> > Hmm... site requires registration... well... ok!
>

bricode

unread,
Oct 22, 2008, 6:04:29 PM10/22/08
to android-porting
I have started to push changes to Google for compiling Android for the
Freerunner. Hopefully the changes will be reviewed and accepted
shortly. We shall see. The first change set is for Bionic, the Android
implementation of libc.

Secondly, as someone has mentioned, I've posted a kernel (including
modules) with the Android patches based on the Openmoko kernel git.
They can be found at http://forum.koolu.org. Also included in the
forums is a set of per-file patches that Android requires against a
vanilla 2.6.24 kernel.

In addition, I am in the process of requesting a branch on the
git.openmoko.org repository so that there can be a patched kernel
available that tracks the Openmoko stable branch.

My initial look at dalvik was that there wasn't any code that was
ARMv5 specific, and have added changes to that as well, but need to
review them prior to submitting them to Google. If someone has seen
different, please let me know.

Regards,
Brian

shaice

unread,
Oct 23, 2008, 1:19:26 PM10/23/08
to android-porting
Dear all,
sorry to bother you with (probably) silly questions but..
I own a HTC trinity that use the same ARM920T processor of Freerunner.
I saw benno's and christopher's posts on their blogs...
Is there any chance that your binaries will run on other ARM920T
phones?

Thank you in advance for any answer.

Best regards,

s

Christopher Friedt

unread,
Oct 23, 2008, 2:57:22 PM10/23/08
to android...@googlegroups.com
Hi Shaice,

On Thu, Oct 23, 2008 at 1:19 PM, shaice <sha...@gmail.com> > Is there


any chance that your binaries will run on other ARM920T
> phones?

In short, no (for now...)

Chris

Christopher Friedt

unread,
Oct 23, 2008, 3:35:48 PM10/23/08
to android-porting
Hi Jim,

Thanks for the input :)

I've recently made a list of files on the wiki that should require
some investigation for porting to ARMv4T.

http://wiki.openmoko.org/wiki/Android#Source_Files_in_Android_that_Use_the_ARMv5TE_ISA

Cheers,

Chris

androidcn.org

unread,
Oct 23, 2008, 11:18:12 PM10/23/08
to android-porting
I have patched the source with your patch,and make was successfully
done, therefore I got the system.img userdata.img and ramdisk.img.
However the emulator sitted on the single ANDROID... screen when I use
these imgs.
I am confused with thsi...

Ben Leslie

unread,
Oct 23, 2008, 11:26:54 PM10/23/08
to android...@googlegroups.com
Hi,

Please note! This is an experimental patch that only _got things
compiling_, I never said it would work! And in fact it doesn't even go
close :).

There are a number of reasons for this, which I will share shortly.

Reply all
Reply to author
Forward
0 new messages