<?xml version="1.0"?>
<article><artheader><title>SRM Firmware Howto</title><author><firstname><ulink url="mailto:rdp@alphalinux.org">Rich Payne</ulink>,
and <ulink url="mailto:dhuggins@linuxcare.com">David Huggins-Daines</ulink></firstname></author><pubdate>v0.8, 09 November 2000</pubdate><abstract><para>This document describes how to boot Linux/Alpha using the SRM console,
which is the console firmware also used to boot Compaq Tru64 Unix
(also known as Digital Unix and OSF/1) and OpenVMS.</para></abstract></artheader><sect1><title>About this manual</title><sect2><title>Who should read this manual</title><para>You should read this manual if you are installing Linux on a new
Alpha system that can only boot from the SRM console, or if you are
installing Linux on an older Alpha system that can use the SRM console
and wish to use SRM to boot your Linux installation.</para><para>Because SRM is the only way to boot Linux on modern Alpha systems,
and because it provides the proper operating environment for Unix and
Unix-like operating systems (such as Linux), it is the recommended way
of booting Linux on Alpha when available.</para><para>Sometimes, it is preferable to use the ARC, ARCSBIOS, or AlphaBIOS
console, such as if you have a machine for which SRM is not available,
if you wish to dual-boot with Windows NT without switching consoles,
or if you have hardware that is not supported by SRM.  On these
machines, you will typically use MILO to boot Linux.  For more
information, refer to the MILO Howto, available from
<ulink url="http://www.alphalinux.org/faq/milo.html">http://www.alphalinux.org/faq/milo.html</ulink>.</para></sect2><sect2><title>Conventions</title><para>Throughout this manual, we will use the following conventions for
commands to be entered by the user:</para><para>SRM console commands will be shown with the characteristic SRM
'ententent' prompt, like this: 
<footnote><para>On multiprocessor machines, you
will see 'P00entent' instead, or possibly some other number depending on
which processor SRM is running. </para></footnote>


<screen format="linespecific">ententent boot dva0 -fi linux.gz -fl "root=/dev/fd0 load_ramdisk=1"</screen>
</para><para>Unix commands will be shown with the 'ent' command prompt if they are
to be run as <literal moreinfo="none" remap="tt">root</literal>, or '$' if they are to be run by a normal user,
like this:

<screen format="linespecific"># swriteboot -f3 /dev/sda /boot/bootlx</screen>
</para><para>Aboot commands will be shown with the 'abootent' command prompt, like
this:

<screen format="linespecific">abootent b 6/boot/vmlinuz root=/dev/hda6</screen>
</para></sect2></sect1><sect1><title>What is SRM?</title><para>SRM console is used by Alpha systems as
Unix-style boot firmware. Tru64 Unix and OpenVMS depend on it and
Linux can boot from it. You can recognize SRM console as a blue screen
with a prompt that is presented to you on power-up.</para><sect2><title>Getting to SRM</title><para>Most Alpha systems have both the SRM and ARC/AlphaBIOS console in
their firmware.  On one of these machines, if your machine starts up
with ARC/AlphaBIOS by default, you can switch to SRM through the
"Console Selection" option in the Advanced CMOS Setup menu.  To make
the change permanent, you should set the <literal moreinfo="none" remap="tt">osenttype</literal> environment
variable in SRM to "OpenVMS" or "Unix", like this:

<screen format="linespecific">ententent set os_type Unix</screen>
</para><para>Either one will work to boot Linux.  However, if you intend to
dual-boot OpenVMS on this machine, you must set <literal moreinfo="none" remap="tt">osenttype</literal> to
"OpenVMS".  Conversely, to return to ARC/AlphaBIOS, you can set
<literal moreinfo="none" remap="tt">osenttype</literal> to "NT".</para><para>Some older systems may not have both SRM and ARC in firmware as
shipped.  On these systems, you will have to upgrade your firmware.
See <ulink url="http://ftp.digital.com/pub/DEC/Alpha/firmware/">http://ftp.digital.com/pub/DEC/Alpha/firmware</ulink> for the
latest firmware updates and instructions.</para><para>A few older systems (primarily evaluation boards such as the 164SX
and 164LX) are "half-flash" systems, whose firmware can hold SRM or
AlphaBIOS, but not both.  If you have one of these machines, you will
have to reflash your firmware with the SRM console using the AlphaBIOS
firmware update utility.  Again, see
<ulink url="http://ftp.digital.com/pub/DEC/Alpha/firmware/">http://ftp.digital.com/pub/DEC/Alpha/firmware</ulink> for firmware
images and instructions.  If you wish to return to AlphaBIOS on these
machines, you may rerun the firmware update utility from a floppy in
SRM using the <literal moreinfo="none" remap="tt">fwupdate</literal> command.  You can also start AlphaBIOS
from a floppy using the <literal moreinfo="none" remap="tt">arc</literal> command.</para></sect2><sect2><title>Using the SRM console</title><para>The SRM console works very much like a Unix or OpenVMS shell.  It
views your NVRAM and devices as a pseudo-filesystem.  You can see this
if you use the <literal moreinfo="none" remap="tt">ls</literal> command.  Also, it contains a fairly large set
of diagnostic, setup, and debugging utilities, the details of which
are beyond the scope of this document.  As in the Unix shell, you can
pipe the output of one command to the input of another, and there is a
<literal moreinfo="none" remap="tt">more</literal> command that works not unlike the Unix one.  To get a full
listing of available commands, run:

<screen format="linespecific">ententent help | more</screen>
</para><para>As well, SRM has environment variables, a number of which are
pre-defined and correspond to locations in NVRAM.  You can view the
entire list of environment variables and their values with the
<literal moreinfo="none" remap="tt">show</literal> command (there are quite a few of them, so you will probably
want to pipe its output to <literal moreinfo="none" remap="tt">more</literal>).  You can also show variables
matching a "glob" pattern - for example, <literal moreinfo="none" remap="tt">show boot*</literal> will show all
the variables starting in "boot".</para><para>Environment variables are categorized as either <emphasis>read-only</emphasis>,
<emphasis>warm non-volatile</emphasis>, or <emphasis>cold non-volatile</emphasis>.  The full listing
of pre-defined variables is detailed in the Alpha Architecture
Reference Manual.  The most useful pre-defined environment variables
for the purposes of booting Linux are <literal moreinfo="none" remap="tt">bootdefentdev</literal>,
<literal moreinfo="none" remap="tt">bootentfile</literal>, <literal moreinfo="none" remap="tt">bootentflags</literal>, and
<literal moreinfo="none" remap="tt">autoentaction</literal>, all of which are cold non-volatile.</para><para>To set environment variables, use the <literal moreinfo="none" remap="tt">set</literal> command, like this:

<screen format="linespecific">ententent set bootdef_def dka0</screen>
</para><para>If you set an undefined variable, it will be created for you, however
it will not persist across reboots.</para><para>The <literal moreinfo="none" remap="tt">bootdefentdev</literal> variable specifies the device (using
VMS naming conventions - see <xref linkend="device-naming"></xref> for an
explanation of these) which will be booted from if no device is
specified on the <literal moreinfo="none" remap="tt">boot</literal> command line, or in an automatic boot.
The <literal moreinfo="none" remap="tt">bootentfile</literal> variable contains the filename to be
loaded by the secondary bootloader, while <literal moreinfo="none" remap="tt">bootentflags</literal>
contains any extra flags.  <literal moreinfo="none" remap="tt">autoentaction</literal> specifies the
action which the console should take on power-up.  By default, it is
set to <literal moreinfo="none" remap="tt">HALT</literal>, meaning that the machine will start up in the
SRM console.  Once you have configured your bootloader and the
boot-related variables, you can set it to <literal moreinfo="none" remap="tt">BOOT</literal> in order to
boot automatically on power-up.</para><para>Finally, two helpful console keystrokes you should know are
Control-C, which, as in the shell, halts a command in progress (such
as an automatic boot), and Control-P, which if issued from the aboot
prompt (or other secondary bootloader) will halt the bootloader and
return you to the SRM console.</para></sect2><sect2 id="how-srm-boots"><title>How Does SRM Boot an OS?</title><para>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 <literal moreinfo="none" remap="tt">bootp</literal> is supported.
Note that older SRM versions (notably the one for the Jensen)
cannot boot from floppy disks. Booting from IDE devices
is supported on newer platforms ( 164SX, 164LX, 164UX, DS20, DS10, DP264, UP2000(+), UP1000, UP1100 etc..). </para><para>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.</para><para>Currently, there are two secondary bootstrap loaders for Linux:
the <emphasis>raw</emphasis> loader that comes with the Linux kernel and <literal moreinfo="none" remap="tt">aboot</literal>
which is distributed separately.  These two loaders are described in
more detail below.</para></sect2><sect2><title>Loading The Secondary Bootstrap Loader</title><para>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
<emphasis>size</emphasis> of the secondary bootstrap loader (in 512-byte blocks) and
the long at offset 488 gives the <emphasis>sector number</emphasis> 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.</para><para>If the checksum in the first sector is correct, SRM goes ahead and
reads the <emphasis>size</emphasis> sectors starting from the sector given in the
<emphasis>sector number</emphasis> field and places them in <emphasis>virtual</emphasis> memory at
address <literal moreinfo="none" remap="tt">0x20000000</literal>.  If the reading completes successfully,
SRM performs a jump to address <literal moreinfo="none" remap="tt">0x20000000</literal>.</para></sect2></sect1><sect1><title>SRM Device Naming</title><sect2><title>The First Two Letter</title><para>The following is based on the example device dkb1.2.3.4.5 taken from a Digital Server 3300 (Whitebox version of
an AS800).</para><para>Two letter port or class driver designator:
<itemizedlist><listitem><para>         DR:     RAID set device </para></listitem><listitem><para>         DV:     Floppy Drive </para></listitem><listitem><para>         EW:     Ethernet port (TULIP, DEC 21040) </para></listitem><listitem><para>         EI:     Ethernet port (Intel 82557 or 82559) </para></listitem><listitem><para>         PK:     SCSI port (controller) </para></listitem><listitem><para>         DK:     SCSI disk </para></listitem><listitem><para>         MK:     SCSI tape </para></listitem><listitem><para>         PU:     DSSI port </para></listitem><listitem><para>         DU:     DSSI disk </para></listitem><listitem><para>         MU:     DSSI tape </para></listitem><listitem><para>         JK:     SCSI monitor (or robot) </para></listitem><listitem><para>	 DQ:	 (E)IDE Device (disk or CD-ROM)</para></listitem></itemizedlist></para></sect2><sect2><title>The Rest Of The Device Name</title><para>
<itemizedlist><listitem><para> b-ent adapter ID (one letter adapter designator)</para></listitem><listitem><para> 1-entDevice number (SCSI unit numbers are forced to 100x Node ID)</para></listitem><listitem><para> 2-entBus Node ID</para></listitem><listitem><para> 3-entChannel Number</para></listitem><listitem><para> 4-entChannel Number (used for multi-channel devices)</para></listitem><listitem><para> 5-entLogical Slot number

  <itemizedlist><listitem><para>EISA: they correspond to the physical slot numbers (1-3)</para></listitem><listitem><para>PCI:</para><itemizedlist><listitem><para>slot 5= SCSI controller on system backplane (DS3300)</para></listitem><listitem><para>slot 6= On board VGA (DS3300)</para></listitem><listitem><para>slot 7= PCI to EISA bridge chip (DS3300)</para></listitem><listitem><para>slots 11 - 14 = Correspond to Physical PCI option slots:
                 PCI11, PCI12, PCI13 and PCI14 (64bit) (DS3300)</para></listitem></itemizedlist></listitem></itemizedlist></para></listitem><listitem><para> 6-entHose number: 0 PCI_0 (32bit PCI); 1 EISA (DS3300)</para></listitem></itemizedlist></para></sect2></sect1><sect1><title>The Raw Loader</title><para>The sources for this loader can be found in directory
<literal moreinfo="none" remap="tt">arch/alpha/boot</literal> of the Linux kernel source
distribution.  It loads the Linux kernel by reading
<literal moreinfo="none" remap="tt">STARTentSIZE</literal> bytes starting at disk offset
<literal moreinfo="none" remap="tt">BOOTentSIZE+512</literal> (also in bytes).  The constants
<literal moreinfo="none" remap="tt">STARTentSIZE</literal> and <literal moreinfo="none" remap="tt">BOOTentSIZE</literal> are defined in
<literal moreinfo="none" remap="tt">linux/include/asm-alpha/system.h</literal>.  <literal moreinfo="none" remap="tt">STARTentSIZE</literal>
must be at least as big as the kernel image (i.e., the size of the
<literal moreinfo="none" remap="tt">.text</literal>, <literal moreinfo="none" remap="tt">.data</literal>, and <literal moreinfo="none" remap="tt">.bss</literal> segments).  Similarly,
<literal moreinfo="none" remap="tt">BOOTentSIZE</literal> 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 default values are currently 2MB
for <literal moreinfo="none" remap="tt">STARTentSIZE</literal> and 16KB for <literal moreinfo="none" remap="tt">BOOTentSIZE</literal>.  Note
that if you want to boot from a 1.44MB floppy disk, you have to reduce
<literal moreinfo="none" remap="tt">STARTentSIZE</literal> to 1400KB and make sure that the kernel you
want to boot is no bigger than that.</para><para>To build a raw loader, simply type <literal moreinfo="none" remap="tt">make rawboot</literal> in the top
directory of your linux source tree (typically
<literal moreinfo="none" remap="tt">/usr/src/linux</literal>).  This should produce the following files in
<literal moreinfo="none" remap="tt">arch/alpha/boot</literal>:</para><para><variablelist><varlistentry><term><literal moreinfo="none" remap="tt">tools/lxboot</literal>:</term><listitem><para>The first
sector on the disk.  It contains the offset and size of
the next file in the format described above.</para></listitem></varlistentry><varlistentry><term><literal moreinfo="none" remap="tt">tools/bootlx</literal>:</term><listitem><para>The raw boot loader that
will load the file below.</para></listitem></varlistentry><varlistentry><term><literal moreinfo="none" remap="tt">vmlinux.nh</literal>:</term><listitem><para>The raw kernel image consisting of
the <literal moreinfo="none" remap="tt">.text</literal>, <literal moreinfo="none" remap="tt">.data</literal>, and <literal moreinfo="none" remap="tt">.bss</literal> segments of the
object file in <literal moreinfo="none" remap="tt">/usr/src/linux/vmlinux</literal>.  The
extension <literal moreinfo="none" remap="tt">.nh</literal> indicates that this file has no object-file
header.</para></listitem></varlistentry></variablelist></para><para>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, <literal moreinfo="none" remap="tt">/dev/fd0</literal> and then type:

<screen format="linespecific"># cat tools/lxboot tools/bootlx vmlinux ent/dev/fd0</screen>
</para><para>You can then shutdown the system and boot from the floppy by
issuing the command <literal moreinfo="none" remap="tt">boot dva0</literal>.</para></sect1><sect1 id="aboot"><title>The aboot Loader</title><para>When using the SRM firmware, <literal moreinfo="none" remap="tt">aboot</literal> is the preferred way of
booting Linux.  It supports:</para><para>
<itemizedlist><listitem><para> direct booting from various filesystems (<literal moreinfo="none" remap="tt">ext2</literal>, <literal moreinfo="none" remap="tt">ISO9660</literal>, and
<literal moreinfo="none" remap="tt">UFS</literal>, the DEC Unix filesystem)</para></listitem><listitem><para> listing directories and following symbolic links on ext2 (version 0.6 and later)</para></listitem><listitem><para> booting of executable object files (both ELF and ECOFF)</para></listitem><listitem><para> booting compressed kernels</para></listitem><listitem><para> network booting (using bootp)</para></listitem><listitem><para> partition tables in DEC Unix format (which is
compatible with BSD Unix partition tables)</para></listitem><listitem><para> interactive booting and default configurations for
SRM consoles that cannot pass long option strings</para></listitem><listitem><para> load initrd images to load modules at boot time (0.7 and later)</para></listitem></itemizedlist>
</para><sect2><title>Getting and Building aboot</title><para>The latest sources for <literal moreinfo="none" remap="tt">aboot</literal> are available from <ulink url="ftp://ftp.alphalinux.org/pub/Linux-Alpha/aboot">alphalinux.org</ulink> and <ulink url="http://www.alphalinux.org/mirrors">alphalinux.org mirrors</ulink>. They can
also be obtained via CVS from www.alphalinux.org, to get the latest version from CVS use these commands:
<screen format="linespecific">bash$ export CVSROOT=':pserver:anonymous@www.alphalinux.org:/home/axplinux/cvs/development'
bash$ cvs login
bash# cvs -z3 co aboot</screen>
(Note there is no password for the CVS login, just press enter)</para><para>The description in this manual applies to <literal moreinfo="none" remap="tt">aboot</literal> version 0.6
or newer. Please note that many distributions ship aboot with them so
downloading aboot from this directory is probably not neccesary.</para><para> Once you downloaded and extracted the latest tar file, take a
look at the <literal moreinfo="none" remap="tt">README</literal> and <literal moreinfo="none" remap="tt">INSTALL</literal> files for
installation hints.  In particular, be sure to adjust the variables in
<literal moreinfo="none" remap="tt">Makefile</literal> and in <literal moreinfo="none" remap="tt">include/config.h</literal> 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 <literal moreinfo="none" remap="tt">make</literal>
to build it (if you're not building under Linux, be advised that
<literal moreinfo="none" remap="tt">aboot</literal> requires GNU <literal moreinfo="none" remap="tt">make</literal>).</para><para>After running <literal moreinfo="none" remap="tt">make</literal>, the <literal moreinfo="none" remap="tt">aboot</literal> directory should contain the
following files:</para><para><variablelist><varlistentry><term>aboot</term><listitem><para>This is the actual <literal moreinfo="none" remap="tt">aboot</literal> executable (either an
ECOFF or ELF object file).</para></listitem></varlistentry><varlistentry><term>bootlx</term><listitem><para>Same as above, but it contains only the text, data
and bss segments---that is, this file is not an object file.</para></listitem></varlistentry><varlistentry><term>sdisklabel/writeboot</term><listitem><para>Utility to install <literal moreinfo="none" remap="tt">aboot</literal> on a
hard disk.</para></listitem></varlistentry><varlistentry><term>tools/e2writeboot</term><listitem><para>Utility to install <literal moreinfo="none" remap="tt">aboot</literal> on an ext2
filesystem (usually used for floppies only).</para></listitem></varlistentry><varlistentry><term>tools/isomarkboot</term><listitem><para>Utility to install <literal moreinfo="none" remap="tt">aboot</literal> on a iso9660
filesystem (used by CD-ROM distributors).</para></listitem></varlistentry><varlistentry><term>tools/abootconf</term><listitem><para>Utility to configure an installed <literal moreinfo="none" remap="tt">aboot</literal>.</para></listitem></varlistentry></variablelist></para></sect2><sect2><title>Floppy Installation</title><para> The bootloader can be installed on a floppy using the
<literal moreinfo="none" remap="tt">e2writeboot</literal> command (note: this can't be done on a Jensen since
its firmware does <emphasis>not</emphasis> support booting from floppy).  This command
requires that the disk is not overly fragmented as it needs to find
enough contiguous file blocks to store the entire <literal moreinfo="none" remap="tt">aboot</literal> image
(currently about 90KB).  If <literal moreinfo="none" remap="tt">e2writeboot</literal> fails because of this,
reformat the floppy and try again (e.g., with <literal moreinfo="none" remap="tt">fdformat(1)</literal>).  For
example, the following steps install <literal moreinfo="none" remap="tt">aboot</literal> on floppy disk
assuming the floppy is in drive <literal moreinfo="none" remap="tt">/dev/fd0</literal>:

<screen format="linespecific"># fdformat /dev/fd0
# mke2fs /dev/fd0
# e2writeboot /dev/fd0 bootlx</screen>
</para></sect2><sect2><title>Harddisk Installation</title><para>Since the <literal moreinfo="none" remap="tt">e2writeboot</literal> command may fail on highly fragmented
disks and since reformatting a harddisk is not without pain, it is
generally safer to install <literal moreinfo="none" remap="tt">aboot</literal> on a harddisk using the
<literal moreinfo="none" remap="tt">swriteboot</literal> command.  <literal moreinfo="none" remap="tt">swriteboot</literal> requires that the first few
sectors are reserved for booting purposes.  We suggest that the disk
be partitioned such that the first partition starts at an offset of
2048 sectors.  This leaves 1MB of space for storing <literal moreinfo="none" remap="tt">aboot</literal>.  On
a properly partitioned disk, it is then possible to install <literal moreinfo="none" remap="tt">aboot</literal>
as follows (assuming the disk is <literal moreinfo="none" remap="tt">/dev/sda</literal>):

<screen format="linespecific"># swriteboot /dev/sda bootlx</screen>
</para><para>On systems where partition <literal moreinfo="none" remap="tt">c</literal> in the entire disk it will be
necessary to 'force' the write of aboot. In this case use the <literal moreinfo="none" remap="tt">-f</literal>
flag followed by the partition number (in the case of partition <literal moreinfo="none" remap="tt">c</literal>
this is 3):

<screen format="linespecific"># swriteboot /dev/sda bootlx -f3</screen>
</para><para>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 <literal moreinfo="none" remap="tt">swriteboot</literal> as described in Section
<xref linkend="booting"></xref> to write <literal moreinfo="none" remap="tt">bootlx</literal> together with the Linux
kernel.</para></sect2><sect2><title>CD-ROM Installation</title><para> To make a CD-ROM bootable by SRM, simply build <literal moreinfo="none" remap="tt">aboot</literal> as
described above.  Then, make sure that the <literal moreinfo="none" remap="tt">bootlx</literal> file is present
on the iso9660 filesystem (e.g., copy <literal moreinfo="none" remap="tt">bootlx</literal> to the directory
that is the filesystem master, then run <literal moreinfo="none" remap="tt">mkisofs</literal> on that
directory).  After that, all that remains to be done is to mark the
filesystem as SRM bootable.  This is achieved with a command of the
form:

<screen format="linespecific"># isomarkboot filesystem bootlx</screen>
</para><para>The command above assumes that <literal moreinfo="none" remap="tt">filesystem</literal> is a file containing
the iso9660 filesystem and that <literal moreinfo="none" remap="tt">bootlx</literal> has been copied into the
root directory of that filesystem.  That's it!</para></sect2><sect2 id="building-linux"><title>Building the Linux Kernel</title><para>A bootable Linux kernel can be built with the following steps.
During the <literal moreinfo="none" remap="tt">make config</literal>, be sure to answer "yes" to the question
whether you want to boot the kernel via SRM (for certain platforms
this is automatically selected).  Note that if you build a generic
kernel (by selecting "Generic" as the alpha system type), the kernel
is able to guess whether it is running under SRM or not.

<screen format="linespecific"># cd /usr/src/linux
# make config
# make dep
# make boot
# make modules (if applicable)
# make modules_install (if applicable)</screen>
</para><para>The last command will build the file
<literal moreinfo="none" remap="tt">arch/alpha/boot/vmlinux.gz</literal> which can then be copied to the
disk from which you want to boot from.  In our floppy disk example
above, this would entail:

<screen format="linespecific"># mount /dev/fd0 /mnt
# cp arch/alpha/boot/vmlinux.gz /mnt
# umount /mnt</screen>
</para></sect2><sect2 id="booting"><title>Booting Linux</title><para> With the SRM firmware and <literal moreinfo="none" remap="tt">aboot</literal> installed, Linux is generally
booted with a command of the form:

<screen format="linespecific"><literal moreinfo="none" remap="tt">boot</literal> <emphasis remap="it">devicename</emphasis> <literal moreinfo="none" remap="tt">-fi</literal> <emphasis remap="it">filename</emphasis>
<literal moreinfo="none" remap="tt">-fl</literal> <emphasis remap="it">flags</emphasis></screen>
</para><para>The <emphasis remap="it">filename</emphasis> and <emphasis remap="it">flags</emphasis> arguments are optional.  If
they are not specified, SRM uses the default values stored in
environment variables <literal moreinfo="none" remap="tt">BOOTDEFentDEV</literal> ,
<literal moreinfo="none" remap="tt">BOOTentOSFILE</literal> and <literal moreinfo="none" remap="tt">BOOTentOSFLAGS</literal>.  The
syntax and meaning of these two arguments is described in more detail
below. To list the current values of these variables type <literal moreinfo="none" remap="tt">show
boot*</literal> at the SRM command prompt. This will also show a
bootentdev variable (among others), this variable is read only
and needs to be changed via the bootdefentdev variable.</para><sect3 id="device-naming"><title>Device Naming</title><para>This corresponds to the device from which SRM will attempt to boot. Examples include:</para><para><variablelist><varlistentry><term>dva0</term><listitem><para>- First floppy drive, <literal moreinfo="none" remap="tt">/dev/fd0</literal> under Linux</para></listitem></varlistentry><varlistentry><term>dqa0</term><listitem><para>- Primary IDE cdrom or hard disk as Master, <literal moreinfo="none" remap="tt">/dev/hda</literal> under Linux</para></listitem></varlistentry><varlistentry><term>dqa1</term><listitem><para>- Primary IDE cdrom or hard disk as Slave, <literal moreinfo="none" remap="tt">/dev/hdb</literal> under Linux</para></listitem></varlistentry><varlistentry><term>dka0</term><listitem><para>- SCSI disk on first bus, Device 0, <literal moreinfo="none" remap="tt">/dev/sda</literal> under Linux</para></listitem></varlistentry><varlistentry><term>ewa0</term><listitem><para>- First Ethernet Device, <literal moreinfo="none" remap="tt">/dev/eth0</literal> under Linux</para></listitem></varlistentry></variablelist></para><para>For example to boot from the disk at SCSI id 6, you would enter:

<screen format="linespecific">ententent boot dka600</screen>
</para><para>To list the devices currently installed in the system type <literal moreinfo="none" remap="tt">show
dev</literal> at the SRM command line.  In contrast to Linux device naming, the
partition number on a disk device is <emphasis>not</emphasis> given as part of the
device name (you may see extra numbers after the device names when
running <literal moreinfo="none" remap="tt">show dev</literal> - these correspond to things like PCI bus and
device numbers and are not useful to the user).  Remember, as
mentioned in <xref linkend="how-srm-boots"></xref>, that SRM knows <emphasis>nothing</emphasis>
about partitions or disklabels - it merely reads a boot block and
secondary bootstrap from sectors on a disk.  Therefore, the partition
number is given as part of the boot filename.</para></sect3><sect3><title>Boot Filename</title><para>The filename argument takes the form:
<quote>ent<emphasis>n</emphasis>/ent<emphasis>filename</emphasis></quote></para><para><emphasis>n</emphasis> is a single digit in the range 1..8 that gives the partition
number from which to boot from.  <emphasis>filename</emphasis> is the path of the file
you want boot.  For example to boot a kernel named vmlinux.gz from the second partition of SCSI
device 6, you would enter:

<screen format="linespecific">ententent boot dka600 -file 2/vmlinux.gz</screen>
</para><para>Or to boot from floppy drive 0, you'd enter:

<screen format="linespecific">ententent boot dva0 -file vmlinux.gz</screen>
</para><para>If a disk has no partition table, <literal moreinfo="none" remap="tt">aboot</literal> pretends the disk
contains one <literal moreinfo="none" remap="tt">ext2</literal> partition starting at the first diskblock.
This allows booting from floppy disks.</para><para>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, <literal moreinfo="none" remap="tt">aboot</literal> assumes that the Linux
kernel is stored right behind the <literal moreinfo="none" remap="tt">aboot</literal> image.  Such a layout
can be achieved with the <literal moreinfo="none" remap="tt">swriteboot</literal> command.  For example, to
setup a filesystem-less boot from <literal moreinfo="none" remap="tt">/dev/sda</literal>, one could use
the command:

<screen format="linespecific"># swriteboot /dev/sda bootlx vmlinux.gz</screen>
</para><para>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).</para></sect3><sect3><title>Boot Flags</title><para>A number of bootflags can be specified.  The syntax is:

<screen format="linespecific">-flags "options..."</screen>
</para><para>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:</para><para><variablelist><varlistentry><term>loadentramdisk=1</term><listitem><para>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.</para></listitem></varlistentry><varlistentry><term>floppy=<emphasis>str</emphasis></term><listitem><para>Sets floppy configuration to <emphasis>str</emphasis>.</para></listitem></varlistentry><varlistentry><term>root=<emphasis>dev</emphasis></term><listitem><para>Select device <emphasis>dev</emphasis> 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.,
<literal moreinfo="none" remap="tt">/dev/fd0</literal>, <literal moreinfo="none" remap="tt">/dev/sda2</literal>).</para></listitem></varlistentry><varlistentry><term>single</term><listitem><para>Boot system in single user mode.</para></listitem></varlistentry><varlistentry><term>kgdb</term><listitem><para>Enable kernel-gdb (works only if <literal moreinfo="none" remap="tt">CONFIGentKGDB</literal> is
enabled; a second Alpha system needs to be connected over the serial
port in order to make this work)</para></listitem></varlistentry></variablelist></para><para>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, <literal moreinfo="none" remap="tt">aboot</literal> can be booted with the
single-character boot flag "i".  With this flag, <literal moreinfo="none" remap="tt">aboot</literal> will
enter interactive mode</para></sect3><sect3><title>Using aboot interactively</title><para>As of version 0.6, <literal moreinfo="none" remap="tt">aboot</literal> supports a simple command-oriented
interactive mode.  Note that this is <emphasis>different</emphasis> from the prompt
which previous versions issued when booted with the "i" flag, or after
failing to load a kernel.  You can get a summary of the available
commands by typing "h" or "?" at the prompt:

<screen format="linespecific">ententent boot dka0 -fl i
abootent ?
 h, ?                   Display this message
 q                      Halt the system and return to SRM
 p 1-8                  Look in partition entnument for configuration/kernel
 l                      List pre-configured kernels
 d entdirent                List directory entdirent in current filesystem
 b entfileent entargsent        Boot kernel in entfileent (- for raw boot)
                        with arguments entargsent
 0-9                    Boot pre-configuration 0-9 (list with 'l')
abootent b 3/vmlinux.gz root=/dev/sda3 single</screen>
</para></sect3><sect3><title>The aboot.conf configuration file</title><para>Since booting in that manner quickly becomes tedious, <literal moreinfo="none" remap="tt">aboot</literal>
allows to define short-hands for frequently used command lines.  In
particular, a single digit option (0-9) requests that <literal moreinfo="none" remap="tt">aboot</literal> uses
the corresponding option string stored in file
<literal moreinfo="none" remap="tt">/etc/aboot.conf</literal>.  A sample <literal moreinfo="none" remap="tt">aboot.conf</literal> is shown below:

<screen format="linespecific">#
# 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
-</screen>
</para><para>With this configuration file, the command

<screen format="linespecific">ententent boot dka0 -fl 1</screen>

corresponds exactly to the boot command shown above.</para><para>Finally, at the <literal moreinfo="none" remap="tt">aboot</literal> prompt, it is possible to enter one of the
single character flags ("0"-"9") to get the same effect as if that
flag had been specified in the boot command line.  As noted in the
help text cited above, you can also list the available default
configurations with the "l" command.</para><sect4><title>Selecting the Partition of /etc/aboot.conf</title><para>When installed on a harddisk, <literal moreinfo="none" remap="tt">aboot</literal> needs to know what
partition to search for the <literal moreinfo="none" remap="tt">/etc/aboot.conf</literal> file.  A newly
compiled <literal moreinfo="none" remap="tt">aboot</literal> will search the <emphasis>second</emphasis> partition (e.g.,
<literal moreinfo="none" remap="tt">/dev/sda2</literal>).  Since it would be inconvenient to have to
recompile <literal moreinfo="none" remap="tt">aboot</literal> just to change the partition number,
<literal moreinfo="none" remap="tt">abootconf</literal> allows to directly modify an installed <literal moreinfo="none" remap="tt">aboot</literal>.
Specifically, if you want to change <literal moreinfo="none" remap="tt">aboot</literal> to use the <emphasis>third</emphasis>
partition on disk <literal moreinfo="none" remap="tt">/dev/sda</literal>, you'd use the command:

<screen format="linespecific"># abootconf /dev/sda 3</screen></para><para>You can verify the current setting by simply omitting the partition
number.  That is: <literal moreinfo="none" remap="tt">abootconf /dev/sda</literal> will print the currently
selected partition number.  Note that <literal moreinfo="none" remap="tt">aboot</literal> does have to be
installed already for this command to succeed.  As of version 0.6,
<literal moreinfo="none" remap="tt">swriteboot</literal> it will preserve the existing configuration when
installing a new <literal moreinfo="none" remap="tt">aboot</literal> on a hard disk.</para><para>Since <literal moreinfo="none" remap="tt">aboot </literal> version 0.5, it is also possible to select the
<literal moreinfo="none" remap="tt"> aboot.conf </literal> partition via the boot command line. This can be
done with a command line of the form <emphasis remap="it">a</emphasis><literal moreinfo="none" remap="tt">:</literal><emphasis remap="it">b</emphasis>
where <emphasis remap="it">a</emphasis>
is the partition that holds <literal moreinfo="none" remap="tt">/etc/aboot.conf</literal> and <emphasis remap="it">b</emphasis> is a
single-letter option as described above (<literal moreinfo="none" remap="tt">0</literal>-<literal moreinfo="none" remap="tt">9</literal>, <literal moreinfo="none" remap="tt">i</literal>, or
<literal moreinfo="none" remap="tt">h</literal>). For example, if you type <literal moreinfo="none" remap="tt">boot -fl "3:h" dka100</literal> the
system boots from SCSI ID 1, loads <literal moreinfo="none" remap="tt">/etc/aboot.conf</literal> from the
third partition, prints its contents on the screen and waits for you
to enter the boot options.</para></sect4></sect3></sect2><sect2 id="dhcp-and-bootpd-server-setup"><title>Setting up a BOOTP capable server using DHCP</title><para>The following configuration assumes that the server is running RH-6.2. 
Prerequisites packages are,
<itemizedlist><listitem><para>dhcp-2.0.5 </para></listitem><listitem><para>tftp-server-0.16.5</para></listitem></itemizedlist>
</para><sect3><title>DHCP ent BOOTP configuation</title><para>Once those packages are installed there are a few setup issues to take care of.</para><para>Create the default directory to which files will be pulled from using tftp.</para><screen format="linespecific"># mkdir /tftpboot</screen><para>Create the dhcp.leases file which is not create per default (though it should be) when
you install the dhcp package so the dhcp server may start. </para><screen format="linespecific"># mkdir -p /var/state/dhcp
# touch /var/state/dhcp/dhcpd.leases</screen><para>Configure the inetd to accept the tftp service. Edit your /etc/inetd.conf file and locate
the following line. Then uncomment it and save the file.</para><screen format="linespecific">#tftp	dgram	udp	wait	root	/usr/sbin/tcpd	in.tftpd</screen><para>Create the /etc/dhcp.conf configuation file. An example config
is provided below with the directives which allow BOOTP. </para><screen format="linespecific">subnet 192.168.1.0 netmask 255.255.255.0 {
       option routers                        192.168.1.1;
       option subnet-mask                  255.255.255.0;
       option nis-domain                "alphalinux.org";
       option domain-name	        "alphalinux.org";
       option domain-name-servers            192.168.1.2;
       range                 192.168.1.3   192.168.1.254;
       range dynamic-bootp   192.168.1.3   192.168.1.254;
       default-lease-time                          21600;
       max-lease-time                              43200;
       allow bootp;
       allow booting;
       filename "/tftpboot/vmlinux.bootp";	
}                                 </screen><sect4><title>Examination of /etc/dhcp.conf</title><para>There are four directives that you should be concerned with.</para><itemizedlist><listitem><para><literal moreinfo="none" remap="tt">range dynamic-bootp 192.168.1.3 192.168.1.254;</literal>
which defines the range of ip's available for bootp.</para></listitem><listitem><para> 
<literal moreinfo="none" remap="tt">allow bootp;</literal>
which tells the dhcp server to allow the bootp protocol..</para></listitem><listitem><para> 
<literal moreinfo="none" remap="tt">allow booting;</literal>
which tells the dhcp server to allow the transfer of the file specified 
either in the the "filename" directive or passed in the "-file" flag in SRM. </para></listitem><listitem><para> 
<literal moreinfo="none" remap="tt">filename "/tftpboot/vmlinux.bootp";</literal>
 which is the default file which is transferred and executed when no filename 
specified in SRM as an argument. </para></listitem></itemizedlist><para>Lastly, Restart the inetd daemon so that the changes we made can take effect</para><screen format="linespecific"># service inet restart</screen><para>You should now have a DHCP server that is capable of BOOTP.</para></sect4></sect3><sect3><title id="bootpd-setup">bootpd configuration</title><para>The bootpd is the older way of making a bootp server and for the most part is not used anymore
in lieu of more modern DHCP servers that are capable of handling the protocol with minimal configuration
and more flexibility. This style of setup does not allow just any client to be granted a BOOTP request. 
Instead you must specify the ip address and MAC address of the allowed clients. Naturally this could get
quite tedious if you where say administrating more than a few machines. </para><para>bootpd rpms can be found on older versions of RedHat's distributions like version 5.2 and below. Note:
the rpm itself is named bootp though the package does contain the bootpd filename. It is available
for download at your favorite RedHat <ulink url="ftp://ftp.freesoftware.com/.1/linux/redhat/old-releases/redhat-5.2/alpha/RedHat/RPMS/">mirror</ulink>.
The bootp package requires the tftp-server just as before and the location to where the files are grabbed from is the same.  </para><para>Once installed you must configure your inetd service to talk to the bootpd daemon. Uncomment the following line in your /etc/inetd.conf .</para><screen format="linespecific">#bootps dgram   udp     wait    root    /usr/sbin/tcpd  bootpd</screen><para>Then restart the inetd.</para><screen format="linespecific"># service inet restart</screen><para>Configuring the <literal moreinfo="none" remap="tt">/etc/bootptab</literal> file.  The <literal moreinfo="none" remap="tt">bootptab</literal> file
has one entry describing each client that is allowed to boot from
the server.  For example, if you want to boot the machine
<literal moreinfo="none" remap="tt">voodoo.alphalinux.org</literal>, then an entry of the following form would
be needed:

<screen format="linespecific">voodoo.alphalinux.org:\
	:hd=/tftpboot/:bf=vmlinux.bootp:\
	:ht=ethernet:ha=08012B1C51F8:hn:vm=rfc1048:\
	:ip=192.12.69.254:bs=auto:</screen>
</para><para>This entry assumes that the machine's Ethernet address is
<literal moreinfo="none" remap="tt">08012B1C51F8</literal> and that its IP address is 192.12.69.254.  The
Ethernet address can be found with the <literal moreinfo="none" remap="tt">show device</literal> command of the
SRM console or, if Linux is running, with the <literal moreinfo="none" remap="tt">ifconfig</literal> command.
The entry also defines that if the client does not specify otherwise,
the file that will be booted is <literal moreinfo="none" remap="tt">vmlinux.bootp</literal> in directory
<literal moreinfo="none" remap="tt">/tftpboot</literal>.  For more information on configuring <literal moreinfo="none" remap="tt">bootpd</literal>,
please refer to its man page.</para></sect3></sect2><sect2 id="network-booting"><title>Booting Over the Network</title><para>Three steps are necessary before Linux can be booted via
a network.  First you need an Ethernet adapter that is supported by SRM.
Most version of SRM support the DE500 series of cards, with newer
versions (5.6 and later) also supporting the Intel EtherExpress/Pro series
of cards.
Second, you need to set the SRM environment variables to
enable booting via the bootp protocol and third you need to setup
another machine as the your boot server.  Enabling bootp in SRM is
usually done by setting the ewa0entprotocol (DE500 cards) or eia0entprotocol (Intel cards) variable to bootp.

<screen format="linespecific">ententent set ewa0_protocol bootp</screen></para><para>Also check to see that your ethernet device has a link light to whatever hub or switch it is connected to. If you
do not see a link light try forcing the negotiation of the ethernet device. For example:</para><screen format="linespecific">ententent set ewa0_mode FastFD</screen><para> Would set the DE500 ethernet card to fast full duplex operation. To see a list of the available modes</para><screen format="linespecific">ententent set ewa0_mode </screen><para>Netboot using the aboot sources is currently broken though for the curious the steps needed are further below. Instead use the directions for netbooting using the kernel sources. </para><sect3><title>Netboot using the kernel sources</title><para><orderedlist inheritnum="ignore" continuation="restarts"><listitem><para>Make sure the kernel you want to boot has already been built </para></listitem><listitem><para>Execute the following while in the linux source dir: 
  <itemizedlist><listitem><para>    <literal moreinfo="none">make bootimage</literal> 
  </para></listitem><listitem><para>    <literal moreinfo="none">make bootpfile</literal>
  </para></listitem></itemizedlist></para><para>This creates a uncompressed kernel named 'bootpfile' located in arch/alpha/boot/ . Note that this kernel is 
significantly larger than that produced by the aboot sources. </para></listitem><listitem><para>Copy bootpfile to the bootp server's directory. With a default setup the tftp server would look in 
    /tftpboot so copy bootpfile into /tftpboot . 
  </para></listitem></orderedlist></para></sect3><sect3><title>Netboot using the aboot sources</title><para><orderedlist inheritnum="ignore" continuation="restarts"><listitem><para>Build aboot with with the command <literal moreinfo="none">make netboot</literal>. </para></listitem><listitem><para>Make sure the kernel that you want to boot has been built already. 

    By default, the aboot Makefile uses the kernel in /usr/src/linux/arch/alpha/boot/vmlinux.gz (edit the 
    Makefile if you want to use a different path). The result of make netboot is a file called vmlinux.bootp 
    which contains aboot and the Linux kernel, ready for network booting. </para></listitem><listitem><para>
Copy vmlinux.bootp to the bootp server's directory. In the example above, you'd copy it into /tftpboot/vmlinux.bootp. </para></listitem></orderedlist></para><para>Next, power up the client machine and boot it, specifying the Ethernet adapter as the boot device. Typically, SRM calls the DEC based Ethernet adapter ewa0 and the Intel based adapter
eia0, so to boot from that device, you'd use the command: 
<screen format="linespecific">      ententent boot ewa0 </screen></para><para>The -fi and -fl options can be used as usual. For example, </para><para><screen format="linespecific">      ententent boot ewa0 -fi  bootpfile -fl "root=/dev/hda2" </screen></para><para>In particular, you can ask aboot to prompt for Linux kernel arguments by specifying the option 
-fl i .  </para></sect3><sect3><title>Updating the SRM console through BOOTP</title><para>Updating your SRM console over the network through BOOTP is just as easy as booting the Linux kernel
in the same manner. The hardware prerequisites are the same as netbooting Linux. </para><para>First you have to obtain an SRM image that is able to BOOTP over the network. These images normally
have a .exe extension. For DEC/Compaq Alpha products these images can be found at 
<ulink url="ftp://gatekeeper.dec.com/pub/DEC/Alpha/firmware/v5.8/">ftp://gatekeeper.dec.com/pub/DEC/Alpha/firmware/v5.8/</ulink>. You can also find these files on the Alpha Systems Firmware Update CD-ROM. <ulink url="http://www.api-networks.com">API NetWorks</ulink> does not offer net bootable SRM images at this time though that may change in the near future.</para><para>For example say you had a DS20 and wanted to update it's firmware over the network using BOOTP. You would have to,
<orderedlist inheritnum="ignore" continuation="restarts"><listitem><para>Get the correct firmware image for the DS20 that supported BOOTP execution which in this case the filename is 
<literal moreinfo="none" remap="tt">ds20_v5_8.exe </literal> from  <ulink url="ftp://gatekeeper.dec.com/pub/DEC/Alpha/firmware/v5.8/">ftp://gatekeeper.dec.com/pub/DEC/Alpha/firmware/v5.8/</ulink>.</para></listitem><listitem><para>Copy the file to the /tftpboot folder located on the BOOTP server.</para></listitem></orderedlist></para><para>To execute the update from SRM you would do the following:</para><screen format="linespecific">ententent b ewa0 -fi ds20_v5_8.exe</screen><para>SRM would then proceed to upgrade the firmware in the same fashion as if you had done the firmware update from a CD.</para></sect3></sect2><sect2><title>Partitioning Disks</title><sect3><title>What is a disklabel?</title><para>A disk label is a partition table. Unfortunately, there are several
formats the partition table can take, depending on the operating
system.</para><para>DOS partition tables are the standard used by Linux and
Windows. AlphaBIOS systems and every Linux kernel can read DOS
partition tables. Unfortunately, the SRM console's boot sector format
overlaps with parts of the DOS partition table on disk, and therefore
DOS partition tables cannot be used with SRM.</para><para>BSD disklabels are used by several variants of Unix, including
Tru64.  SRM's boot block does not conflict with the BSD disklabel (in
fact, the BSD disklabel resides entirely within "reserved" areas of
the first sector), and Linux can use a BSD disklabel, provided that
support for BSD disklabels has been compiled into the kernel.</para><para>To boot from a disk using SRM, a BSD disklabel is required. If the
disk is not a boot disk, the BSD disklabel is not required. A BSD
disklabel can be created using fdisk, the standard Linux disk
partitioning tool.</para></sect3><sect3><title>Partitioning the Easy Way: a DOS Disklabel</title><para>The simplest way to partition your disk is to let your Linux installer
do it for you, for example by using Red Hat's disk druid or fdisk.  On
Red Hat 6.1, this will produce a valid BSD disklabel, but
<emphasis>only</emphasis> if the disk in question previously contained one.  In
most cases, this will produce a DOS disklabel.  It will be readable by
Linux, but you will not be able to boot from it via SRM.  For this
reason, you will probably want to create a BSD disklabel manually in
order to boot Linux</para></sect3><sect3><title>Partitioning with a BSD Disklabel</title><para>
<orderedlist inheritnum="ignore" continuation="restarts"><listitem><para>Start fdisk on the disk you're configuring</para></listitem><listitem><para>Choose to make a BSD disklabel - option 'b' (newer versions of
fdisk will detect existing BSD disklabels and automatically enter
disklabel mode)</para></listitem><listitem><para>You'll notice some things: Partitions are letters instead of
numbers, from a-h Partition 'c' covers the whole of the disk. This is
the convention, don't touch it.  While you can see it, note down the
disk parameters as you'll use them more often than with the
DOS-disklabel approach</para></listitem><listitem><para>Creating a new partition uses the same procedure as the
DOS-disklabel approach, except that the partitions are referred to by
letter instead of number. That is, 'n' to make a new partition
followed by the partition letter followed by the starting block
followed by the end block</para></listitem><listitem><para>Setting partition type is slightly different, because the
numbering scheme is different (1 is swap, 8 is ext2).</para></listitem><listitem><para>When you are finished, write ('w') and quit ('q') as normal.</para></listitem></orderedlist>
</para><para>There are some important catches that you must be aware of when
partitioning using a BSD disklabel:

<itemizedlist><listitem><para>Partition 'a' should start about 1M into the disk: don't start
it at sector 1, try starting at sector 10 (for example). This leaves
plenty of space for writing the boot block (see below)</para></listitem><listitem><para>There is a bug in some versions of fdisk which makes the disk
look one sector bigger than it actually is.  The listing when you
create the BSD disklabel is correct.  The last sector of partition 'c'
is correct.  The default last sector when creating a new partition is
1 sector too big</para></listitem><listitem><para>Always adjust for this extra sector. This bug exists in the
version of fdisk shipped with Red Hat 6.0. Not making an adjustment
for this problem almost always leads to "Access beyond end of device"
errors from the Linux kernel.</para></listitem></itemizedlist>
</para><para>Once you have made a BSD disklabel, continue the installation. After
installation, you can write a boot block to your disk to make it
bootable from SRM.</para></sect3></sect2></sect1><sect1><title>Sharing a Disk With DEC Unix</title><para>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 <literal moreinfo="none" remap="tt">aboot</literal> version 0.5 or newer.</para><sect2><title>Partitioning the disk</title><para>First and foremost: <emphasis>never</emphasis> use any of the Linux partitioning
programs (<literal moreinfo="none" remap="tt">minlabel</literal> or <literal moreinfo="none" remap="tt">fdisk</literal>) on a disk that is also
used by DEC Unix.  The Linux <literal moreinfo="none" remap="tt">minlabel</literal> program uses the same
partition table format as DEC Unix <literal moreinfo="none" remap="tt">disklabel</literal>, but there are
some incompatibilities in the data that <literal moreinfo="none" remap="tt">minlabel</literal> fills in, so
DEC Unix will simply refuse to accept a partition table generated by
<literal moreinfo="none" remap="tt">minlabel</literal>.  To setup a Linux <literal moreinfo="none" remap="tt">ext2</literal> partition under DEC
Unix, you'll have to change the disktab entry for your disk.  For the
purpose of this discussion, let's assume that you have an rz26 disk (a
common 1GB drive) on which you want to install Linux.  The disktab
entry under DEC Unix v3.2 looks like this (see file
<literal moreinfo="none" remap="tt">/etc/disktab</literal>):

<screen format="linespecific">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:</screen>
</para><para>The interesting fields here are <literal moreinfo="none" remap="tt">o</literal><emphasis remap="it">?</emphasis>, and
<literal moreinfo="none" remap="tt">p</literal><emphasis remap="it">?</emphasis>, where <emphasis remap="it">?</emphasis> is a letter in the range
<literal moreinfo="none" remap="tt">a</literal>-<literal moreinfo="none" remap="tt">h</literal> (first through 8-th partition).  The <literal moreinfo="none" remap="tt">o</literal>
value gives the starting offset of the partition (in sectors) and the
<literal moreinfo="none" remap="tt">p</literal> value gives the size of the partition (also in sectors).
See <literal moreinfo="none" remap="tt">disktab(4)</literal> for more info.  Note that DEC Unix likes to
define overlapping partitions.  For the entry above, the partition
layout looks like this (you can verify this by adding up the various
<literal moreinfo="none" remap="tt">o</literal> and <literal moreinfo="none" remap="tt">p</literal> values):

<screen format="linespecific">  a    	b      	  d    	      e	     	  f
|---|-------|-----------|-----------|-----------|

                        c
|-----------------------------------------------|

                     g                 h
            |-----------------|-----------------|</screen>
</para><para>DEC Unix insists that partition <literal moreinfo="none" remap="tt">a</literal> starts at offset 0 and that
partition <literal moreinfo="none" remap="tt">c</literal> spans the entire disk.  Other than that, you can
setup the partition table any way you like.</para><para>Let's suppose you have DEC Unix using partition <literal moreinfo="none" remap="tt">g</literal> and want to
install Linux on partition <literal moreinfo="none" remap="tt">h</literal> with partition <literal moreinfo="none" remap="tt">b</literal> being a
(largish) swap partition.  To get this layout without destroying the
existing DEC Unix partition, you need to set the partition types
explicitly.  You can do this by adding a <literal moreinfo="none" remap="tt">t</literal> field for each
partition.  In our case, we add the following line to the above
disktab entry.

<screen format="linespecific">	:ta=unused:tb=swap:tg=4.2BSD:th=resrvd8:</screen>
</para><para>Now why do we mark partition <literal moreinfo="none" remap="tt">h</literal> as "reservd8" instead of "ext2"?
Well, DEC Unix doesn't know about Linux.  It so happens that partition
type "ext2" corresponds to a numeric value of 8, and DEC Unix uses the
string "reservd8" for that value.  Thus, in DEC Unix speak, "reservd8"
means "ext2".  OK, this was the hard part.  Now we just need to
install the updated disktab entry on the disk.  Let's assume the disk
has SCSI id 5.  In this case, we'd do:

<screen format="linespecific"># disklabel -rw /dev/rrz5c rz26</screen>
</para><para>You can verify that everything is all right by reading back the
disklabel with <literal moreinfo="none" remap="tt">disklabel -r /dev/rrz5c</literal>.  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 <literal moreinfo="none" remap="tt">/dev/sdb8</literal> and <literal moreinfo="none" remap="tt">/dev/sdb2</literal>, 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 ;-).</para></sect2><sect2><title>Installing <literal moreinfo="none" remap="tt">aboot</literal></title><para><emphasis>First big caveat</emphasis>: with the SRM firmware, you can boot one and
only one operating system per disk.  For this reason, it is generally
best to have at least two SCSI disks in a machine that you want to
dual-boot between Linux and DEC Unix.  Of course, you could also boot
Linux from a floppy if speed doesn't matter or over the network, if
you have a <literal moreinfo="none" remap="tt">bootp</literal>-capable server.  But in this section we assume
you want to boot Linux from a disk that contains one or more DEC Unix
partitions.</para><para><emphasis>Second big caveat</emphasis>: installing <literal moreinfo="none" remap="tt">aboot</literal> on a disk shared with
DEC Unix renders the first and third partition unusable (since those
<emphasis>must</emphasis> have a starting offset of 0).  For this reason, we recommend
that you change the size of partition <literal moreinfo="none" remap="tt">a</literal> to something that is just
big enough to hold <literal moreinfo="none" remap="tt">aboot</literal> (1MB should be plenty).</para><para>Once these two caveats are taken care of, installing <literal moreinfo="none" remap="tt">aboot</literal> is
almost as easy as usual: since partition <literal moreinfo="none" remap="tt">a</literal> and <literal moreinfo="none" remap="tt">c</literal> will
overlap with <literal moreinfo="none" remap="tt">aboot</literal>, we need to tell <literal moreinfo="none" remap="tt">swriteboot</literal> that this is
indeed OK.  We can do this under Linux with a command line of the
following form (again, assuming we're trying to install <literal moreinfo="none" remap="tt">aboot</literal> on
the second SCSI disk):

<screen format="linespecific"># swriteboot -f1 -f3 /dev/sdb bootlx</screen>
</para><para>The <literal moreinfo="none" remap="tt">-f1</literal> means that we want to force writing <literal moreinfo="none" remap="tt">bootlx</literal> even
though it overlaps with partition 1.  The corresponding applies for
partition 3.</para><para>This is it.  You should now be able to shutdown the system and boot
Linux from the harddisk.  In our example, the SRM command line to do
this would be:

<screen format="linespecific">ententent boot dka5 -fi 8/vmlinux.gz -fl root=/dev/sdb8</screen>
</para></sect2></sect1><sect1><title>Installation of Distributions</title><sect2><title>RedHat 6.0, 6.1 and 6.2</title><sect3><title>Installation from the Red Hat 6.0, 6.1 or 6.2 CD</title><para>Red Hat have made their distribution CD bootable from SRM console
<footnote><para>Please note that through the official RedHat CD-ROM is SRM
bootable, copies made by various other companies may not be
bootable.</para></footnote>

To start an installation, put the CD in and type
the following:

<screen format="linespecific">ententent boot srm-device -file kernels/generic.gz -flags root=linux-device</screen>
</para><para>In the above, the SRM device name and Linux device name for your
CD-ROM drive are needed.  For Example if the machine had an IDE cdrom
installed as primary master the command would look like this:

<screen format="linespecific">ententent boot dqa0 -file kernels/generic.gz -flags "root=/dev/hda"</screen>
</para><para>See the section on <xref linkend="device-naming"></xref> conventions if you don't know what these are.</para></sect3></sect2><sect2><title>SuSE 6.1</title><sect3><title>Installation from the SuSE 6.1 CD</title><para>The SuSE 6.1 CD is not bootable from SRM console. SuSE have an
alternative approach which involves creating two boot floppies, the
images of which are included on the CD.  The boot disks can be created
in various ways, depending on the systems you have available</para><para>Writing the boot disks from a linux system
The command to use is dd. From the mount-point of SuSE CD 1, the commands are:

<screen format="linespecific"># dd if=disks/aboot of=/dev/fd0
# dd if=disks/install of=/dev/fd0</screen>
</para><para>For writing the boot disks from a windows system, the command to use
is rawrite. It is available on the CD.

<screen format="linespecific"> D:\tools\ent rawrite</screen>
</para><para>The program then prompts for input disk image and output disk
drive. Run this command once for each of the disk images as shown
above.</para><para>Starting the SuSE installer from the boot disks
With the floppy disk made from the aboot image in place, type:

<screen format="linespecific">ententent boot dva0 -file vmlinux.gz -flags "root=/dev/fd0 load_ramdisk=1"</screen>
</para><para>This will start the kernel, prompt you for the second boot disk, and start the installer</para></sect3></sect2><sect2><title>SuSE 6.3</title><sect3><title>Installation from the SuSE 6.3 CD</title><para>The SuSE 6.3 CD-ROM is SRM bootable much like the RedHat 6.0 and 6.1 CD-ROMs. The best way
to start the install from SRM is to use the following command:

<screen format="linespecific">ententent boot srm-device -flags 0</screen>
</para><para>In the above, the SRM device names for your
CD-ROM drive is needed.  For Example if the machine had an IDE cdrom
installed as primary master the command would look like this:

<screen format="linespecific">ententent boot dqa0 -flags 0</screen>

SuSE has added support to aboot to allow it to load initrd files. The above command will from the
CD-ROM drive and use config number 0 from the /etc/aboot.conf file. For other variations
on this refer to the SuSE installation guide.</para></sect3></sect2></sect1><sect1><title>Document History</title><para>v0.8 9th November 2000 Changed from Rich Payne entrdp@alphalinux.orgent
<itemizedlist><listitem><para> Added section on SRM Device names</para></listitem><listitem><para> Many spelling/grammer fixes.</para></listitem></itemizedlist></para><para>v0.7.1 6th November 2000 Changes from Peter Petrakis entppetrakis@alphalinux.orgent

<itemizedlist><listitem><para> Cleaned up netbooting section. Avoid duplicate information.</para></listitem><listitem><para> Added DHCP/BOOTP server configuration section. </para></listitem><listitem><para> Added SRM netbooting section.</para></listitem><listitem><para> Put the older bootpd configuration in it's own section and elaborated on it. </para></listitem></itemizedlist></para><para>v0.7 10th July 2000 Changes from Rich Payne entrdp@alphalinux.orgent

<itemizedlist><listitem><para> Updated for RedHat 6.2</para></listitem><listitem><para> Fixed aboot link for alphalinux.org and added CVS information.</para></listitem><listitem><para> Added additional netboot information from Peter Petrakis entppetrakis@alphalinux.orgent</para></listitem></itemizedlist></para><para>v0.6.1 21 March 2000 Changes from Rich Payne entrdp@alphalinux.orgent

<itemizedlist><listitem><para> Made the installation hints a new chapter</para></listitem><listitem><para> Added information on Netbooting</para></listitem><listitem><para> Added to the new section on RedHat 6.1 and BSD disklabels</para></listitem><listitem><para> Removed David Mosberger-Tang's name from the authors list</para></listitem><listitem><para> Marked a few of the feature as being in 0.6 only</para></listitem><listitem><para> Added info for SuSE 6.3 and RedHat 6.1</para></listitem></itemizedlist>
</para><para>v0.6 3 March 2000 Changes and information from David Huggins-Daines
entdhd@linuxcare.coment

<itemizedlist><listitem><para>Moved the notes on MILO vs. SRM to an "About this document" section</para></listitem><listitem><para>Added sections on switching to SRM, and basic SRM usage</para></listitem><listitem><para>Added section on the new interactive use of aboot</para></listitem><listitem><para>Updated the note on DOS partition tables to mention the Red Hat 6.1
installer's behavior.</para></listitem><listitem><para>Normalized the markup, and codified the conventions used for
user-entered commands.</para></listitem><listitem><para>Corrected the notes on BSD disklabels (SRM does <emphasis>not</emphasis>
read BSD disklabels, it's just that they don't conflict with the boot
block).</para></listitem></itemizedlist>
</para><para>v0.5.2 5 December 1999 Added comments and information from Stig Telfer
(stig @ alpha-processor.com).

<itemizedlist><listitem><para>Added chart on SRM to Linux name mappings</para></listitem><listitem><para>Added RedHat 6.0 and SuSE 6.1 installation information</para></listitem><listitem><para>Added Disk Partitioning Information</para></listitem></itemizedlist>
</para><para>v0.5.1 (Not Released) 13 November 1999 Took the original 0.5 document and updated several parts:</para><para>
<itemizedlist><listitem><para>Update information on SRM booting from IDE devices</para></listitem><listitem><para>Fixed URL to aboot source</para></listitem><listitem><para>Update toc page to reflect MILO's future</para></listitem><listitem><para>Included information on bootdefentdev and bootentdev to chapter 3</para></listitem><listitem><para>Added this section</para></listitem></itemizedlist>
</para><para>v0.5 17 August 1996 - Original Document by David Mosberger-Tang</para></sect1></article>

