uClinux on Sony Clie


This page is about getting uClinux to run on Sony Clie Palm OS handheld devices. Why do it? Because it's fun and because I could learn something along the way. I have got a Clie PEG-T615C handheld that I do not use anymore, so I thought it would be cool to use it to run Linux.

My initial Google search netted a site dedicated to running Linux on Palm OS handhelds. It is a bit outdated, but has quite a bit of useful information and it actually got me started in the first place.


Tested hardware

  1. Clie PEG-T615C
  2. Clie PEG-SJ30

Running the pre-built uClinix image

If you just want to check it out:

  1. Download the prc file

  2. Get a serial cable. See below for instructions on how to make one

  3. Backup your Palm device

  4. Copy the prc file to your Clie. Connect a terminal at 9600 baud, no parity, 8 bits per character, 1 stop bit to the serial port you had connected the Clie to. Start the palm loader application. Observe the kernel boot messages in the terminal window

Building your own image

If you want to build your own image here are the steps:

  1. First of all, this uClinux port has been developed and tested on Clie PEG-T615C device. It will probably also work on other Sony Clie T and S series devices. See above for the list of tested hardware.

    It will probably also work on other PalmOS 4.x based devices running on Motorola MC68VZ328 Dragonball VZ CPU. There are seem to be some differences related to which of the 2 Dragonball UARTs (serial ports) a particular device is using, so there might be an issue there.

  2. Clie comes with a USB cradle or cable. In order to get a serial console you would need a serial cable. You can make your own serial cable or buy one from a Web retailer or on ebay. I desided to make my own cable just to get a chance to learn proper soldering and get the right tools. Keep in mind, that the spacing between Clie connector contacts is very narrow, so soldering the connector is hard.

  3. Back up your Clie. The palm loader application will wipe out the contents of your RAM and once you are done with Linux you will need to reboot. Clie will come up as if it was cold reset with all of the RAM data lost. Since I stopped using my Clie long ago it was not a problem for me.

  4. Download the full source uClinux distribution from this page.

  5. Download the most recent m68k toolchain from this page. You can either get binaries and save yourself some work, or get the source and build it on your own. I do not like stuff trying to install into /opt or some such, so I built it myself.

    If you chose to build the tool chain from the source, download all those dozen or so files and read the notes in the beginning of the supplied shell script build-uclinux-tools.sh.

  6. Download the Prc-tools here. This is needed to build the palm-loader (the Palm OS application that serves as a boot loader for Linux)

  7. Download pilrc, Palm resource compiler here

  8. Download Palm OS SDK 5.3 for PRC tools. You would have to register and navigate starting from this page.

  9. Now build all the tools. I installed all of them into separate subdirectories of my uClinux working directory. Of course you could use /usr/local or any other directory of your choice. The supplied configure scripts work fine.

    Update your environment. You should have the bin directories of your m68k toolchain, prc-tools and pilrc in your PATH before your normal paths. `which gcc` should return your regular host gcc, `which genromfs` should return the binary supplied by the uClinux tools.

  10. As of the time of this writing uClinux does not have Clie (or other Palm handhelds based on Dragonball VZ) support. So, download my patch to get it. The patch is done against the uClinux-dist-20040408.tar.gz distribution. If your distribution is newer, you may have to apply it manually.

  11. Extract the uClinux source archive and apply the patch:

    tar xvzf uClinux-dist-20040408.tar.gz
    cd uClinux-dist
    patch -p0 -u < clie.diff
  12. Run configure process:

    make config
    and chose Sony for a vendor, Clie for a board and linux-2.4.x for a kernel version. Chose default (hit enter) on all other questions.

    If this succeeded (this step is sensitive to your pathing, so remember that your "gcc" has to be the host gcc, /usr/bin/gcc!) run

    make dep && make
    Now get yourself a cup of coffee and check your terminal again in a few minutes. If everything went allright, you should have a file called uClinuxPalm.prc in the ./images subdirectory.
  13. Copy the prc file to your Clie. Connect a terminal at 9600 baud, no parity, 8 bits per character, 1 stop bit to the serial port you had connected the Clie to. Start the palm loader application on your Clie. You should see something like:

    Linux version 2.4.24-uc0 (solovam@kremvax) (gcc version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from http://fiddes.net/coldfire/)(uClinux XIP and shared
    lib patches from http://www.snapgear.com/)) #1 Wed Aug 4 18:13:23 MDT 2004
    68VZ328 DragonBallVZ support (c) 2001 Lineo, Inc.
    Flat model support (C) 1998,1999 Kenneth Albanowski, D. Jeff Dionne
    On node 0 totalpages: 4096
    zone(0): 0 pages.
    zone(1): 4096 pages.
    zone(2): 0 pages.
    Kernel command line:
    Calibrating delay loop... 2.64 BogoMIPS
    Memory available: 14468k/15807k RAM, 0k/0k ROM (573k kernel code, 239k data)
    kmem_create: Forcing size word alignment - vm_area_struct
    kmem_create: Forcing size word alignment - mm_struct
    kmem_create: Forcing size word alignment - filp
    Dentry cache hash table entries: 2048 (order: 2, 16384 bytes)
    Inode cache hash table entries: 1024 (order: 1, 8192 bytes)
    Mount cache hash table entries: 512 (order: 0, 4096 bytes)
    kmem_create: Forcing size word alignment - bdev_cache
    kmem_create: Forcing size word alignment - cdev_cache
    kmem_create: Forcing size word alignment - kiobuf
    Buffer cache hash table entries: 1024 (order: 0, 4096 bytes)
    Page-cache hash table entries: 4096 (order: 2, 16384 bytes)
    POSIX conformance testing by UNIFIX
    Linux NET4.0 for Linux 2.4
    Based upon Swansea University Computer Society NET3.039
    kmem_create: Forcing size word alignment - sock
    Initializing RT netlink socket
    Starting kswapd
    kmem_create: Forcing size word alignment - file_lock_cache
    MC68328 serial driver version 1.00
    ttyS0 at 0xfffff900 (irq = 2) is a builtin MC68328 UART
    kmem_create: Forcing size word alignment - blkdev_requests
    Blkmem copyright 1998,1999 D. Jeff Dionne
    Blkmem copyright 1998 Kenneth Albanowski
    Blkmem 1 disk images:
    RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
    PPP generic driver version 2.4.2
    PPP MPPE compression module registered
    NET4: Linux TCP/IP 1.0 for NET4.0
    IP Protocols: ICMP, UDP, TCP
    kmem_create: Forcing size word alignment - ip_dst_cache
    IP: routing cache hash table of 512 buckets, 4Kbytes
    TCP: Hash tables configured (established 1024 bind 1024)
    NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
    VFS: Mounted root (romfs filesystem) readonly.
    Welcome to
              ____ _  _
             /  __| ||_|
        _   _| |  | | _ ____  _   _  _  _
       | | | | |  | || |  _ \| | | |\ \/ /
       | |_| | |__| || | | | | |_| |/    \
       |  ___\____|_||_|_| |_|\____|\_/\_/
       | |
    For further information check:
  14. That's it for know. Once you are done, reset the Clie and you will get a brand new Palm OS startup. If you can think of a cool hack to run on Clie with uClinux, please let me know.

anton@solovyev.com / Anton Solovyev