Dual Booting Handhelds

This section discusses what we mean by dual booting on a Handheld and how to do it.

What is Dual Booting?

On a desktop or laptop machine, dual booting typically means having multiple operating systems or versions of operating systems installed into bootable media such as hard drives and having the firmware boot the chosen operating system.

On a handheld computer, sometimes the firmware is not able to choose from multiple media to boot

CyaCE

Explain what CyaCE is here.

Dual Booting with the Compaq Bootldr

As of version 2.18.15, the Compaq bootldr can boot kernels read from an IDE drive such as a CF flash card, a CF microdrive, a PCMCIA IDE drive, or an external IDE drive attached via a PCMCIA/IDE adapter.

Requirements for Dual Booting

Because the Linux kernel currently requires the cardmgr program to run in usermode, an initial ramdisk is required in order to boot Linux.

  • params file

  • zImage

  • initrd

Preparing the Params File

The params is bootldr script file. It is an ASCII text file containing a sequence of bootldr commands. Here is one suitable for use for booting with root on ramdisk 0.
    set linuxargs "initrd root=/dev/rd/0 console=/dev/ttySA0 init=/linuxrc"
    set kernel_filename boot/zimage
            
The second line is very important, because the default kernel_filename is boot/zImage, which is a long vfat directory entry, which is currently unsupported by the bootldr. It only supports 8.3 filenames at this point in time.

Kernel Requirements for the Mounting PCMCIA as Root

In order to mount a root filesystem via a PCMCIA device, the kernel will need to be compiled with initial ramdisk support. Here are the config options that need to be enabled during the kernel configuration phase.
    CONFIG_BLK_DEV_RAM=y
    CONFIG_BLK_DEV_INITRD=y

In addition, the kernel must be linked with support for whatever filesystem is used in the initial ramdisk. You may use any filesystem supported by the kernel, but ext2 or cramfs are common choices.

Using cramfs makes it easier to "shrink wrap" the initrd around the contents of the filesystem, wasting as little RAM as possible. If cramfs is used, then it is also useful to include support for ramfs to provide a writable filesystem during the initial boot process. To do so, enable the following options during kernel configuration:
    CONFIG_CRAMFS_FS=y
    CONFIG_RAMFS=y

Alternatively, if you use an ext2 initrd, then the following must be enabled during the kernel configuration phase.

    CONFIG_EXT2_FS=y

Other drivers and filesystems may be loaded from modules stored in the initrd.

Requirements for the initrd

As discussed in the previous section, the initrd must be formatted as a filesystem for which support is linked into the kernel.

Root Filesystem on

Perhaps the simplest strategy is just to use the initrd as the root filesystem. This would be a good strategy for Tourist Mode use of Linux on a PocketPC device.

To use the initrd as the root filesystem, specificy dev/ram or /dev/rd/0 as root in the arguments passed to the kernel by the bootldr, for example:
    set linuxargs "initrd root=/dev/rd/0"
in the boot/params file.

Initrd pivot_root Strategy

Another strategy is for the initrd to load enough modules so that it can run cardmgr, attaching and configuring the PCMCIA device to be used for the root filesystem, then executing pivot_root.

After the root filesystem is mounted and switched to, then the initrd space can be freed with the freeramdisk. This command is implemnted by the BLKFLSBUF ioctl call.

Using the Boot VFAT Command

The bootldr can boot from a VFAT filesystem on a card in a very similar fashion to how it boots from jffs2 in flash.

Here is the sequence of subcommands the boot ide command performs:

  1. sleeve insert

  2. pcmcia insert

  3. ide attach

  4. vfat mount 0

  5. vfat read boot/params

  6. eval params if they were found

  7. vfat read boot/zimage

  8. vfat read boot/initrd

  9. boots the kernel, passing initrd

Using the Boot IDE Command

The bootldr can boot a kernel read from a raw disk partition using the boot ide command.