14. How Do I Boot Linux/Alpha?

Contents of this section

14.1 Booting With MILO

The MILO installation and boot procedure is described in the MILO Howto .

14.2 Booting With SRM

All versions of SRM can boot from SCSI disks and the versions for recent platforms, such as the Noname or AlphaStations can boot from floppy disks as well. Network booting via bootp is supported by SRM, but not by Linux (adding this would be rather trivial, however). Notice that older SRM versions (notably the one for the Jensen) cannot boot from floppy disks. Also, booting from IDE disk drives is unsupported.

How Does SRM Boot an OS?

Booting Linux with SRM is a two step process: first, SRM loads and transfers control to the secondary bootstrap loader. Then the secondary bootstrap loader sets up the environment for Linux, reads the kernel image from a disk filesystem and finally transfers control to Linux.

Currently, there are two secondary bootstrap loaders for Linux: the raw loader that comes with the Linux kernel and aboot which is distributed separately. These two loaders are described in more detail below.

Loading The Secondary Bootstrap Loader

SRM knows nothing about filesystems or disk-partitions. It simply expects that the secondary bootstrap loader occupies a consecutive range of physical disk sector, starting from a given offset. The information on the size of the secondary bootstrap loader and the offset of its first disk sector is stored in the first 512 byte sector. Specifically, the long integer at offset 480 stores the size of the secondary bootstrap loader (in 512-byte blocks) and the long at offset 488 gives the sector number at which the secondary bootstrap loader starts. The first sector also stores a flag-word at offset 496 which is always 0 and a checksum at offset 504. The checksum is simply the sum of the first 63 long integers in the first sector.

If the checksum in the first sector is correct, SRM goes ahead and reads the size sectors starting from the sector given in the sector number field and places them in virtual memory at address 0x20000000. If the reading completes successfully, SRM performs a jump to address 0x20000000.

Raw Secondary Bootstrap Loader

The sources for this loader can be found in directory linux/arch/alpha/boot. It loads the Linux kernel by reading START_SIZE bytes starting at disk offset BOOT_SIZE+512 (also in bytes). The constants START_SIZE and BOOT_SIZE are defined in linux/include/asm-alpha/system.h. START_SIZE must be at least as big as the kernel image (i.e., the size of the .text, .data, and .bss segments). Similarly, BOOT_SIZE must be at least as big as the image of the raw bootstrap loader. Both constants should be an integer multiple of the sector size, which is 512 bytes. The defaults values are currently 2MB for START_SIZE and 16KB for BOOT_SIZE. Notice that if you want to boot from a 1.44MB floppy disk, you have to reduce START_SIZE to 1400KB and make sure that the kernel you want to boot is no bigger than that.

To build a raw loader, simply enable the corresponding lines in arch/alpha/boot/Makefile and the type make boot in /usr/src/linux. This should produce the following files in arch/alpha/boot:

tools/lxboot:

The first sector on the disk. It contains the offset and size of the next file in the format described above.

tools/bootlx:

The raw boot loader that will load the file below.

vmlinux:

The kernel image consisting of the .text, .data, and .bss segments of the object file in /usr/src/linux/vmlinux.

The concatenation of these three files should be written to the disk from which you want to boot. For example, to boot from a floppy, insert an empty floppy disk in, say, /dev/fd0 and then type:

cat tools/lxboot tools/bootlx vmlinux >/dev/fd0

You can then shutdown the system and boot from the floppy by issueing the command boot dva0.

aboot Secondary Bootstrap Loader

In many ways, aboot is simpler to use than the raw boot loader descriped above. aboot has the following features:

The sources for aboot are distributed separately and the latest version is always available in this ftp directory .

Once you downloaded and built aboot, you can install it on the harddisk or on a floppy using the cpboot command that comes with the BLADE distribution. For example, to install aboot on an empty floppy disk in drive /dev/fd0, you would typically issue the commands:

fdformat /dev/fd0
mke2fs /dev/fd0
e2writeboot /dev/fd0 aboot

A bootable kernel can then be built with the following steps:

cd /usr/src/linux
make
cp vmlinux arch/alpha/boot
quickstrip arch/alpha/boot/vmlinux
gzip arch/alpha/boot/vmlinux

(If you enable the corresponding lines in arch/alpha/boot/Makefile, you can simply type make boot to achieve the same effect.) The resulting file arch/alpha/boot/vmlinux.gz can then be copied to the disk from which you want to boot from. In our example above, this would entail:

mount /dev/fd0 /mnt
cp arch/alpha/boot/vmlinux.gz /mnt
umount /mnt

Linux can then be booted with a command of the form:

boot devicename -fi filename -fl flags

The filename and flags are optional. If they are not specified, SRM uses the default values stored in environment variables BOOT_OSFILE and BOOT_OSFLAGS. The syntax and meaning of these two arguments is described in more detail below.

Boot Filename

The filename argument takes the form:

[n/]filename

n is a single digit that gives the partition number from which to boot from. filename is the path of the file you want boot. For example to boot from the second partition of SCSI device 6, you would enter:

boot dka600 -file 2/vmlinux.gz

Or to boot from floppy drive 0, you'd enter:

boot dva0 -file /vmlinux.gz

If a disk has no partition table, aboot ignores the partition-number and assumes the file system starts at diskblock 0.

Boot Flags

A number of bootflags can be specified. The syntax is:

-flags "options..."
Where "options..." is any combination the following options (separated by blanks):

ramdisk=n

Copy root file system from a (floppy) disk to the RAM disk before starting the system. The RAM disk will be used in lieu of the root device. This is useful to bootstrap Linux on a system with only one floppy drive. The argument n should be the size of the disk in kilobytes. E.g., for a 3 1/2" floppy disk, you'd specify ramdisk=1440.

floppy=str

Sets floppy configuration to str.

root=dev

Select device dev as the root-file system. The device can be specified as a major/minor hex number (e.g., 0x802 for /dev/sda2) or one of a few canonical names (e.g., /dev/fd0, /dev/sda2).

single

Boot system in single user mode.

kgdb

Enable kernel-gdb (works only if CONFIG_KGDB is enabled; a second Alpha system needs to be connected over the serial port in order to make this work)


Next Chapter, Previous Chapter

Table of contents of this chapter, General table of contents

Top of the document, Beginning of this Chapter