Acer N30
Home | Status | Hardware | Downloads | Documentation
Booting Linux on the Acer n30
Compiling a kernel
First of all, this kernel builds on the 2.6.10-rc2 kernel from the Ipaq H1940 project. Follow the instructions from the HpIpaqH1940MassStorageHowto on how to download and patch the kernel. After you have patched the kernel with the H910 patches you need to apply yet another patch to add the n30 kernel support. So download this
patch and then do:
patch -p1 <../linux-2.6.10-h1940-n30.patch
Configure and compile the kernel with:
PATH=$PATH:/usr/local/arm/3.3.2/bin make n30_defconfig make
Now you're supposed to have a kernel image in the file arch/arm/boot/zImage.
Booting the kernel
I couldn't get HaRET working on my device, so I wrote my own little bootloader for booting Linux from Windows CE. The sources and a precompiled binary can be downloaded
here.
The bootloader uses a configuation file which is similar to HaRET's. Copy arch/arm/boot/zImage, initrd, boot.exe and default.txt onto a SD card. Start Windows CE, fire up the file browser and click on boot.exe. If you have
PocketConsole installed you will se a few debug messages. Without PocketConsole you won't see a thing, so it will be hard to tell if anything goes wrong. If everything goes well, the blue LED will start blinking after about 10-20 seconds (depending on how large your initrd is). The blue LED indicates that Windows CE is dead and that the Linux kernel and initrd is being copied around in RAM, this will take another 5 seconds or so. When the blue LED goes off the Linux kernel is being booted and in less then a second or so the screen should fill up with a lot of junk. About ten seconds after that the penguin should appear on the screen and you should se a lot of boot messages. Note that the bootloader isn't allt that stable, it seems that about one time out of three the kernel will either hang after the screen has filled up with junk, or a bit later in the boot process..
There are a lot of other nice Windows CE tools available on the PocketConsole page. I have extracted the CAB files for some of the utilities that I use and they can be downloaded from:
|
|
telnet daemon |
|
|
command prompt |
|
|
a console device for console applications |
|
|
an alternate command prompt |
Testing
I've build an
initrd based on
buildroot with a lot of tools on it so that I can test the hardware. If you want to try things out you can download it try the following:
Connect the n30 using the serial port to a Linux PC. Make sure the CDCEther module is loaded on the Linux PC. You should get a message like this in your syslog:
CDCEther.c: Found Header descriptor, CDC version 110.
There will be a lot of warnings about multicast filters, but it works anyways. Now you should be able to configure the new ethernet interface on your PC and log into the n30 with:
ifconfig eth1 192.168.131.102 telnet 192.168.131.201
Log in as the user default and you should see a prompt. Use su to become root. The USB ethernet driver doesn't seem to be all that stable, it loses the connection after a while for me, but I just unplug and replug the USB cable and reconfigure the network to get it working again.
Testing BlueTooth
/usr/sbin/hciattach /dev/ttySAC2 bcsp 115200 noflow /usr/sbin/hcid
Wait a few seconds for the daemons to start and then run:
hcitool scan
If you have a BT serial device (I've got a RoyalTek BT GPS) you can connect to it and display the NMEA data with:
mknod /dev/rfcomm0 c 216 0 rfcomm bind /dev/rfcomm0 00:02:C7:28:BE:44 cat /dev/rfcomm0
Testing IrDA
/usr/sbin/irattach /dev/ttySAC1 -s mknod /dev/ircomm0 c 161 0
Activate IrDA on some other device and put the IR ports next to each other and check if you can see the other device with:
/usr/sbin/irdadump
With my Nokia 5210 I can talk to it with:
stty -F /dev/ircomm0 raw cat /dev/ircomm0 & echo -n -e "ati3\r" >/dev/ircomm0
Testing USB host
I have a USB GPS that I can connect to the host port and get data from with:
mknod /dev/ttyUSB0 c 188 0 stty -F /dev/ttyUSB0 4800 raw cat /dev/ttyUSB0
Using SynCE to control the n30
There is project called
SynCE that allows a Windows CE PDA to sync with a Linux computer. I'm using SynCE to both copy files onto the SD card and to start boot.exe without having to do the dreaded screen calibration over and over again.
To get SynCE running with a n30 you first of all have to get the Linux kernel to communicate with the n30 over USB. Add the following line to your /etc/modules.conf (if your Linux computer runs a 2.4 kernel) or /etc/modpropbe.conf (with a 2.6 kernel):
options ipaq vendor=0x0502 product=0x16e3
Load the ipaq module with:
modprobe ipaq
Connect the n30 with the USB cable. If you look at the kernel log with dmesg you should see something like this:
usbserial.c: PocketPC PDA converter detected usbserial.c: PocketPC PDA converter now attached to ttyUSB0
Start the SynCE daemon as your normal user on the Linux system with:
dccm
Next start ppp daemon which establishes a to Windows CE as the root user with:
synce-serial-start
If the connection is successful you will see the following in the syslog:
dccm: Talking to 'Pocket_PC', a PocketPC device of type Acer n30 Handheld
If the connection fails, and this happens a lot to me, just turn off and on the n30 and kill off any existing SynCE connections and try again by running the following as the root user:
synce-serial-abort killall -9 pppd synce-serial-start
Killing off all PPP connections if you are using PPP for anything else is not such a good idea, but on my system the only pppd instance running is the SynCE connection.
When you have a connection, perform the following commands as your normal user to copy the bootloader, kernel and initrd to the system:
pcp boot.exe ":\\SD-MMC Card\\boot.exe" pcp arch/arm/boot/zImage ":\\SD-MMC Card\\zImage" pcp initrd ":\\SD-MMC Card\\initrd"
To start the bootloader do the following as your normal user:
prun "\\SD-MMC Card\\boot"
The nice part about this is that the above works even before the screen calibration is finished, so one doesn't have to recalibrate the screen all the time which is a relief.
Another useful tool is synce-install-cab which can be used to install CAB files. So to install a command prompt and a telnet daemon on the unit, just run the following commands in order (telnet opens up a dialog that has to be closed before any other applications can be installed):
synce-install-cab cmd-arm-installer.cab synce-install-cab telnet-arm-installer.cab
Wait for the installs to finish and reboot the unit so that the telnet daemon will be started. You can even do this before finishing the screen calibration. Start the SynCE connection to the device again and log into the device with:
telnet 192.168.131.201
Just press enter when asked about a password. If enter doesn't work, type the telnet escape character (Ctrl + 5 works for me) and then mode line. Press enter a few more times and you should be logged in.
Compiling the bootloader
Ok, this is a bit of a mess. What I do is to cross compile a Windows CE application from within Linux. There are a lot of attempts to build a Windows CE cross compiler out there, but most of them seem to be broken in different interesting ways. So here's how I managed to cobble togheter something that can compile Windows CE binaries.
First of all, download the
Windows CE cross compiler from
VoxWare Do not use the newer version since it will fail to produce working binaries. Install the cross compiler with:
cd /usr/local bzcat wincegcc073103.tar.bz2 | tar xvf -
Since I need to use a few Windows functions that aren't defined in the libcoredll.a that comes with the above cross compiler, I have to replace that library. Download my
hacked version of the Debian PocketPC SDK, unpack it and do the following:
tar xvfz ~/pocketpc-sdk-1.0.0w1.tar.gz cd pocketpc-sdk-1.0.0w1 PATH=$PATH:/usr/local/wince/bin make cp libcoredll.a /usr/local/wince/arm-wince-pe/lib
Now it should be possible to compile the bootloader.