NITdroid video demo : GNU/Linux Android on Nokia 770
A cheap DIY android platform, available worldwide and beyond.

As every year, this year will be the year of GNU/Linux mobile and now more than ever before.

Would you expect that NewLC would miss this ? no way !

The G1 phone is out, but who needs to wait for its worldwide availability when you
can get your own android plateform for 200 EUR or less ($50 on ebay) ?

As recently reported, previously on NewLC :

http://www.newlc.com/en/run-google-android-a-n810-internet-tablet

GNU/Linux Android was ported to Nokia tablets,
since 100% of the Software is open-source and provided under Apache Licence.

The offspring is called "NITdroid"
(you guessed where the name came from : Android on Nokia Internet Tablet)

The project was quite active this past year
It resulted that It's easy to flash an Android firmware on Nokia tablets.

This is impressive how such a litle community of developers could produce a
replacement firmware for this kind of product, but this was pretty logical
since Nokia set up Maemo (a GNU/Linux Debian Based OS for Tablets
lead by nokia along an open community),
there are no excuses not to benefit the previous fantastic work.

Enough talk, now let's go to practice.

Assuming you're familiar with GNU/Linux, that you have a Nokia Internet Tablet (n700 and later)
and a MMC Memory card (256MB or more)

Unless you installed ssh or another way to access the shell,
you'll need to have a running version of maemo.

FLASHING THE OS

So here is the procedure to flash
the "HACKER" version of the firmware
(understand as unmaintained)

You can skip this part, but it may be useful if you want to restore the
manufacturer's OS later.

Download SU-18_2008HACKER_4.2007.50-6_PR_F5_MR0_ARM.bin from

http://tablets-dev.nokia.com

  sudo flasher -F SU-18_*_PR_F5_MR0_ARM.bin -f && sudo flasher  -f -R
  flasher v0.8.7 (Oct 17 2006)
  SW version in image: SU-18_2006SE_3.2006.49-2_PR_MR0
  ...
  Suitable USB device not found, waiting

Then plug the power supply cable, and the flasher resumes :

  USB device found found at bus 001, device address 018
  Found device SU-18, hardware revision 1802
  ...
  Sending and flashing rootfs image (58368 kB)...
  100% (58368 of 58368 kB, avg. 784 kB/s)
  Finishing flashing... done

Reboot again, to place your MMC card in the tray.
Check your extra card is visible, then partition and format it (Applications / Utilities / Terminal )

Or host's side, since your nokia is seen as an "usb mass storage" device (/dev/sdx)
Mine is sda but it may change depending on your disks :

  dmesg | grep sd | grep 'Attached SCSI disk'
  sd 4:0:0:0: [sda] Attached SCSI disk

  sudo fdisk -l /dev/sda
  GNU Fdisk 1.1
  ...
  Disk /dev/sda: 519 MB, 519569408 bytes
  32 heads, 32 sectors/track, 991 cylinders
  Units = cylinders of 1024 * 512 = 524288 bytes
   Device Boot      Start         End      Blocks   Id  System
  /dev/sda1               1         488      249840    e  FAT16 LBA
  /dev/sda2             489         747      132096   82  Linux swap
  /dev/sda3             748         991      124416   83  Linux

You can create partitions as you want (using cfdisk or gparted) as long as :
* 1st partition is set to FAT16
* 2d one to swap
* 3d one to EXT3

Then format them :

  mkfs.ext3 /dev/sda3
  mkswap /dev/sda2
  mkfs.msdos /dev/sda1

Copy the filesystem (rootfs in linux slang) :

wget -c http://guug.org/nit/nitdroid/rootfs-nitdroid-0.3.2.tar.bz2
mkdir -p tmp && cd tmp && tar xfvj ../rootfs-nitdroid-0.3.2.tar.bz2
part=sda3 ;  sudo mkdir -pv /mnt/$part && sudo mount /dev/$part /mnt/$part
sudo cp -rfva ./ /mnt/$part/ && sudo umount /mnt/sda3 && reboot

And finally flash NITdroid's Linux kernel in R&D mode :

  wget -c http://www.bundyo.org/maemo/nitdroid/nitdroid_770_20081223.tar.bz2
  tax xvfj nitdroid_770*.tar.bz2
  sudo /usr/local/bin/flasher-3.0 -f --enable-rd-mode -R -k \

   nitdroid_770/zImage-nitdroid-n770
  flasher v0.8.7 (Oct 17 2006)

BOOT

A few seconds later you'll see tux and its verbose console,
half a minute a splashscreen,
and less than another 30 seconds the desktop is ready to be used.

OK, now you have an overview of the system,
don't panic if several warning messages appear,
we'll try to shut up those pop up by adding some virtual memory
(if this wasn't done before)

ADDING SWAP

Install the patched version of Android Debugger Bridge :

  wget http://guug.org/nit/nitdroid/adb.bz2

  /usr/local/bin/adb shell

Once logged, you'll be able to use a busybox shell,
(feel free to investigate at the filesystem)

  # cat /proc/version
  Linux version 2.6.28-rc9-omap1-05327-g52a8b74-dirty (bundyo@bundyo) (gcc version 3.4.4 (release) (CodeSourcery ARM 2005q3-2)) #148 PREEMPT Tue Dec 23 09:10:12 EET 2008

Now we're about to add some swap space from a remaining partition
of the memory card. Be careful and identify the right partition.

  # cat /proc/partitions
  major minor  #blocks  name
    31        0        128 mtdblock0
    31        1        384 mtdblock1
    31        2       2048 mtdblock2
    31        3       2048 mtdblock3
    31        4     126464 mtdblock4
   179        0     507392 mmcblk0
   179        1     249840 mmcblk0p1
   179        2     132608 mmcblk0p2
   179        3     124928 mmcblk0p3

  # /nokia/bin/busybox fdisk -l /dev/block/mmcblk0
  ...
  /dev/block/mmcblk0p2             489         747      132608  82 Linux swap
  ...

Note : mtd* devices are Internal Flash memory, while mmc* are external ones.

Skip this part If you have formatted your swap partition before, this can be done on android side : the second partition of 1st (and only) MMC card, (might take time)

  # date ; /nokia/bin/busybox mkswap /dev/block/mmcblk0p2  ; date
  Sat Jan  1 00:07:49 GMT 2000
  # ...

If I can reckon, it failed on first time, so I had to do it again.

Once done let's mount it :

  # /nokia/bin/busybox swapon /dev/block/mmcblk0p2 && cat /proc/swaps
  Filename                                Type                Size        Used        Priority
  /dev/block/mmcblk0p2                    partition        132600        2072        -1

To make this configuration permanent, the init script must do the job on each boot :

cat<<EOF >> /init.rc && reboot

#{ Adding swap space
service swap /nokia/bin/busybox swapon /dev/block/mmcblk0p2
    oneshot
#}

EOF

Once rebooted let's check again (host side)

  /usr/local/bin/adb shell dmesg  | grep swap
  <6>[ ] Adding 132600k swap on /dev/block/mmcblk0p2.  Priority:-1 extents:1 across:132600k

INSTALL APPLICATIONS

Then you can have fun with the menu, see API demos for instance.

Last but not least, now let's install your favorite applications, using a patched version of adb (android debug bridge client)

  /usr/local/bin/adb install bin/Diet3D.apk

It's icon will appear in the application panel

CONCLUSION

To conclude, before someone ask I won't say NITdroid is better that maemo,
IMHO, I would chose the OS depending on freedom it can provide
and on applications it can support.

So android is a bit young, and porting native applications is not the philosophy, but Java support fits best.

Other projects need to be investigated on this (obsolete) plateform, I am thinking of mer (Deblet's little brother), but that will be the subject of an other article.

Let me know, if you need assistance or if you have ideas to share.

There are some new GNU/Linux sections just opened in the forum.

See you there.

REFERENCES :

Project headquarter :
http://guug.org/nit/nitdroid/

Diet3D :
http://rzr.online.fr/java.htm

Files:
* http://guug.org/nit/nitdroid/rootfs-nitdroid-0.3.2.tar.bz2
* http://www.bundyo.org/maemo/nitdroid/nitdroid_770_20081223.tar.bz2

Interesting URLs :
* http://elinux.org/Android_on_OMAP
* https://sourceforge.net/projects/android-n810/
* http://www.android-internals.org/index.php?title=Nokia_770
* http://www.internettablettalk.com/forums/showthread.php?t=21747
* http://en.wikipedia.org/wiki/Nokia_770_Internet_Tablet

Video: Ogg/Theora (or flv) :
* http://en.theorasea.org/story.php?title=NITdroid--Linux-Android-on-Nokia-770-1

Promote this project:
* http://digg.com/linux_unix/NITdroid_or_just_another_Android_port_nokia_770_and_later

Special thanks go to bundyo, solca and #NITdroid's hackers and newlc for taking the risk to trash their n770.

Licence: http://creativecommons.org/licenses/by-nc-sa/3.0/

Tutorial posted January 21st, 2009 by www.rzr.online.fr categories [ ]