|
::Linux on Dell Axim X30 (experimental)
Here I want to record all information related to this topic. I will try to take pictures and explain step-by-step so
everything can be easily reproduced by myself or others. My linux skills are fairly small but if you want to use this
site you should have minimal understanding of the linux environment.
For comments and/or suggestions send a mail to sacralux [wants no spam] gmx.net.
::table of content
This was all done on (3) different Systems (all) running Gentoo linux (2.6.14-gentoo-r4).
Most was done on a Fujitsu Siemens Lifebook B 2130 running at 400 mhz 8) ... small Axim does 624 mhz...
::getting started
To start right off you need these files:
default.txt - the haret configuration file
haret.exe - "Handheld Reverse Engineering Tool" by Andrew Zabolotny, loads linux
initrd - initial ramdisk, contains all files of our linux
zImage - the kernel image
Upload these files to your pocket pc and launch haret to start linux.
You will see linux boot up but you can't do much for now, to get back to Windows simply push the reset button.
The device has been hard-resetted after this!
If you want to dig deeper now you should set up a cross-compiling toolchain on your normal PC (which should run linux too, I am not sure if it would work with Cygwin).
::setting up cross compiler
To compile a kernel or any other program you will need a cross-compiler. This will enable you to compile programs for
the pocket pc on your other linux machine.
Most of this information has been taken from http://www.handhelds.org/moin/moin.cgi/Linux26ToolsAndSources.
This is a step-by-step guide on how to set up a so called cross-compiling-toolchain:
You can choose to download a pre-compiled toolchain or to compile it youself.
Pre-compiled toolchain (untested):
It should be possible to obtain a pre-compiled toolchain here:
ftp://ftp.handhelds.org/projects/toolchain/arm-linux-gcc-3.4.1.tar.bz2
Though it's got "gcc" in its name, it also contains the corresponding binutils version.
Then install the toolchain in /usr/local/arm:
# cd /
# tar -xvjf arm-linux-gcc-3.4.1.tar.bz2
Just add the "bin" of this /usr/local/arm at the beginning of your PATH, and that's all you need!
:: Plesae note that I just copied that piece of information from handhelds.org (see above), go there if you face problems!
Compile your own toolchain:
All steps apply to Gentoo but might as well work for other distributions.
# mkdir -p /etc/portage
# echo cross-arm-iwmmxt-linux-gnu >> /etc/portage/categories
# mkdir -p /usr/local/portage/cross-arm-iwmmxt-linux-gnu
# cd /usr/local/portage/cross-arm-iwmmxt-linux-gnu
# emerge -avt crossdev
# echo PORTDIR_OVERLAY="/usr/local/portage" >> /etc/make.conf
# crossdev --target arm-iwmmxt-linux-gnu
This process will take some time and you wont see much output, just wait until it finishes!
For a first test try to cross-compile hdparm:
# mkdir /root/axim/pkgs
# CHOST="arm-iwmmxt-linux-gnu" CFLAGS="-O2 -march=iwmmxt -pipe -fomit-frame-pointer" CXXFLAGS="${CFLAGS}" PKGDIR=/root/axim/pkgs emerge --buildpkgonly hdparm
::compile kernel
First you should download the sources ;) :
Most information has been taken from http://www.handhelds.org/moin/moin.cgi/Linux26ToolsAndSources
# emerge cvs
# export CVSROOT=:pserver:anoncvs@cvs.handhelds.org:/cvs
# cvs login
password: anoncvs
# cvs checkout linux/kernel26
# cvs checkout -D 2005-12-17 linux/kernel26
# cvs update -d .
The last step is very time consuming!!!
Next you can configure your kernel:
# cd linux/kernel26
# kerneldir=$PWD
# make menuconfig
Now you should configure your kernel. Please note that these suggestions below are a first approach and are neither complete nor correct.
I simply enabled everything related with PX270 (cpu) and some other things I guessed about.
First of all select this one, since Axim X30 modules depend on it. It took me several hours to find that out.
* Device Drivers --->
SoC drivers --->
< *> HTC ASICS3 (...) SoC support
Now we can move on:
* System Type --->
ARM system type ---> PXA2xx-based
Intel PXA2xx Implementations -->
[*] Intel HCDDBBVA0
[*] Dell Axim X30 (non functional) --->
< *> Dell Axim X30 Core
< *> Dell Axim X30 LCD
[*] PXA25x/27x simple keyboard driver
* Bus support --->
PCCARD (PCMCIA/CardBus) support --->
< *> PXA2xx support
* Device Drivers --->
Character devices --->
Serial drivers --->
[*] PXA serial port support
[*] Console on PXA serial port
< *> SA11x0/PXA2xx RTC support
Graphics support --->
< *> PXA LCD framebuffer support
[*] PXA LCD command line parameters
Console display driver support --->
[*] Select compiled-in fonts
[*] Mini 4x6 font
USB support --->
USB Gadget Support --->
[*] Support for USB Gadgets
USB Peripheral Controller ---> PXA 27x
< *> USB Gadget Drivers (...)
As you might have noticed the Axim stuff is marked as "non-functional", it won't compile. Lucky enough I found a fix here.
You have to edit the file "[yourpath]/linux/kernel26/arch/arm/mach-pxa/aximx30/aximx30.c" and change the following lines at the end of the file:
Original:
MACHINE_START(X30, "Dell Axim X30")
MAINTAINER("Giuseppe Zompatori, giuseppe_zompatori@yahoo.it")
BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000))
BOOT_PARAMS(0xa0000100)
MAPIO(x30_map_io)
INITIRQ(x30_init_irq)
.timer = &pxa_timer,
.init_machine = x30_init,
MACHINE_END
Replacement:
MACHINE_START(X30, "Dell Axim X30")
/* Maintainer Giuseppe Zompatori, giuseppe_zompatori@yahoo.it */
.phys_ram = 0xa8100000,
.phys_io = 0x40000000,
.io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
.boot_params = 0xa8100100,
.map_io = x30_map_io,
.init_irq = x30_init_irq,
.timer = &pxa_timer,
.init_machine = x30_init,
MACHINE_END
Now we can compile our fresh kernel.
# make ARCH=arm CROSS_COMPILE=arm-iwmmxt-linux-gnu-
# mkdir AXIM_MODULES
# make ARCH=arm CROSS_COMPILE=arm-iwmmxt-linux-gnu- modules_install INSTALL_MOD_PATH=$PWD/AXIM_MODULES
Now you got to mount your initrd to install the modules!
::mount initrd
The initrd you probably downloaded is a gzip compressed initrd (ext2).
Check that using the file command:
# file initrd
initrd: gzip compressed data, was "initrd_uncompressed", from Unix, max compression
You might first want to rename it and gunzip it:
# mv initrd initrd.gz
# gunzip initrd
Now you can loop-mount it:
# mkdir /mnt/axim
# mount -o loop initrd /mnt/axim
Now you have access to all files residing in the initrd.
::install modules and finish
Now we have to install the new kernel modules.
# cp -r AXIM_MODULES/lib/modules/2.6.13-hh1 /mnt/axim/lib/modules/
You will most likely get an error message like "No space left on device". Because of that we have to create a larger initrd.
The next two steps will create a 16 mb initrd in the current directory.
# dd if=/dev/zero of=$PWD/initrd bs=1M count=16
# mke2fs -F -m 0 -b 1024 $PWD/initrd
Now we want to switch to the big one. Assuming we have mounted the old initrd in /mnt/axim do the following steps:
# mkdir /mnt/aximbig
# mount -o loop initrd /mnt/aximbig
# cp -r /mnt/axim/* /mnt/aximbig/
cleaning up:
# umount /mnt/axim /mnt/aximbig
# rmdir /mnt/aximbig
# mount -o loop initrd /mnt/axim
copy the modules:
# cp -r AXIM_MODULES/lib/modules/2.6.13-hh1 /mnt/axim/lib/modules/
Finally we got to modify the "linuxrc" file residing in the initrd.
Update at least the line containing the module path:
MOD_PATH=/lib/modules/2.6.13-hh1
You might want to gzip the new big initrd since 16 mb could take some time to copy to the Axim.
# umount /mnt/axim
# gzip initrd
# mv initrd.gz initrd
When this is done copy both zImage and initrd to your pocket pc.
[yourpath]/linux/kernel26/arch/arm/boot/zImage
[yourpath]/linux/kernel26/initrd
...
::using HaRET
HaRET offers a "remote examination tool" which can give important information on the Axim hardware (useful for flashing?!).
To use it you will need to connect the Axim to your PC. I tried to get access via USB which didn't work so I simply
enabled the wireless card assigned an IP and connected the Axim to my access point.
Next you have to start HaRET on the Axim and click the "Listen for network connection" button.
Then open a console and simply establish a telnet session.
# telnet 192.168.1.211 9999
Now you can start fidling around...
::various impressions
|
|