My_Zaurus

Welcome to my homepage for Sharp's Zaurus, Linux based, palm top.

 "Its eazy once you understand it." - me 1987

These documents describes my work with the Zaurus (Z) and the things I have learned about how it works.  I hope these pages will help you enjoy your Z more.

So far my efferts include:


Getting Started

There are a few things everyone want to do, or needs, to do when they get a new Z.  If you are the kind of person who likes to figure stuff out for your self, don't read any further. However, if you want to just get it going or you'd like to see how someone else setup their Z, read on.

If you're like me, a computer isn't any good unless you can connect it to another computer and a computer really comes to life when you connect it to the Internet. So, the first step is to get your Z connected via TCP/IP to your desk or laptop.

I am using a Linux (RedHat 7.2) laptop so these instructions will be built on that model.

If you have a SL-5000d (developer's) edition then this section may be usefull. If you have a  SL-5500 then skip to Newer ROM Images.

The developers model somes with a version 1.02 ROM.  You will want to replace this ROMIMAGE but not now.  

To make network connects with the USB cradle you can use the  CDCEther module which does not require kernel patching and re-making.  This does not work on Z's with ROMs greater then 1.10.

You can download CDCEther here:

        CDCEther.tar

It compiled without a problem for me. The instructions that come with it are good.

Once you have the new CDCEther module loaded, remove the Z from it's cradle, plug the USB cable into your host, Power on the Z, and put it in the cradle. When your workstations sees the Z, it should create a new network device.

The net_fd.o module from the 1.02 ROM appears to have a severe memory leak.  Every outbound transfer decreases the amount of free memory on the zaurus.  For now it doesn't matter.  We need a way to get data in and out of the Z.

Now just ahead to Workstation Setup.

Newer  ROM Images

With newer version ROMs (1.10 or latter), CDCEther does not work.  You are going to have to patch  the kernel on your workstation to user the usbdnet drivers.  I'm sorry. Maybe Sharp will get their act together and make sure their first public release will work with Linux out of the box.  (This didn't happen.)

The patch for kernels 2.4.17 and .18 can be downloaded here:

        usbdnet patch for Linux kernel 2.4.17
        usbdnet patch for Linux kernel 2.4.18

If this is just to much for you and your think your can trust me, (your crazy) I have a copy of my kernel and source and binary form avaible.

kernel-2.4.18-19.src.rpm
kernel-2.4.18-19.i386.rpm

Otherwise, assuming your Linux sources are in /usr/src/linux do the following :

   cp usbdnet-2.4.17.patch.gz /usr/src
   cd /usr/src
   zcat usbdnet-2.4.17.patch.gz | patch -p0

Now reconfigure the kernel to support :

   cd /usr/src/linux
   make menuconfig

NOTE: If you had previously compiled in the patched CDCEther driver, remove it from the kernel, having both drivers compiled will prevent the new driver from working

You will need to go to  "Code maturity level options", and select "Prompt for development and/or incomplete code/drivers" in " USB support", section "USB Network adaptors", select (as a module if you want) "USBD Network (Encapsulated) Host-to-Host Link (EXPERIMENTAL) " Then enter 04dd in USBD Network idVendor and 8004 in USBD Network idProduct

Now rebuild your kernel and modules:

   make clean dep bzImage modules modules_install
   mv /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinuz-2.4.17

If you are using GRUB you are ready to reboot.  If you are using LILO you need to re-run lilo and reboot.

Your First Internet Connection

With the new ROM and workstation kernel running. Plug your cradle into your workstation, turn on your Z and put it in the cradle.  On your workstaion your should see something like the following in /var/log/messages :

hub.c: USB new device connect on bus1/1, assigned device number 38
usb.c: USB device 38 (vend/prod 0x4dd/0x8004) is not claimed by any active driver.
v0.4b sl@lineo.com, tbr@lineo.com
usbdnet.c: v0.4b sl@lineo.com, tbr@lineo.com
usbdnet.c: USB Host to Device Network - for Linux USB Devices using MDLM/CDC
usb.c: registered new driver usbdnet

And if you run:

ifconfig -a

you should see a new ethernet interface ( probably usb0 ).

YES? - Your Z is connected to your workstation.

NO - Sorry. Read through the instructions again and email me where we went wrong.

Workstation Setup

If you are using the old ROM 1.02 and CDCEther run:

        ifconfig eth1 192.168.1.200

If you are using the newer ROM 1.11 and the netfd module run:

        ifconfig usb0 192.168.129.200 netmask 255.255.255.255 up
        route add -host 192.168.129.201 usb0

Run ifconfig again without any options (just ifconfig).  The eth1 device should now have the ip number 192.168.1.200.

Now ROM 1.02 user can:

        ping 192.168.1.201

and ROM 1.11 user can:

        ping 192.168.129.201

You now have a network connection but it is only to your workstation. The Z still can not get to the internet.  You need to teach your workstation to forward packets for the Z.  To make this happen,

On your workstation enter:

        echo 1 > /proc/sys/net/ipv4/ip_forward
        modprobe iptable_nat
        iptables -t nat -A POSTROUTING -o eth0 -s 192.168.1.200 -j MASQUERADE

These commands are not permenet. If you reboot your workstaion your connections will go away. You could put then in /etc/rc.d/rc.local but I have something better.

Making it work every time

You know how to make it all work now. But if you remove the Z from it's cradle you will loose your connection and have to do some of the work over.

Because the Z is a "Hot Plug" device we can make the connections every time you plug your Z in. Most Linux system have scripts that run for these kinds of devices like pcmcia cards.

OLD ROM

On your workstation, look in your /etc/hotplug directory and edit the /etc/usb.agent file. (RedHat)
cd /etc/hotplug
vi /etc/usb.agent
You should find the following lines, neer the end of the file, in the ' add)' section:

    if [ "$FOUND" = "false" ]; then
        mesg "... no drivers for $LABEL"
        exit 2
    fi

add the following linds right after the above section:

    if [ "$PRODUCT" == "4dd/8004/0" ]; then
        #
        # Create a connection to the Z
        #
        set `lsmod | grep ^CDC`
        if [ "$1" != "CDCEther" ] ; then
            insmod CDCEther
        fi
        ifconfig eth1 192.168.1.200
    fi

This will make your workstation reconnect to the Z every time your plug it in.  

Newer ROMs

With the usbd network drivers, you don't need to do anything on the workstation side of the connectiont. Every time you drop your Z into the cradle it should create the usbd0 network connection. But there is work to be done on the Z site as well.

Setup on the Z

You sill can't connect your Z to SlashDot .  Your Z doesn't have a default route.

Open the Termainal program and type:

        route add default gw 192.168.1.200

If you have the old ROM or:

        route add default gw 192.168.192.200

if you are using the 1.11 ROM.

Now give it a try.

        ping 192.0.36.35

(Note this is the address of www.internic.com)

The last step is to add your DNS to /etc/resolv.conf on your Z so it can do name lookups.  You can do this my cutting the nameserver lines out of the /etc/resolv.conf file on your workstation and echo-ing each into the resolv.conf file on your Z.

echo nameserver XXX.XXX.XXX.XXX  >> /etc/resolv.conf

Now you can open your Opera Browser and go to SlashDot!

Making Z Changes Permenet

(NOTE: The word perment is used loosly here. Changes on the Z will be overwriten by a "hard reset".)

The Z has a section just like your workstation.

Edit /etc/hostplug/usbd.agent and change:

        usbd0)
                case ${ACTION} in
                register)
                        ifconfig usbd0 $IP
                        ;;
                unregister)
                        route del default
                        ;;
                esac
                ;;

to:

        usbd0)
                case ${ACTION} in
                register)
                        ifconfig usbd0 $IP
                        route add default gw 192.168.1.200
                        ;;
                unregister)
                        route del default
                        ifconfig usbd0 down
                        ;;
                esac
                ;;


Now when you pull your Z out of it's cradle it will drop the default route and re-establish it when you put it back.


Installing Telnet

On the Z, edit the file /etc/inetd.conf.

Look for a line that says telnet and doesn't have the word wrapperd in it.

Remove the # sign at the start of the line. It should endup looking like:

telnet  stream  tcp     nowait  root    /home/root/in.telnetd

Now you need to restart the inetd program.  You can do this by finding the PID for initd and running the command

kill -1 ##
If you don't know how to do this, use the Shutdown utility to reboot you Z.

You still can't login.  Most likely the only user on your system is root and the file /etc/securettys is not allowing root to log in over the usb network.   You can delete this file through FTP

ftp 192.168.xxx.201 4242
cd /etc
del securettys

If you get back '250 Requested file action okay, completed'.

That's it. You should now be able to telnet in and log in as root.

WARNING - there is absolutely no security in effect at this point. Anyone that can access the Zaurus can log in as root. I don't consider this a problem, since I don't put my PDA on a public network.

To change root's password run passwd. (DON'T FOR GET IT!!!)

Changing your HOSTNAME

To change the hostname of your Z edit /etc/rc.d/rc.local