Sunday, March 8, 2009

Linux Kernel for Fujitsu-Siemens Loox N560/C550 with usbnet working

After 3 days of struggle I am finally able to build a linux kernel for my PDA Fujitsu-Siemens Loox N560. The kernel has been downloaded from http://www.asm32.ru and patched (pxa27x_udc.c) to support for usbnet (host-to-PDA networking through a usb coard). Also I've made a diff file with differences between the current cupcake kernel and the kernel (by date 02-mar-2009) from asm32.ru site. That will be useful later when I need to apply support for Loox to a new upstream cupcake kernel. Here is the patch which also includes support for usbnet on Loox C550/N560. The patch already contains a kernel configuration file (.config), but usbnet support is not enabled there. Here is the other .config file which is differ from that included in the patch by supporting usbnet, having power management switched off and configuration for larger fonts in console.

It is possible to build the kernel with any toolchain for arm of your choice. I've tried crosstool-ng, emdebian and the one that is included in the android repo. I have decided to leverage emdebian toolchain for I use debian on my PC. The following is the command to build the kernel using emdebian toolchain:
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-
Of course you have to have emdebian toolchain installed. You can install emdebian something like it is shown below:

apt-get install emdebian-tool
emsetup --arch arm
Then add:

deb http://www.emdebian.org/debian/ unstable main

into your /etc/apt/sources.list and run:
apt-get install linux-kernel-headers-arm-cross gcc-4.2-arm-linux-gnu

When the kernel is built and ready you can copy it on an SD card and run it with haret with the following default.txt:

set MTYPE 1454
set KERNEL zImage
set CMDLINE "root=179:2 mem=60M rootdelay=3 boot_delay=0 init=/init console=tty0 fbcon=rotate:0 androidboot.console=tty0 android.checkjni=1"
set RAMADDR 0xA0200000
bootlinux
That is important! When you've placed zImage on an SD card, you will insert the card in your PDA. And then you must reboot your PDA! And only after you have rebooted your PDA with the SD card inside, you should ask haret to boot linux. That is very important because a linux kernel will not be loaded correctly (or it will but with only 10% chances) if one of the following conditions is true:
1. PDA has fallen asleep or suspended.
2. You have just inserted an SD card in your PDA and not rebooted it yet.
It looks like it is a bug in wince...

P.S. There you can download cupcake kernel http://source.android.com/download

P.P.S. When you build kernel with usbnet, don't set CONFIG_USB_ETH_RNDIS to 'y'! Or your PC kernel (2.6.x) will not find your PDA... neither cdc_ether nor cdc_subset will claim your PDA.

5 comments:

  1. HI Akshall

    I try to boot a linux kernel on my 560 without success, i had compiled with your .config (without patches ), and i nothing appends, all i get after the cebootlin or haret is a N560 hanged after the "disabling Framebuffer Feedback" you could contact me if you want on thanspam@trollprod.org

    Bye

    ReplyDelete
  2. Forget the last post, was a kernel issue, all is ok right now, it's boot

    ReplyDelete
  3. Hi Akshall,
    The link to download kernel is broken. Can you please provide me with another link?

    Thank you!

    ReplyDelete
  4. Is this blog alive?
    It would be great to get Android running on Loox.
    I have a Loox 610 by the way.
    Would this kernel work on that?

    ReplyDelete
  5. Hey, I took your patch and porting it to >=3.8. It goes well, but if anyone with coding/RE skills is interested, let me know :) I'll publish patches in few days.

    ReplyDelete