SRM Firmware Howto v0.5, 17 August 1996 This document describes how to boot Linux/Alpha using the SRM firmware, which is the firmware normally used to boot DEC Unix. Generally, it is preferable to use MILO instead of aboot since MILO is perfectly adapted to the needs of Linux. However, MILO is not always available for a particular system and MILO does not presently have the ability to boot over the network. In either case, using the SRM console may be the right solution.

Unless you're interested in technical details, you may want to skip right to Section . How Does SRM Boot an OS?

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 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 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 If the checksum in the first sector is correct, SRM goes ahead and reads the The Raw Loader

The sources for this loader can be found in directory linux/arch/alpha/boot of the Linux kernel source distribution. It loads the Linux kernel by reading linux/include/asm-alpha/system.h. To build a raw loader, simply type /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.nh: The raw kernel image consisting of the /usr/src/linux/vmlinux. The extension

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 The aboot Loader

When using the SRM firmware, direct booting from various filesystems ( booting of executable object files (both ELF and ECOFF) booting compressed kernels network booting (using bootp) partition tables in DEC Unix format (which is compatible with BSD Unix partition tables) interactive booting and default configurations for SRM consoles that cannot pass long option strings Getting and Building aboot

The latest sources for . The description in this manual applies to Once you downloaded and extracted the latest tar file, take a look at the include/config.h to match your environment. Normally, you won't need to change anything when building under Linux, but it is always a good idea to double check. If you're satisfied with the configuration, simply type aboot This is the actual bootlx Same as above, but it contains only the text, data and bss segments---that is, this file is not an object file. sdisklabel/writeboot Utility to install tools/e2writeboot Utility to install tools/isomarkboot Utility to install tools/abootconf Utility to configure an installed Floppy Installation

The bootloader can be installed on a floppy using the /dev/fd0: fdformat /dev/fd0 mke2fs /dev/fd0 e2writeboot /dev/fd0 bootlx Harddisk Installation

Since the /dev/sda): swriteboot /dev/sda bootlx On a Jensen, you will want to leave some more space, since you need to write a kernel to this place, too---2MB should be sufficient when using compressed kernels. Use to write CD-ROM Installation

To make a CD-ROM bootable by SRM, simply build isomarkboot filesystem bootlx The command above assumes that Building the Linux Kernel

A bootable Linux kernel can be built with the following steps. During the cd /usr/src/linux make config make dep make boot

The last command will build the file arch/alpha/boot/vmlinux.gz which can then be copied to the disk from which you want to boot from. In our floppy disk example above, this would entail: mount /dev/fd0 /mnt cp arch/alpha/boot/vmlinux.gz /mnt umount /mnt Booting Linux

With the SRM firmware and

The Boot Filename

The filename argument takes the form: [ 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 , As a special case, partition number 0 is used to request booting from a disk that does not (yet) contain a file system. When specifying "partition" number 0, /dev/sda, one could use the command: swriteboot /dev/sda bootlx vmlinux.gz

Booting a system in this way is not normally necessary. The reason this feature exists is to make it possible to get Linux installed on a systems that can't boot from a floppy disk (e.g., the Jensen). 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). There are many more bootoptions, depending on what drivers your kernel has installed. The options listed below are therefore just examples to illustrate the general idea: /dev/fd0, /dev/sda2).

Some SRM implementations (e.g., the one for the Jensen) are handicapped and allow only short option strings (e.g., at most 8 characters). In such a case, boot dka0 -fl i aboot> 3/vmlinux.gz root=/dev/sda3 single Since booting in that manner quickly becomes tedious, /etc/aboot.conf. A sample # # aboot default configurations # 0:3/vmlinux.gz root=/dev/sda3 1:3/vmlinux.gz root=/dev/sda3 single 2:3/vmlinux.new.gz root=/dev/sda3 3:3/vmlinux root=/dev/sda3 8:- root=/dev/sda3 # fs-less boot of raw kernel 9:0/vmlinux.gz root=/dev/sda3 # fs-less boot of (compressed) ECOFF kernel - With this configuration file, the command boot dka0 -fl 1 corresponds exactly to the boot command shown above. It is quite easy to forget what number corresponds to what option string. To alleviate this problem, boot with option "h" and /etc/aboot.conf before issueing the prompt for the full option string. Finally, whenever /etc/aboot.conf Selecting the Partition of /etc/aboot.conf

When installed on a harddisk, /etc/aboot.conf file. A newly compiled /dev/sda2). Since it would be inconvenient to have to recompile /dev/sda, you'd use the command: abootconf /dev/sda 3 You can verify the current setting by simply omitting the partition number. That is: abootconf /dev/sda will print the currently selected partition number. Note that aboot.conf partition via the boot command line. This can be done with a command line of the form /etc/aboot.conf and /etc/aboot.conf from the third partition, prints its contents on the screen and waits for you to enter the boot options. Booting Over the Network

Two prelimenary steps are necessary before Linux can be booted via a network. First, you need to set the SRM environment variables to enable booting via the bootp protocol and second you need to setup another machine as the your boot server. Please refer to the SRM documentation that came with your machine for information on how to enable bootp. Setting up the boot server is obviously dependent on what operating system that machine is running, but typically it involves starting the program /etc/bootptab file. The myhost.cs.arizona.edu:\ :hd=/remote/:bf=vmlinux.bootp:\ :ht=ethernet:ha=08012B1C51F8:hn:vm=rfc1048:\ :ip=192.12.69.254:bs=auto: This entry assumes that the machine's Ethernet address is /remote. For more information on configuring /usr/src/linux/arch/alpha/boot/vmlinux.gz (edit the /remote/vmlinux.bootp. Next, power up the client machine and boot it, specifying the Ethernet adapter as the boot device. Typically, SRM calls the first Ethernet adapter boot ewa0 The Sharing a Disk With DEC Unix

Unfortunately, DEC Unix doesn't know anything about Linux, so sharing a single disk between the two OSes is not entirely trivial. However, it is not a difficult task if you heed the tips in this section. The section assumes you are using Partitioning the disk

First and foremost: /etc/disktab): rz26|RZ26|DEC RZ26 Winchester:\ :ty=winchester:dt=SCSI:ns#57:nt#14:nc#2570:\ :oa#0:pa#131072:ba#8192:fa#1024:\ :ob#131072:pb#262144:bb#8192:fb#1024:\ :oc#0:pc#2050860:bc#8192:fc#1024:\ :od#393216:pd#552548:bd#8192:fd#1024:\ :oe#945764:pe#552548:be#8192:fe#1024:\ :of#1498312:pf#552548:bf#8192:ff#1024:\ :og#393216:pg#819200:bg#8192:fg#1024:\ :oh#1212416:ph#838444:bh#8192:fh#1024: The interesting fields here are a b d e f |---|-------|-----------|-----------|-----------| c |-----------------------------------------------| g h |-----------------|-----------------| DEC Unix insists that partition :ta=unused:tb=swap:tg=4.2BSD:th=resrvd8: Now why do we mark partition disklabel -rw /dev/rrz5c rz26 You can verify that everything is all right by reading back the disklabel with disklabel -r /dev/rrz5c. At this point, you may want to reboot DEC Unix and make sure the existing DEC Unix partition is still alive and well. If that is the case, you can shut down the machine and start with the Linux installation. Be sure to skip the disk partitioning step during the install. Since we already installed a good partition table, you should be able to proceed and select the 8th partition as the Linux root partition and the 2nd partition as the swap partition. If the disk is, say, the second SCSI disk in the machine, then the device name for these partitions would be /dev/sdb8 and /dev/sdb2, respectively (note that Linux uses letters to name the drives and numbers to name the partitions, which is exactly reversed from what DEC Unix does; the Linux scheme makes more sense, of course ;-). Installing swriteboot -f1 -f3 /dev/sdb bootlx The boot dka5 -fi 8/vmlinux.gz -fl root=/dev/sdb8