Thursday, June 02, 2005

linux.on.iPaq.episode1

A fellow PUG@D comrade has reintroduced me to the Familiar Project and got me excited about the endless possibilities of zapping..err modifying your PDA's OS. Althought I have known of the project for quite some time now, I have not mustered enough guts to use it, since no. 1: Its too dangerous when you don't know what you're doing and no. 2: Even if you knew, its not a guarantee that you would not render your device into a useless paperweight (and void your warranty!). Ok, so now that you guys have been warned I can proceed. This btw is not a definite how-to guide (lets be clear on that), I guess there are a lot of "better" sources online. This is just my contribution to the community and hope that someone trying the same thing can pick up ideas from what I did.
So after a few months I finally decided to try this out and I did so by reading first...and then read some more (just to be very sure). Basically on the software level you need 3 things, a bootloader(boot strap program), the actual Linux distribution for your device(Familiar v0.8.2) and a GUI environment (you can choose between GPE, Opie) if you don't like the default console interface. I then downloaded Familiar distribution version 0.8.2 (with Opie as GUI). Take note that I'm using an iPaq H5450 and Familiar's bootldr does not support the display(meaning no interaction of the iPaq's screen) and CF/PCMCIA. Having said that, you are only supposed to use a host machine runnning a terminal emulator (such as HyperTerminal) connected to the iPaq via a serial cable (the usb connection is apparently not enough).
Ok, so lets start by installing the bootloader, there are a lot of options on this one but in my case I used ActiveSync because I already had it installed and my USB connection is way better than the serial port when it comes to file transfers (note that this will be the only time I'll be using the USB connection). The idea is to copy the bootloader files to the device and then create a rom image of your current device (as a failsafe) so that in the event that you might encounter a problem and probably decide that you're better off going back to PocketPC, you can actually do it without doing irepairable damage to the iPaq.

Follow the instructions carefully on installing the bootloader using Active Sync

If everything has gone well, you have successfully installed the CRL bootldr program, which can run either Linux or PocketPC. As yet, your PocketPC image is intact and should restart normally; the next step actually installs Linux (the fun part!).

Installing Familiar 0.8.2 with a serial line

You will need a serial sync cable, serial sync cradle or the dual USB/Serial cradle. You will also need to use a terminal program such as Hyperterminal (you can also use minicom and kermit but hyperterminal, more often than not is already install in your Windows PC).
  1. Hold down the joypad and push the reset button on the iPAQ. You will need to remove it from the cradle to access the reset button.
  2. When the iPAQ buzzes, release the joypad. The screen will not change from whatever was previously displayed (blank, PocketPC, etc). If the iPAQ does not stop vibrating, remove the AC adapter and the battery, then reinsert the battery and the AC adapter and perform try this step again. On my first try the iPaq actually stopped responding (heart skipping at this point), but I managed to restore it by following the step above.
  3. Make sure the terminal emulator (in my case, Hyperterminal) is up and running, and is properly interacting with the bootloader. Proper interaction consists of being able to issue commands, and get responses (e.g. the help command should return the bootloader usage). Your terminal emulator must be set to
      bits per second: 115200
      Data bits: 8
      Parity: None
      Stop bits: 1
      Flow control : None

    Failing to use these settings will lead to trouble, so double and triple check all settings
    If you cannot interact with the bootloader, make sure your terminal settings are correct, the iPAQ is properly connected to the host computer, and the iPAQ is actually on. If everything seems fine, try restarting the host terminal emulator and resetting the iPAQ again.
  4. At the "boot>" prompt, issue the following command: load root
  5. Proceed to send or "upload" the jffs2 file (if you selected Opie it should be opie-image-h3900-20050407140814.rootfs.jffs2) with ymodem, using the terminal emulator.

    Note that the bootldr now expects ymodem by default, but hyperterminal uses Xmodem as the default file transfer protocol. So make sure that before sending the file you have set the Protocol to Ymodem

    • When the upload is done, you should see something like:
    • And finally, the cross-your-fingers portion of our activity ;)
  6. At the "boot>" prompt, issue the following command: boot

    Linux should now start booting.


On the next blog I'll be showing the results of our little experiment ;)

No comments: