GPS-CF How-to for the TkRom 2.0 Alpha 3 on a Zaurus SL-5500G

Last update: 06 Mar 04 20:08:56 Axel Pauli
This how-to contains my personal notes made during installation of TkRom 1.0 final and 2.0 Alpha 3 on my Zaurus SL-5500G and all additional steps are needed to bring up a GPS-CF card BC-307 with a serial interface to run. I hope it will help all other to configure their OS in the right way and to enjoy then on cumulus. In general if you have problems it is a good idea to visit one of the following web sites:

Disclaimer: The following information in this document can be out of date. Follow the instructions at your own risk.


Preparing installation of a new theKompany.rom ROM

Download the following files:

from Zaurus User Group, ZUG Downloads, Roms, theKompany. Don't be disturbed on the wrong version of the zImage it is the right. Store both files on a CF card and rename them to initrd.bin and zImage. Additionally you can download the setup /home filesystem script prep-home-sd_test5.zip to create or move the /home on a SD card.

The script is to find here: prep-home-sd_test5.zip

Before copying script to CF card make an unzip of it. I had trouble to start the execution of the script on the z. The shell reported always some ununderstandable errors. The cause were return signs in the script file. You can remove them by executing the following command on the z in a system terminal:

cat originalFileName | tr -d '\r' > newFileName

I will also put all needed files in my kflog home directory under ~axel.

Installing theKompany.rom ROM

  1. Download the latest ROM Image and kernel for your unit (initrd.bin and zImage). The ROM image and kernel will have some numbers after the name (ex. initrd.bin-tkrom-x.x-slxx00 and zImage-tkrom-x.x-slxx00).
  2. Rename the files to initrd.bin and zImage
  3. Copy file to root of FAT formatted CF card.
  4. Put CF card into Zaurus.
  5. Plug the Zaurus into AC power.
  6. Flip switch on back of Zaurus to "Replace battery", remove the battery cover.
  7. Hold down the C + D keys on the keyboard and push the hard resent button in the battery compartment. The Mail and Battery lights will turn on (solid, not flashing). They will remain on for approximately 3 minutes, then both lights will go off.
  8. Hit the hard reset button in the battery compartment.
  9. Replace the battery cover and flip switch back to Normal operaton.
  10. Turn on the Zaurus and Follow On-screen instructions to configure the Zaurus. (NOTE: It takes a little while to boot up on the first boot as ssh keys are generated)
As next you can execute the prep-home-sd_test5 if you want to move the /home filesystem to a SD card. This step is not necessary but it brings you more memory during run-time, if you create a swap file system in the freed RAM area. I had some trouble with it because my 256MB SD card, brand SanDisk, didn't support the async mount option correctly. I removed the option in the script and that was it. If you have less experience with such things, don't move the file system.

But before doing move read the following text from the author:

This is the updated version of the prep-home-sd.sh script, which is used set up an SD card as your /home filesystem. This is to be used in conjunction with the TKCrom Version 2-alpha3 release. You can also modify the standard sharp rom, or tkc-v1 rom to work with this script, by modifying the /root/etc/rc.d/rc.sysinit script to match the one that is included with the version-2-alpha3 tkcrom. The main difference between using this method of /home on SD v.s. some of the other roms that implement this, is that you can switch between the SD and /home on the ramdisk simply by rebooting with or without the prep'd SD card inserted.Fixes in this version:

  1. Swapfile handling is improved. If you ran the prep script with the option to setup a swapfile, the swapfile will be recreated if you hard-reset your Zaurus.
  2. Lockup issues on suspend -- Some people were reporting lockups on suspending, with certain brands of SD cards. I've changed a couple of directories under /home/system/var to be symlinks to the ramdisk's system/var directory, which seems to help the situation a bit.
Note, that not all brands SD cards will work with /home on SD, as they have problems with staying mounted through a suspend/resume cycle. This issue doesn't show up under normal SD usage, because the SD can be unmounted/remounted upon resume. But with /home sitting on the SD card, it can't get remounted because it's busy. I do know that Lexar cards seem to work ok, but some Sandisk and PNY cards have this issue.

Necessary steps to make running a GPS CF card

After installation is finished it would be a good idea to login into the zaurus via ssh from a linux desktop or via putty from a windows desktop. It is easier to do the next steps in this manner as to work in a system terminal on the Z.

Activation of serial interface of CF card

Change into the directory /etc/pcmcia.

cd /etc/pcmcia

Load file serial into an editor (e.g. vi serial). Goto line 59 via command :59 and hit return. In this line should be to see the following content:

cardctl suspend

Comment line out with a hashmark inserted at the left side.

cardctl suspend -> #cardctl suspend

Store the changed file.

Insert GPS CF card into the Z. In the lower line should come up a message, that a new card has been inserted. Now you can check, if your card has been recognized by the OS. Enter command cardctl ident and look at the output. For my BC-307 GPS card there is printed out the following:

Socket 0:
  product info: "CF CARD", "GENERIC", "", ""
  manfid: 0x0279, 0x950b
  function: 2 (serial)
Socket 1:
  no product info available
Load the file config in an editor and check, if your manfid is already contained in that file. If not, make an new entry in the following manner at the end of the file behind the latest card record. The base are the data displayed with the command cardctl ident. The card id can be any string.
card "GPS CF Card BC-307"
  manfid 0x0279, 0x950b
  bind "serial_cs"
Store the changed file. Change into the directory /etc/rc.d.

cd /etc/rc.d

Due to a bug in the kernel the serial card driver will not be loaded automatically during insertion of cf card. We automate that now. Load file rc.serial into an editor. The following line should be inserted before the exit 0 statement:

/sbin/insmod serial_cs
Content of file after insertion:
#!/bin/sh
/sbin/insmod serial_cs
exit 0
To avoid a reboot we will load the necessary kernel driver by hand. Enter the command:
/sbin/insmod serial_cs
The following is printed out on the screen during command execution:
Using /lib/modules.rom/2.4.18-rmk7-pxa3-embedix/kernel/drivers/char/pcmcia/serial_cs.o
Via lsmod command we can control, if the kernel has bound the driver.
Module                  Size  Used by
serial_cs               4624   0  (unused)
registers              13904   0  (unused)
...
Now execute the command:
cat /var/lib/pcmcia/stab
to see, if the kernel has assigned a serial device to our card. If all is ok you should see something like that:
Socket 0: Serial or Modem
0       serial  serial_cs       0       ttyS3   4       67
Socket 1: empty
Important is the assigned device, ttyS3. We need it later on for the configuration of cumulus. Now we can do a very simple test, if the serial CF interface is working. We set the speed of the uart to 4800 bps and try to read then data from it.
stty 4800 < /dev/ttyS3
cat /dev/ttyS3
If we have luck and the GPS is sending data we can see the NMEA records:
6,1.2,73.0,M,44.6,M,0.0,0000*4F

$GPGSA,A,3,11,14,31,20,22,28,,,,,,,2.2,1.2,1.8*37

$GPRMC,152829.201,A,5228.1136,N,01334.1011,E,0.129664,135.72,060304,,*04
First record maybe corrupted but the rest looks very good. With Control C you can stop the output. Additionally, if you got no success you can switch on the system log daemon. Do the following:
cd /etc
Load file syslog.conf into an editor. Goto line 7 and remove the hashmark at the beginning of the line.

before

#*.info;mail.none;news.none;authpriv.none;cron.none             /var/log/messages
after
*.info;mail.none;news.none;authpriv.none;cron.none             /var/log/messages
Save changed file and start syslog daemon with:
/etc/rc.d/init.d/syslog start
Go into the log directory
cd /var/log
and look into the file messages what is logged during removing and inserting of CF card.

Messages during remove CF

Mar  6 15:39:48 localhost kernel: sa1100_pcmcia_init(0)
Mar  6 15:39:48 localhost kernel: tty03 unloaded
Mar  6 15:39:48 localhost cardmgr[153]: executing: './serial stop ttyS3'
Mar  6 15:39:48 localhost cardmgr[153]: + losetup: not found
Mar  6 15:39:48 localhost cardmgr[153]: + losetup: not found
Messages during insert CF
Mar  6 15:39:52 localhost cardmgr[153]: initializing socket 0
Mar  6 15:39:52 localhost cardmgr[153]: socket 0: Serial or Modem
Mar  6 15:39:52 localhost kernel: ttyS03 at port 0xc5270400 (irq = 35) is a 16C950/954Mar  6 15:39:52 localhost cardmgr[153]: executing: './serial start ttyS3'
Don't forget to switch off system log daemon with:
/etc/rc.d/init.d/syslog stop
otherwise the daemon works further on.
Now the OS should to be fit for cumulus. Run cumulus, and go into the settings dialog (SHIFT-S). Go to the GPS tab, and select /dev/ttyS3 as your device and 4800 baud as the speed.

Have a lot of fun with cumulus

Axel