What's new? | Help | Directory | Sign in
Google
                
Search
for
Updated Jun 06, 2008 by Georges.Toth
Labels: Phase-Deploy
Home  

Last Updated: Tuesday, May 08, 2008

Introduction


This page collects information for running Android on the Nokia n800/n810. You can find a lot more information on running Android on real hardware on http://elinux.org/Android_on_OMAP. Much of the information from this site was obtained from there. I've setup this project due to popular demand and the elinux.org server currently having trouble coping with the traffic :-). If you have any issues following these directions, please email Jonathan Herriott, so the issues can be corrected.

If you are having any issues, please see the following group http://groups.google.lu/group/android-internals/Android-Internals for the patches until mine are uploaded.

Status


What's the status of this project? Well, Android works on the n810. Currently, the m5-rc14 kernel is used with the m3-rc37a userspace because of frame buffer problems with the newest userspace.

The following items currently do not work:

In case you're wondering what then does work :-):

Checkout some screenshots of Android running on a Nokia n810.

Installation


If you have no unix knowledge, the instructions might be a little hairy. My suggestion is to just download the linked debian netinstall image linked below and install that on a machine. You should also make sure to install binutils from the package manager or at installation time.

Getting Started

Here are just a list of things that need to have in order to build and install Android on the N8XX. These will also be included in the step-by-step process, but it might be quicker just to download them all ahead of time.

The Kernel

It is assumed that for each step, you start out in the same directory ($ANDDIR).

  1. Get the latest vanilla 2.6.21 kernel (http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.21.tar.bz2).
  2. > wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.21.tar.bz2
    > tar -xjvf linux-2.6.21.tar.bz2
  3. Download & apply the appropriate patch from the download section.
  4. > wget http://android-on-n8xx.googlecode.com/files/linux-2.6.21_rx-34_android-m5-rc14-patch3.bz2
    > cd linux-2.6.21
    > bzcat ../linux-2.6.21_rx-34_android-m5-rc14-patch3.bz2 | patch -p1
  5. Download the mentioned cross compiler
  6. > wget http://www.codesourcery.com/public/gnu_toolchain/arm-none-linux-gnueabi/arm-2008q1-126-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
    > tar -xjvf arm-2008q1-126-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
  7. Compile the kernel
  8. > cd linux-2.6.21
    > make ARCH=arm CROSS_COMPILE=../arm-2008q1/bin/arm-none-linux-gnueabi- bzImage
    >
  9. Download flasher from http://tablets-dev.nokia.com/d3.php
  10. > cp flasher-3.0 $ANDDIR
  11. Install the kernel
    1. Power off the N8XX
    2. Connect the N8XX to your computer via USB
    3. Send the kernel to the N8XX
    4. > sudo ./flasher-3.0 -f -k linux-2.6.21/arch/arm/boot/zImage -R # this replaces the kernel on the device
    As an alternative, you can simply load the kernel to the memory instead of flashing it, so if something goes wrong you just need to reboot it in order to revert it to the previous kernel.
    > sudo ./flasher-3.0 -l -k linux-2.6.21/arch/arm/boot/zImage -R # this only loads the kernel to the memory and boots it
  1. Power on the N8XX and the kernel will be replaced

File System

This section assumes you start in the same directory as The Kernel section.

  1. Download busybox from http://benno.id.au/blog/2007/11/14/android-busybox
  1. Create a SD card image
  2. > android-sdk_m3-rc37a/tools/mksdcard -l card 100M card.img
  3. Start the emulator
  4. > android-sdk_m3-rc37a/tools/emulator -sdcard card.img -console -debug-kernel
  5. Wait until the emulator is fully loaded, then add busybox to the emulator
  6. > adb -d 1 push busybox /data/busybox
  7. Inside the emulator shell, extract /system to the sdcard image
  8. > chmod 774 /data/busybox
    > ln -s /sbin/tar /data/busybox
    > cd sdcard
    > tar -cvf /system -C /sdcard
  9. Close the emulator window (not the shell).
  10. Format the MicroSD card
    1. Insert the MicroSD card into the N8XX
    2. Connect the N8XX to your computer via USB
    3. Flash the MicroSD card
    4. > df | grep /media/usbdisk-1  # do this to obtain what the usb device name, which
                                   # may vary depending on the linux installation
                                   # I will call mine /dev/sdc1
      > su
      > umount /dev/sdc1
      > mkfs.ext2 /dev/sdc1
      > mount /dev/sdc1 /media/usbdisk-1
      > exit
  11. Extract the userspace
  12. > cp android-sdk_m3-rc37a/tools/lib/images/ramdisk.img ramdisk.gz
    > gunzip ramdisk.gz
    > cd /media/usbdisk-1
    > cpio -iv < $ANDDIR/ramdisk
    > mkdir dev/log
    > touch dev/log/main
    > touch dev/log/events
    > touch dev/log/radio
  13. Extract system.tar from the sdcard image
  14. > su
    > mkdir card
    > mount -o loop card.img card
    > tar -xvf card/system.tar -C /media/usbdisk-1
  15. Apply the file system patch (will be available shortly)
  16. > cd /media/usbdisk-1
    > cat $ANDDIR/userspace_android-m3-rc37a_N8XX.bz2 | patch -p1
  17. Unmount the volumes on your PC provided by the N8XX
  18. Disconnect the N8XX from your PC

The Device

I haven't tested the init way, so I am providing the scripts necessary with the way I did it modified from http://elinux.org/Android_on_OMAP

  1. Navigate the N8XX to http://maemo.org/downloads/product/raw/OS2008/openssh/?get_installfile and follow the installation instructions to install an OpenSSH server.
  2. SSH to the N8XX
  3. Add the start script (Assuming the MicroSD card is mounted at /media/mmc1)
  4. > cd /
    > vi start_android.sh
    
    #!/bin/sh -x
    echo "Starting Android..."
    rm -rf /media/mmc1/tmp/*
    umount -l /proc
    umount -l /sys
    mount -t proc proc /media/mmc1/proc
    mount -t sysfs sysfs /media/mmc1/sys
    mount --bind /dev /media/mmc1/dev
    chmod -R 777 /media/mmc1 # if you know the exact permissions, email me
    umask 000
    chroot /media/mmc1 /a.sh
  5. Create the a.sh script
  6. > cd /media/mmc1
    > vi a.sh
    
    #!/system/bin/sh -x
    export PATH=/sbin:/system/sbin:/system/bin:$PATH
    export LD_LIBRARY_PATH=/system/lib
    export ANDROID_ROOT=/system
    export ANDROID_ASSETS=/system/app
    export ANDROID_DATA=/data
    export EXTERNAL_STORAGE=/sdcard
    export DRM_CONTENT=/data/drm/content
    
    /system/bin/app_process -Xzygote /system/bin --zygote &
    /system/bin/dbus-daemon --system &
    runtime &
    /system/bin/sh
  7. Start Android
  8. > chmod 777 start_android.sh
    > chmod 777 /media/mmc1/a.sh
    > /start_android.sh
  9. Enjoy :-)

Running Your Application

This section will be available shortly. Yes, it's possible.

Links


  • group featuring many discussions about running Android on real hardware
  • http://elinux.org/Android_on_OMAP instructions for extracting the android patches, file system, configuration, etc. Also where much of the information on this page came from.

Contributors


Page originally created by: Georges Toth Email: Georges.Toth AT gmail DOT com

Page modified and restructured by: Jonathan Herriott Email: herriojr AT gmail DOT com

And here will be a list of all the people who patched to make this possible :)


Comment by herriojr, Apr 18, 2008

can you install your own apps?

Comment by herriojr, Apr 18, 2008

Where can I get the latest Nokia (already patched) kernel?

Comment by herriojr, Apr 21, 2008

Just a note for those that are looking, the kernel source I was asking about I found at: http://repository.maemo.org/pool/os2008/free/source/k/kernel-source-rx-34/

The only issue is that the patch doesn't seem to match. Is there another source the above was referring to?

Comment by Georges.Toth, Apr 21, 2008

The kernel you mentioned should work... if it does not just download a vanilla 2.6.21 kernel and patch it with the other patch on the download page.

I haven't tried installing apps on the device yet but that should just work I guess :-)

Comment by suruti94, Apr 22, 2008

Can you elaborate on what you mean by "alarm code" does not work ? I have the android alarm driver compile, which calls into rtc code to setup the interrrupts. I have not tested to see what happens. Perhaps, it does not work

Also, ApiDemos? turned out to be empty when i selected. Were you able to run ApiDemos? ?

Comment by Georges.Toth, Apr 22, 2008

The alarm code does compile, but IIRC it does not work, because anything RTC related does not work in Android. That is due to the n8xx not using a standard rtc driver, and there is no rtc device node/interface in /dev.

API Demos works for me.... what I'm struggling with though is how to install apps....that turns out to not be as easy as copying your files to the app folder (at least that does not work for me) :-(

Comment by suruti94, Apr 23, 2008

Hmm.. cat /proc/devices does show me rtc.

Do you have to do anything special to get APIDemos to work ? If i invoke that, Android hangs. I do see that ApiDemos?.apk is installed.

Comment by suruti94, Apr 23, 2008

I tried a little more with applications. 1) When i select "Applications" from main Menu it takes me to a new screen. I can invoke most of the applications except APIDemos. If i invoke APIDemos, it hangs and i need a reboot 2) I tried adding another application Snakes.apk to the same directory. This time, If i select Applications from Main menu, system hangs. Anything from /data/app seems to hang.

Comment by suruti94, Apr 23, 2008

Another small update. I could install snakes.apk and then run it and play it. It was slow :-) For this to work, i have to remove ApiDemos?.apk from /data/app and then only have Snakes.apk. Selecting the app just played fine. Any clues..

Comment by herriojr, Apr 24, 2008

Just out of curiosity, have you tried doing a diff of the running emulator with your application installed with the running android file system on N8XX? Maybe this will point out some clues? I haven't gotten the file system installed correctly yet, so I'll test once I do.

Comment by nan.yeah, Apr 28, 2008

Hi Georges.Toth,

I can install my application on the device, just copy the .apk file into directory /data/app.:) But I can not launch any application from Graphic user interfaces. It hangs on when I enter the "Applications". I have another way to launch your application from console, with command "am"(Maybe that is the abbreviation for application manager): am start -n <package name>/<activity name> for example: am start -n com.google.android/com.google.android.HelloWorld?

I can launch all my applications from this way.:)

Comment by herriojr, Apr 28, 2008

Hey Georges, can you give me admin privilage, so I can edit this page?

Comment by chad78, Apr 29, 2008

I'm a total n00b. What is compiling? Do I have to do that? Can't I just download something to install?

Comment by suruti94, Apr 30, 2008

I do have some bits that i can share (obviously at your own risk :-)) if Geroges opens up this place. I have both a working kernel image and userspace files. Let me know if that would be of interest.

Comment by Georges.Toth, Apr 30, 2008

Hey nan.yeah, great, I'll give that a try thnx

@suruti94: I tried replacing already installed apps my mine, but it wouldn't show up, no matter where I put my file. ... I'll give it another try soon ... you should be able to upload files aren't you ? .. let me know if not

I'm not sure though if it's ok to share the userspace images... AFAIK that is not allowed by google. Uploading a kernel image should be fine though, as the patches are also available.

Anyway, if one follows the many guides available, putting together the system+data dir should be really easy even for a novice...well you should be used to a unix shell though ;-) In case that all sounds like "!#++4!"$"!!§%$§" this project is not for you, and you should wait for clean easy to flash images :-) ....sorry

Comment by herriojr, Apr 30, 2008

The patches provided will not work properly. drivers/android/power.c does not contain all the proper functions for sysfs mounted on /sys. The only one I know of that is missing so far is last_user_activity.

Comment by Georges.Toth, May 01, 2008

There are things missing, sure....like the entry you mentioned. But the patch does work. Should you fix the power driver, please feel free to contribute it, but that doesn't prevent android from running on the n810, and it's at least for me very low-priority.

The framebuffer issue is far more important for now. Also getting the omap git tree to work (which apparently contains everything but the wifi stuff (proprietary)) would be great.... we'll see :-)

Comment by herriojr, May 02, 2008

The issue is that I am getting a fatal error when trying to start up android because it is trying to access the file I specified above.

Comment by suruti94, May 07, 2008

Hi Nan,

Have you tried starting APiDemos using the am command ? It hangs for me. As i had already mentioned, i can start some apps like Snake etc directly by using the UI. I thought ApiDemos? would work from command line. It fails.

-mohan

Comment by herriojr, May 08, 2008

If there is any interest, I'll write a script to do everything for you (minus downloading openssh onto the device).

Comment by blazej.pawlak, May 14, 2008

Where is the path for rx-44 version of the N810? I couldn't find it in the downloads section. Thanks!

Comment by Georges.Toth, May 14, 2008

RX-44 is a hardware revision => n810

A quote from a forum: The N800 and N810 share the same kernel, so the kernel-source-rx-34- is the correct package. There never was a specific rx-44 kernel package.

Comment by herriojr, May 14, 2008

I'll take that portion out. I was just trying to figure out why the difference between some peoples' N8XX and others. The only moving part was the hardware.

Comment by T.Thiessens, May 15, 2008

laptop:~/projecten/android-nokia/linux-2.6.21$ make ARCH=arm CROSS_COMPILE=../arm-2008q1/bin/arm-none-linux-gnueabi- bzImage

HOSTCC scripts/basic/fixdep HOSTCC scripts/basic/docproc HOSTCC scripts/kconfig/conf.o HOSTCC scripts/kconfig/kxgettext.o HOSTCC scripts/kconfig/zconf.tab.o HOSTLD scripts/kconfig/conf
scripts/kconfig/conf -s arch/arm/Kconfig
CHK include/linux/version.h SYMLINK include/asm-arm/arch -> include/asm-arm/arch-omap Generating include/asm-arm/mach-types.h CHK include/linux/utsrelease.h CC arch/arm/kernel/asm-offsets.s
In file included from include/asm/system.h:6,
from include/asm/bitops.h:23, from include/linux/bitops.h:9, from include/linux/thread_info.h:20, from include/linux/preempt.h:9, from include/linux/spinlock.h:49, from include/linux/capability.h:45, from include/linux/sched.h:46, from arch/arm/kernel/asm-offsets.c:13:
include/asm/memory.h:27:29: error: asm/arch/memory.h: No such file or directory In file included from include/asm/system.h:6,
from include/asm/bitops.h:23, from include/linux/bitops.h:9, from include/linux/thread_info.h:20, from include/linux/preempt.h:9, from include/linux/spinlock.h:49, from include/linux/capability.h:45, from include/linux/sched.h:46, from arch/arm/kernel/asm-offsets.c:13:
include/asm/memory.h: In function 'virt_to_phys': include/asm/memory.h:170: error: 'PHYS_OFFSET' undeclared (first use in this function) include/asm/memory.h:170: error: (Each undeclared identifier is reported only once include/asm/memory.h:170: error: for each function it appears in.) include/asm/memory.h: In function 'phys_to_virt': include/asm/memory.h:175: error: 'PHYS_OFFSET' undeclared (first use in this function) include/asm/memory.h: In function 'virt_to_bus': include/asm/memory.h:193: warning: implicit declaration of function 'virt_to_bus' include/asm/memory.h: In function 'bus_to_virt': include/asm/memory.h:198: warning: implicit declaration of function 'bus_to_virt' In file included from include/linux/timex.h:187,
from include/linux/sched.h:50, from arch/arm/kernel/asm-offsets.c:13:
include/asm/timex.h:15:28: error: asm/arch/timex.h: No such file or directory In file included from include/linux/sched.h:51,
from arch/arm/kernel/asm-offsets.c:13:
include/linux/jiffies.h:225:31: warning: "CLOCK_TICK_RATE" is not defined include/linux/jiffies.h:225:31: warning: "CLOCK_TICK_RATE" is not defined include/linux/jiffies.h:225:31: error: division by zero in #if include/linux/jiffies.h:225:31: warning: "CLOCK_TICK_RATE" is not defined include/linux/jiffies.h:225:31: warning: "CLOCK_TICK_RATE" is not defined include/linux/jiffies.h:225:31: error: division by zero in #if include/linux/jiffies.h:225:31: warning: "CLOCK_TICK_RATE" is not defined include/linux/jiffies.h:225:31: warning: "CLOCK_TICK_RATE" is not defined include/linux/jiffies.h:225:31: error: division by zero in #if include/linux/jiffies.h:225:31: error: division by zero in #if include/linux/jiffies.h:225:31: warning: "CLOCK_TICK_RATE" is not defined include/linux/jiffies.h:225:31: warning: "CLOCK_TICK_RATE" is not defined include/linux/jiffies.h:225:31: error: division by zero in #if include/linux/jiffies.h:225:31: warning: "CLOCK_TICK_RATE" is not defined include/linux/jiffies.h:225:31: warning: "CLOCK_TICK_RATE" is not defined include/linux/jiffies.h:225:31: error: division by zero in #if include/linux/jiffies.h:225:31: warning: "CLOCK_TICK_RATE" is not defined include/linux/jiffies.h:225:31: warning: "CLOCK_TICK_RATE" is not defined include/linux/jiffies.h:225:31: error: division by zero in #if include/linux/jiffies.h:225:31: error: division by zero in #if include/linux/jiffies.h:225:31: warning: "CLOCK_TICK_RATE" is not defined include/linux/jiffies.h:225:31: warning: "CLOCK_TICK_RATE" is not defined include/linux/jiffies.h:225:31: error: division by zero in #if include/linux/jiffies.h:225:31: warning: "CLOCK_TICK_RATE" is not defined include/linux/jiffies.h:225:31: warning: "CLOCK_TICK_RATE" is not defined include/linux/jiffies.h:225:31: error: division by zero in #if include/linux/jiffies.h:225:31: warning: "CLOCK_TICK_RATE" is not defined include/linux/jiffies.h:225:31: warning: "CLOCK_TICK_RATE" is not defined include/linux/jiffies.h:225:31: error: division by zero in #if include/linux/jiffies.h:225:31: warning: "CLOCK_TICK_RATE" is not defined include/linux/jiffies.h:225:31: warning: "CLOCK_TICK_RATE" is not defined include/linux/jiffies.h:225:31: error: division by zero in #if include/linux/jiffies.h:225:31: warning: "CLOCK_TICK_RATE" is not defined include/linux/jiffies.h:225:31: warning: "CLOCK_TICK_RATE" is not defined include/linux/jiffies.h:225:31: error: division by zero in #if include/linux/jiffies.h:225:31: warning: "CLOCK_TICK_RATE" is not defined include/linux/jiffies.h:225:31: warning: "CLOCK_TICK_RATE" is not defined include/linux/jiffies.h:225:31: error: division by zero in #if include/linux/jiffies.h:225:31: error: division by zero in #if In file included from include/linux/mm.h:40,
from arch/arm/kernel/asm-offsets.c:14:
include/asm/pgtable.h:23:30: error: asm/arch/vmalloc.h: No such file or directory In file included from include/linux/mm.h:40,
from arch/arm/kernel/asm-offsets.c:14:
include/asm/pgtable.h: In function 'pmd_page_vaddr': include/asm/pgtable.h:330: error: 'PHYS_OFFSET' undeclared (first use in this function) In file included from arch/arm/kernel/asm-offsets.c:14: include/linux/mm.h: In function 'lowmem_page_address': include/linux/mm.h:538: error: 'PHYS_OFFSET' undeclared (first use in this function)

Do I have te correct patch?

Comment by sittiphol, May 15, 2008

Hi,

Now I just succeeded on making touch screen work perfectly both in Maemo and Android. Please check this video. http://www.youtube.com/watch?v=ma5VdDx_0K4

I wanna post more detail about technique I used but... where can I post? Please tell me and I will post it as soon as possible.

Best Regards, Sittiphol Phanvilai

Comment by bradley.stock, May 15, 2008

Might as well post it here, I'd love to have the touchscreen working in Maemo!

Comment by nightkeen, May 20, 2008

... 5. Inside the emulator shell, extract /system to the sdcard image ...

> ln -s /sbin/tar /data/busybox link failed File exists

What's wrong?

Comment by bradley.stock, May 20, 2008

nightkeen:

do it the other way around.

'ln -s /data/busybox /sbin/tar'

Comment by nightkeen, May 21, 2008

Thanks Bradley. But i have another problem. Next step:

> cd sdcard

> tar -cvf /system -C /sdcard

tar: permission denied

Permissions on /sbin/tar - 777. Am I doing something wrong?

And another question, in which file system i must format my SD card? Ext3?

Comment by sittiphol, May 22, 2008

try this

# tar -cvf system.tar -C /sdcard /system

Regards, Sittiphol

Comment by arjan.schaaf, May 28, 2008

I followed the instructions for the kernel compilation. After flashing the kernel my n810 won't boot. Flashing seemed successful but at boot the Nokia logo becomes visible, but after a while it blimps and starts again and again and... Any ideas what might went wrong?

Comment by blazej.pawlak, May 28, 2008

Same here, probably kernel panic... too bad I cannot see what actually caused it. Or when it happened. After reflashing it with Nokia's firmware it seems to work again, but logs are of course lost. Any ideas? Hardware n810.

Comment by blazej.pawlak, May 29, 2008

Hmm, strange. The whole thing worked when applying only the linux-2.6.21_rx-34_android-m5-rc14.bz2 patch. After I tired applying the "touchscreen" patch, compiled the kernel and flashed the n810 the device could not start properly, rebooting itself when the boot progress bar reaches about 70%. Any clues?

Comment by a...@delandgraaf.com, May 30, 2008

As many of you I had quite a few problems following the tutorial above. I've placed a rewritten/fixed version on my blog, together with binaries for userspace and a pre-compiled kernel image and details how to use them on your nokia 810:

http://www.alextreme.org/drupal/?q=android_on_n810

I urge the writer of this tutorial to at least skim my version, as the current tutorial will easily give you a non-booting n810.

Comment by daniel.vidonyi, Jun 02, 2008

Alextreme,

The steps are missing from your instructions. Any idea when you going to complete?

Comment by leemgs, Jun 18, 2008

Currently, Anyone ported with m5 rootfs without m3 rootfs successfully ?

Comment by kangwei1...@163.com, Jun 19, 2008

i have a problem: >tar -cvf /system -C /sdcard

tar:empty archive

who knows what is the matter? i need help!!!

Comment by ASSixNil, Jun 22, 2008

i got two problem: there is no system.tar in /sdcard, and i use this command "android-sdk_m3-rc37a/tools/adb -d 1 push system.tar /sdcard" to push the system.tar to /sdcard. is it something wrong? and i typed "tar -cvf system.tar /system",got:"tar: permission denied".

Comment by mr.baldwin, Jun 30, 2008

The binary on alextreme.org doesn't work on my N810. Could it be because I am running Maemo Diablo 4.1? Has anyone managed to get this working after upgrading to 4.1?

Comment by trippin1, Jul 01, 2008

I have, but that's because I ported the patch. I'm messing around with this on an N800, I'll start releasing my stuff when I'm done.

-qwerty12 (catch me on #maemo or Itt)

Comment by kimitake, Jul 02, 2008

I just succeeded to boot m3-rc37a on N810 with diablo based kernel. I'll also release the patch when I'm done :)

Comment by seedyburner, Sep 30, 2008

Any easy install on this yet?


Sign in to add a comment