BOOT(8)

NAME
boot, boot.conf - zaurus-specific second-stage bootstrap

DESCRIPTION
The main purpose of this program is to load the system kernel while dealing with the peculiarities of the zaurus machine.

As described in boot_zaurus(8), this program is loaded by the primary bootstrap loader and provides a convenient way to load the kernel. This program acts as an enhanced boot monitor for zaurus systems, providing a common interface for the kernel to start from.

Basic operations include:

•   Detecting and switching between multiple consoles.
•   Loading kernels from any device supported by the primary bootstrap loader.
•   Passing system parameters queried from the primary bootstrap loader to the kernel.
•   Providing an interactive command line.

The sequence of its operation is as follows: initialization, parsing the configuration file, then an interactive command line. While at the command line you have 5 seconds to type any commands, if needed. If time expires, the kernel will be loaded according to the current variable settings (see the set command). Each time a kernel load fails, the timeout is increased by one second. The sequence of boot operations is as follows:

1.  Probe for console devices, which includes the (default) LCD+Keyboard console (cn0) and up to three serial consoles (com0 through com2) connected to the serial ports. Display messages to the default console about the devices found.

2.  Probe for disk devices, and select the first disk with an i386-compatible MBR and a valid OpenBSD primary partition.

3.  If the file /etc/boot.conf exists on the root filesystem on the selected disk, open and parse it. Lines beginning with the ‘#’ character, as well as whitespace at the beginning of lines, are ignored. The file may contain any commands boot accepts at the interactive prompt. Though default settings usually suffice, they can be changed here.

4.  The header line

        >> OpenBSD/zaurus BOOT [x.xx]

    is displayed to the active console, where x.xx is the version number of the boot program, followed by the

        boot>

    prompt, which means you are in interactive mode and may enter commands. If you do not, boot will proceed to load the kernel with the current parameters after the timeout period has expired.

By default, boot attempts to load the kernel executable /bsd. If it fails to find the kernel and no alternative kernel image has been specified, the system will be unable to boot.

COMMANDS
The following commands are accepted at the boot prompt:

boot [image [-acds]]
    Boots the kernel image specified by image with any options given. Image specification consists of a pair device:filename; either or both can be omitted (`:' is not needed if both are omitted), in which case values from boot variables will be used.

    When selecting the device to boot from, boot makes no distinction between SCSI and IDE type drives; they are detected as ‘hd’ devices. Therefore, to boot kernel /bsd from slice ‘a’ on the first hard drive (irrespective of device type), specify “boot hd0a:/bsd”.

    Note: Normally, the internal hard disk is designated by the device name ‘hd0’. If a CF hard disk is present in the socket when the system starts, the internal hard disk is instead designated by the prefix ‘hd1’, and ‘hd0’ will access the CF hard disk.

    -a  Causes the kernel to ask for the root device to use.

    -c  Causes the kernel to go into boot_config(8) before performing autoconf(4) procedures.

    -d  Causes the kernel to drop into ddb(4) at the earliest convenient point.

    -s  Causes the kernel to boot single-user.

clear
    Clears the console screen. This is useful if your bootstrap console doesn't scroll the screen automatically when the cursor is in the bottom line.

echo [args]
    Displays args on the console device.

help
    Prints a list of available commands and machine dependent commands, if any.

ls [directory]
    Prints contents of the specified directory in long format including: attributes and file type, owner, group, size, filename.

reboot
    Returns control to the primary bootstrap loader.

set [varname [value]]
    If invoked without arguments, prints a list of variables and their values. If only varname is specified, displays contents of that variable. If varname and value are both specified, sets that variable to the given value. Variables include:

    addr
        Address at which to load the kernel.
    debug
        Debug flag if boot was compiled with DEBUG defined.
    device
        Boot device name (e.g., hd0a).
    howto
        Options to pass to the loaded kernel.
    image
        File name containing the kernel image.
    timeout
        Number of seconds boot will wait for human intervention before booting the default kernel image.
    tty Active console device name (e.g., cn0, com0, com1).

stty [device [speed]]
    Displays or sets the speed for a console device. If changing the baudrate for the currently active console, boot offers you five seconds of grace time before committing the change to allow you to change your terminal's speed to match. If changing speed not for the active console, the baudrate is set for the next time you switch to a serial console.

    The default baudrate is 9600bps.

time
    Displays system time and date.

UPDATING BOOTBLOCKS
Since the bootblocks actually live in a Linux flash filesystem, a rather obtuse method must currently be used to upgrade them.

1.  Place zboot and zbsdmod.o onto an MS-DOS filesystem on a CF card, and then insert into the Zaurus.
2.  Remove power from the Zaurus.
3.  Unplug the battery.
4.  Start holding down the ‘b’ and ‘d’ keys.
5.  Wait 30 seconds, then re-insert the battery and power up the Zaurus.
6.  When you see text start to appear on the Zaurus, release the ‘b’ and ‘d’ keys.
7.  Login as root and perform the following steps:

        # mount /dev/mtdblock2 /tmp
        # cp /mnt/cf/z* /tmp/home/etc/rc.d
        # reboot

    An SD card with an MS-DOS filesystem may be used instead, in which case the Linux pathname will be /mnt/card instead of /mnt/cf.

FILES
/usr/mdec/zbsdmod.o
    kernel module for the primary bootstrap loader that must be loaded before the system bootstrap
/usr/mdec/zboot
    system bootstrap
/etc/boot.conf
    system bootstrap's startup file
/bsd
    kernel image
/bsd.rd
    kernel image for installation/recovery

EXAMPLES
Boot the default kernel:

    boot> boot

Remove the 5 second pause at boot-time permanently, causing boot to load the kernel immediately without prompting:

    # echo "boot" > /etc/boot.conf

Use serial console. A null modem cable should connect the specified serial port to a terminal. Useful for debugging.

    boot> set tty com0

Invoke the serial console at every boot:

    # echo "set tty com0" > /etc/boot.conf

Boot the kernel named /bsd from the second hard disk in “User Kernel Configuration” mode (see boot_config(8)). This mechanism allows for the explicit enabling and disabling of devices during the current boot sequence, as well as the modification of device parameters. Once booted, such changes can be made permanent by using config(8)'s -e option.

    boot> boot hd1a:/bsd -c

SEE ALSO
autoconf(4), ddb(4), boot_config(8), boot_zaurus(8), fdisk(8), reboot(8)

HISTORY
This program was written by Michael Shalayeff for OpenBSD 2.1, and adapted to zaurus by Uwe Stuehler for OpenBSD 3.7.

BUGS
Non-IDE disks can not be used to load /etc/boot.conf or the kernel from them.