LinuxDevCenter.com
oreilly.comSafari Books Online.Conferences.

advertisement


Linux on an iPAQ
Pages: 1, 2

Installing Linux on your iPAQ

The actual installation process is fairly straightforward, although as with all such activities, care must be taken to prevent creating a brick. Compaq has committed to recovering any units which do meet with an unfortunate flash, but they'd really prefer not to have to. Also, it's advisable to make a backup of the current WinCE installation before you overwrite it; you paid for it -- might as well keep an image.



Ironically, the initial installation of Linux on the iPAQ requires the use of a Windows desktop platform. This is because we need to install the osloader program, which bootstraps the process. This can only be transferred to the unit by using Microsoft's ActiveSync tool. Osloader also creates the WinCE backup images, which are also transferred by ActiveSync.

Osloader contains a copy of the bootldr program, which handles how the iPAQ boots. This is similar to the Agenda VR3's PMON, or a PC's BIOS/LILO, and is written to the boot block of the device. As with other devices with a boot block in the flash, this should be write-protected to prevent accidental overwriting.

The remainder of the installation process is done by way of a serial connection using a communications program like Hyperterminal under Windows. As all color iPAQs come with USB cradles, it means a serial cable or cradle must be purchased before the Linux installation can be completed.

Once bootldr is installed and running, a dialog is established through the serial port at 115,200 Kbps. Installing or upgrading Linux simply involves entering "load [blockname]" (when {when "blockname" is replaced with bootldr, kernel or root, or a hex address), and then sending the appropriate file to the device via xmodem.

Earlier versions of bootldr had problems with transfers under Linux because of xmodem timing issues, but this has been improved with later versions, and can be further tuned manually by setting timeout values. For this reason, along with better power management support, I advise you to upgrade bootldr to the latest version -- rather than using the one installed by osloader, which will most likely be much older than what's currently available.

Exactly what files are flashed into which sections depend on the particular distribution being installed. They all share the bootldr, and they all have a kernel image and at least one file image, but these can vary considerably between distributions. Also, some use multiple cramfs format filesystems, while the latest Familiar uses a single JFFS2 format partition.

For specific installation instructions, see the ReadMe doc or other documentation included with each distribution. These documents are all quite complete, and can be followed by anyone with moderate technical ability. The good news also is it is actually rather difficult to incorrectly flash the units to a point of not being able to recover to bootldr. Once bootldr is installed and write-protected, upgrading between the different distributions is fairly easy.

Running Familiar 0.4

Booting the Familiar environment takes less than 20 seconds to go from a reset to having a full Linux and X Window system up and running, with the Blackbox window manager. By default, Familiar launches its full-screen handwriting recognition (HRW) program fscrib, a fork of xscribble, which opens a small window in the upper-left-hand corner of the screen.

Hidden at the very bottom of the screen is a control panel that can be fully displayed by tapping at the very bottom of the screen. This lets you move between the open windows on the current desktop, and switch between one of four desktops. Because this panel is always top-most on the display, you can use this to navigate around even when an application opens a full-screen window.

Applications are launched by tapping anywhere on the background desktop area. The menu is generated from a simple text file, /etc/X11/blackbox/blackbox-menu, which can be modified as desired to add new items. For those who have trouble reading the anti-aliased menu items, this can be a handy file to check out too.

Familiar 0.4 is configured to have the display in "landscape," or rotated mode, giving a 320 x 240 pixel display. "Portrait," or 240 x 320, can also be configured, if desired; a menu-option for this possible, using the xinerama extension of X, although isn't installed by default.

Selecting HWR.
Selecting stylus-as-mouse.
Handwriting recognition is activated by clicking on the keyboard icon on the fscrib window; clicking the mouse icon reverts to regular stylus-as-mouse mode.

 

The xvkbd keyboard.
The xvkbd keyboard.

The HWR program, fscrib, is interesting in that unlike most other handwriting-recognition systems, you draw (and leave a trail) on the entire screen. After each stroke, the trail is quickly removed, and you continue on. The trail drawing and removal is done by fscrib itself, and does not rely on having the applications redraw themselves. The HWR itself is activated by clicking on the keyboard icon on the fscrib window; clicking the mouse icon reverts to regular stylus-as-mouse mode.

While the character recognition is quite good (see HowToUseFscrib at the Wiki site), there are times when a virtual keyboard is needed. For this, the program xvkbd is provided. It is actually possible to have both running at the same time, for quick interchange between them.

While there has been quite a bit of software ported to the iPAQ, Familiar 0.4 does not come packed with very many applications. Instead, it is assumed you'll update and upgrade your iPAQ with desired software using the ipkg facility. Similar to the RPM or DEB facilities under desktop Linux distributions, ipkg is a user-friendly way of handling software packages, and is network enabled.

For console access to the iPAQ, there is the rxvt X terminal provided in the application's menu. Using a regular serial communications program, Familiar also is configured to allow serial console access (the root password is "rootme"). You can use this to ensure you have a good serial connection to the device.

xterm screen shot.\
The rxvt X terminal.

In addition, the serial port is also configured to detect the start of a PPP session. As root on the connected Unix desktop, enter:

/usr/sbin/pppd /dev/ttyS0 115200 192.168.1.100:192.168.1.3 nodetach noauth debug nocrtscts lock user ppp connect '/usr/sbin/chat -v -t3 ogin--ogin: ppp'

... and then wait. Within a few seconds you should get a report of success and should be able to ping the iPAQ. The above assumes your host computer's IP is 192.168.1.100, and the IPAQs is being assigned as 192.168.1.3. Also, adjust /dev/ttyS0 to be appropriate.

By default under Familiar 0.4, the only network service available (other than X at 8000) is ssh. So the next step is to ssh into the machine. Enter ssh root@192.168.1.3, and if everything's working OK you should quickly be greeted with a "request root's password" message. rootme, and you're in.

If ssh fails, but you're able to ping the iPAQ, it means the ssh daemon failed to launch. This is almost always because the ssh_host_key was not created, usually caused by not completing the install instructions. This can be rectified by running /usr/bin/ssh-keygen -f /etc/ssh/ssh_host_key -N '' on the iPAQ, and then sshd. This can be done via rxvt, or by breaking the PPP connection and using the serial console access.

Once you have a PPP session running with ssh access, additional configuration can be done through the comfort of TCP/IP networking. Files can be transferred between the iPAQ and the desktop machine using scp. To enable access to the full Internet by the iPAQ, its IP must be masqueraded. This is done on the host computer, and is detailed at the Handhelds Wiki site, among many others.

Once the iPAQ is able to connect to the full Internet, the last step is to configure either the /etc/resolv.conf file with one or more DNS servers, or at least set up an entry in /etc/hosts for familiar.handhelds.org. This will allow the ipkg system to connect to its server, allowing the ipkg update and ipkg upgrade commands to work correctly.

At this point, you're pretty much working with a standard Linux installation; it just happens to be sitting in your hand or in your pocket -- instead of on your desk or floor. I find it rather amusing that the display size, 320 x 200 pixels, is the resolution that many of us were first able to render to as a "bitmap," using our clunky old Apples and Commodore 64s.

Conclusion

The Compaq iPAQ is a remarkable piece of hardware engineering, with a tiny form-factor considering the power of the device. There is little wonder why the product has been in such high demand lately. Even without all the software of the Palm, an iPAQ running WinCE can be a great asset during those occasional "who's got the best PDA" contests.

Fortunately, and largely thanks to Compaq themselves, there are also several Linux-based options as well, as detailed above. The diversity of the offerings is also interesting, as we watch different groups (both commercial and not) build upon the base Linux kernel and OS to deliver different targeted solutions.

For anyone who's wanting to run a Linux-based iPAQ as a day-to-day PDA, one of the specialized distributions like PocketLinux or QPE would probably be your best option right now. Familiar is also a possibility, as there are a couple of Personal Information Management (PIM) suites available for the platform, including the PIM software for VR3 by Agenda Computing.

But really, where the most excitement seems to center is around making the iPAQ as capable as possible as both a Linux and a X Window system platform. The general option seems to be that, well, sure it can run PIM apps, but it could be a portable network analyzer, or a video-streamer, or the CPU for a wearable platform (PCMCIA video cards and all), or, well, just about anything.

The question as to which windowing system is best -- X, Qt, or Microwindows -- is still being "discussed." Those in the X camp argue that the ability to import and export displays, not to mention the ease of application porting, far outweigh the slight speed advantages of a direct-to-framebuffer option. This can be best measured by the number of apps being ported to the different platforms. Only time will tell for sure, but I suspect that X will end up the most common target.

Emulation is also an area receiving a lot of attention. People are porting emulations for older devices (Gameboys and Commodore 64s, for example) to the iPAQs, and running their old software within the machines. I'll personally bet anyone a pint of beer (at the pub of my choosing) that we'll see the POSE Palm emulator running on the iPAQ within a year. I own a Palm, so using an image of the ROMs in the POSE will be legal and give me access to all the Palm apps. I think this will be a common situation.

The community that has formed around the Handhelds.org site and the Linux iPAQ development project, is large and active. The development e-mail lists receive dozens of posts a day, with the IRC channels regularly attended. Development types will immediately feel right at home.

On the other hand, the Linux iPAQ user community is not nearly as well-represented. This can quite simply be explained by the fact that there aren't many end users using Linux on their iPAQs -- they're sticking with WinCE. And, in the short term, this isn't likely to change.

But for power users who want more, the iPAQ running Linux is a very versatile platform. While Linux isn't likely to cut much out of WinCE's market share, those using Linux are able to enjoy the inexpensive "kit" made possible because of the demand for product (the M$ "tax" non-withstanding).

Anyone interested in mobile, "personal" computing would be well rewarded giving Linux on an iPAQ a try. While not quite ready for end users yet, it is definitely worth experimenting with now -- a full-powered PC in your pocket. Besides, the weight of the iPAQ nicely balances that of your Palm in your other pocket, until the day you don't need it anymore ...

Online resources

There are considerable resources available online for iPAQ developers. Interestingly, there are fewer user-targeted sites, but these will no doubt develop over time.

Handhelds.org
Site run by Compaq to "encourage and facilitate the creation of open-source software for use on handheld and wearable computers". Hosts CVS and FTP servers with distributions, kernels and apps.

HandheldsWiki
User contributed/edited web resource pages.

Familiar homepage
Download and development resource site for PocketLinux.

PocketLinux.org
Download and development resource site for PocketLinux.


Linux Online Certification

Linux/Unix System Administration Certificate Series
Linux/Unix System Administration Certificate Series — This course series targets both beginning and intermediate Linux/Unix users who want to acquire advanced system administration skills, and to back those skills up with a Certificate from the University of Illinois Office of Continuing Education.

Enroll today!


Linux Resources
  • Linux Online
  • The Linux FAQ
  • linux.java.net
  • Linux Kernel Archives
  • Kernel Traffic
  • DistroWatch.com


  • Sponsored by: