User Tools

Site Tools


software:boot_loaders:aboot

aboot

aboot is the Linux boot loader for Alpha systems with the SRM console. It loads a Linux kernel, optionally with an initial ramdisk, from an ext2, ext3, ext4, XFS, ISO 9660, or UFS file system or from raw disk blocks, and supports a configuration file, /etc/aboot.conf. 1) Systems with the ARC or AlphaBIOS firmware use MILO instead. 2)

aboot is free software under the GNU GPL. 3) The current source repository is https://github.com/alphalinux/aboot.

Installing

Packages

Debian packages aboot as aboot, which holds the tools such as swriteboot, and aboot-base, which installs the boot loader itself as /boot/bootlx; the version in unstable is 1.0~pre20200212. 4) 5) Gentoo packages aboot 2.0 as sys-boot/aboot, which also installs /boot/bootlx. 6)

Building

make builds bootlx and the tools, and make install copies bootlx to /boot and swriteboot, abootconf, e2writeboot, and isomarkboot to /sbin; the root make variable sets a different prefix. 7) make netabootwrap builds netabootwrap, which is not part of the default target. 8)

The Makefile cross-compiles by default: bootlx is built with the compiler named by CROSS_COMPILE, by default alpha-unknown-linux-gnu-, while the tools are built with HOSTCC for the machine doing the build. 9) 10) On an Alpha, CROSS_COMPILE is set to nothing; elsewhere it names the installed cross compiler (see Toolchains: Cross compilers):

git clone https://github.com/alphalinux/aboot.git
cd aboot
make CROSS_COMPILE=                    # native build on an Alpha
make CROSS_COMPILE=alpha-linux-gnu-    # cross build with Debian's cross compiler

include/config.h sets the default partition for /etc/aboot.conf, which can also be changed later with abootconf. 11)

Disklabels

A disk booted from SRM must use a BSD disklabel, not an MBR or GPT partition table, because a PC partition table occupies the same place in the first sector as the SRM boot block. 12) 13) Other disks in the system can use any partition table. A BSD disklabel stores each partition's offset and size as a 32-bit count of sectors, so with 512-byte sectors it cannot describe more than 2 TiB of a disk. 14)

Current fdisk from util-linux cannot create BSD disklabels; parted creates one with mktable bsd (see Installation: Partitioning). 15) ARC and AlphaBIOS cannot read BSD disklabels, so a disk cannot be booted from both SRM and AlphaBIOS. 16)

aboot only tries the file system drivers that match the partition type in the disklabel. ext2, ext3, ext4, and XFS use type 8, and UFS type 7. ISO 9660 is only found on devices without a disklabel, such as CDs. 17) Recycled disks with an old PC partition table can confuse installers; erasing the old signatures first, with wipefs -a, avoids this. 18)

swriteboot

swriteboot writes aboot (bootlx) to the start of a disk and updates the boot block: 19) 20)

swriteboot [-f1-8] [-c1-8] [-v] disk bootfile [kernel]
swriteboot -c2 /dev/sda /boot/bootlx
  • The target is the whole disk (e.g. /dev/sda), not a partition. 21)
  • The space before the first partition must be free; starting the first partition at 1 MiB leaves enough room for aboot. 22) If a partition overlaps aboot, swriteboot stops with "bootcode overlaps with partition #n. If you really want this, use -fn". 23) On a disklabel with a whole-disk c partition, which parted does not create, -f3 is needed. 24) -f can be given more than once. 25) Alternatively, a small first partition can reserve the space, with aboot written over it using -f1. 26) 27)
  • -c sets the partition that holds /etc/aboot.conf. Without it, swriteboot keeps the setting of an aboot already on the disk. 28)
  • A kernel given as the third argument is written directly after aboot, and can be booted as partition 0. 29) Such a kernel must be an uncompressed ELF image. 30)
  • On a disk shared with Tru64 UNIX, installing aboot makes the first and third partitions unusable, since they must start at offset 0. 31)

abootconf

abootconf disk [partition] shows or sets the partition that aboot searches for /etc/aboot.conf. 32) The device is the drive, e.g. /dev/sda, and the setting is stored in the aboot image on the disk. 33) swriteboot -c does the same. A newly built aboot searches partition 1. 34) 35)

CDs

isomarkboot image bootlx [root.bin] makes an ISO 9660 image bootable, which works because files on ISO 9660 are contiguous. 36) For example, a rescue CD: 37)

cp -L /vmlinuz /initrd.img /boot/bootlx iso-root/
cp /etc/aboot.conf iso-root/etc/
mkisofs -r -J -o rescue.iso iso-root/
isomarkboot rescue.iso /bootlx

Floppies

e2writeboot writes aboot as a contiguous file on an ext2 floppy and points the boot block at it, 38) and srmbootfat does the same for a file on a FAT floppy. 39)

Booting

aboot takes its arguments from the SRM boot command: 40) 41)

>>> boot dka0 -file 1/vmlinuz -flags "root=/dev/sda3 console=ttyS0"
>>> boot dka0 -flags 0
>>> boot dka0 -flags "1:1 single"
>>> boot dka0 -flags i
  • -file partition/path: the partition is a digit from 1 to 8, corresponding to BSD partitions a to h. It can be omitted on a floppy or CD. 42) 43) Partition 0 is a kernel written directly after aboot. 44)
  • -flags with kernel arguments passes them to the kernel. The quotes are required when there are spaces. 45)
  • -flags n boots entry n from /etc/aboot.conf on the configured partition. -flags p:n reads aboot.conf from partition p instead. Extra kernel arguments can follow after a space. 46) Some SRM versions allow only 8 or 16 characters in the option string, so keeping the kernel arguments in aboot.conf and only the entry number in the flags is more robust. 47)
  • -flags i, or empty flags, starts the interactive prompt. If a kernel fails to load, aboot also falls back to the prompt. 48)
  • Unattended booting is set up with the SRM variables described in Installation: Booting the installed system. 49) Pressing Ctrl+C repeatedly during startup returns to the SRM prompt. 50)

aboot.conf

aboot searches the configured partition for /etc/aboot.conf, /aboot.conf, /etc/aboot.cfg, and /aboot.cfg, in that order. 51) Each line is a single-character label, a colon, a partition and path, and kernel arguments. A # starts a comment, and a line starting with - ends the file. 52) 53)

Paths are relative to the root of the partition. In the following example, /boot is a separate first partition, so the file is /boot/etc/aboot.conf and a kernel installed as /boot/vmlinuz is given as 1/vmlinuz, with the root file system on partition 3: 54)

0:1/vmlinuz root=/dev/sda3 console=ttyS0
1:1/vmlinuz root=/dev/sda3 console=ttyS0 single
2:1/vmlinuz.old root=/dev/sda3 console=ttyS0
3:1/vmlinuz initrd=/initrd.img root=/dev/sda3 console=ttyS0

aboot.conf has no default entry. The default is chosen with the SRM variable boot_osflags. 55) 56)

Interactive mode

The interactive prompt accepts these commands: 57)

Command Description
h, ? Display the command summary
q Halt and return to SRM
p 1-8 Use this partition for aboot.conf and kernels
l List the entries in aboot.conf
d dir List a directory
b file args Boot a kernel with arguments; - for a kernel written after aboot
i file Use a file as the initial ramdisk
0-9 Boot an aboot.conf entry

For example, b 1/vmlinuz root=/dev/sda3 single. 58)

initrd

An initial ramdisk is given with initrd=path in the flags, or with the i command. It is loaded from the same partition as the kernel, as high in memory as possible. 59) The option must be inside the -flags string, e.g.: 60)

>>> boot dka0 -file 1/vmlinuz -flags "initrd=/initrd.img root=/dev/sda3 console=ttyS0"

Kernel images

aboot loads a kernel that is a 64-bit little-endian Alpha ELF executable, such as the kernel's vmlinux, either uncompressed or compressed with gzip. 61) 62) make boot in the kernel tree builds the gzip-compressed arch/alpha/boot/vmlinux.gz. 63) aboot first tries a file as uncompressed ELF and then as gzip, except that a file whose name ends in .gz is only tried as gzip. 64) Other compression formats, such as bzip2 or xz, are not supported, and fail with "unknown compression method". 65) A kernel written directly after aboot must be uncompressed (see swriteboot).

Network booting

SRM fetches a network boot image itself with BOOTP and TFTP, e.g. boot ewa0 -protocols bootp. 66) Setting ewa0_protocols to bootp makes BOOTP the default instead of MOP. 67) The image is not an ordinary kernel. aboot builds one, containing aboot, a compressed kernel, an initrd, and default arguments, with netabootwrap: 68)

netabootwrap -t netboot.img -k vmlinux.gz -i initrd.gz -a "root=/dev/sda3 console=ttyS0"

Debian built all its netboot installer images this way. 69) The kernel can also build a BOOTP image without aboot, with make bootpfile or, compressed, make bootpzfile, which produce arch/alpha/boot/bootpfile and bootpzfile. 70) Setting the make variable INITRD to a file appends it as an initrd. 71) 72)

The server side needs a DHCP or BOOTP server that gives the system an address, the TFTP server's address, and the image's file name, and a TFTP server that serves the image. With ISC dhcpd, for example: 73)

host alpha {
   hardware ethernet 08:00:2B:E7:94:9B;
   fixed-address alpha.example.org;
   filename "netboot.img";
   next-server 192.168.1.1;
}

dnsmasq can provide both servers. It answers BOOTP requests only from hosts given a fixed address with dhcp-host (unless bootp-dynamic is set), and needs a dhcp-range to enable its DHCP server; with enable-tftp, dhcp-boot needs only the file name, which is served from tftp-root: 74)

dhcp-range=192.168.1.100,192.168.1.200
dhcp-host=08:00:2b:e7:94:9b,192.168.1.50,alpha
dhcp-boot=netboot.img
enable-tftp
tftp-root=/srv/tftp

The system then boots with boot ewa0 -flags "", taking the file name from the DHCP server. 75)

File systems

File system Notes
ext2
ext3 Read as ext2, without replaying the journal. 76)
ext4 Extents stored in the inode only; see below. 77) 78)
ISO 9660 Rock Ridge long names and symbolic links are supported. 79) 80)
UFS (BSD FFS) "Not well exercised and may be broken". 81)
XFS Versions 4 and 5. 82)

aboot does not read Btrfs, FAT, ReiserFS, or Tru64 AdvFS. 83)

aboot 2.0 refuses ext4 file systems with features it cannot read safely, including meta_bg, bigalloc, quota, and more than 2^32 blocks. It only reads extents stored directly in the inode, not deeper extent trees, so a kernel file split into more than four extents cannot be loaded. 84) 85) aboot then prints "Extent tree depth n not supported" or "n extents exceeds the 4 that fit inline". 86) The number of extents in a file can be checked beforehand with filefrag from e2fsprogs, e.g. filefrag /boot/vmlinuz; -v gives more detail. 87) ext2 and ext3 file systems, which map blocks through indirect blocks instead of extents, do not have this limit. 88)

Recovering an unbootable disk

If aboot starts but the kernel fails, boot with -flags i gives aboot's prompt, from which another aboot.conf entry, or a kernel with different arguments, can be booted (see Interactive mode). If SRM instead reports that block 0 of the disk "is not a valid boot block", 89) the disk has no boot block pointing to aboot (see How it works), and aboot has to be written again:

  1. Boot the installation CD (see Installation: Booting the installer) and get to a shell, e.g. the rescue mode of the installer. 90)
  2. Mount the file system that holds bootlx, or mount the installed system and chroot into it. 91) swriteboot does not have to run inside the installed system: it only copies bootlx, which is the same file on every installation, to the start of the disk. 92)
  3. Run swriteboot on the whole disk, with -c naming the partition that holds aboot.conf (see swriteboot). With the layout from Installation: Partitioning, where /boot is partition 1, this is mount /dev/sda1 /mnt followed by swriteboot -c1 /dev/sda /mnt/bootlx.
  4. Check aboot.conf on that partition, and correct the kernel paths and root= arguments if needed. 93) If aboot is present but looks for aboot.conf on the wrong partition, abootconf changes the setting without rewriting aboot. 94) 95)

Known issues

  • "unknown compression method": aboot first tries to load a kernel uncompressed, then compressed, and prints this if both fail, whatever the actual cause. 96) 97)
  • Serial console: aboot writes through the SRM console, so with the SRM console variable set to serial its messages and prompt appear on the serial port and nothing appears on the screen. 98) 99) Linux needs console=ttyS0 in its arguments to use the same port, or console=srm on the Marvel systems (ES47, ES80, and GS1280); see Using the SRM Console: Serial console.
  • UFS and network booting: the aboot 2.0 README describes both as "not well exercised and may be broken". Reading aboot.conf from UFS can hang if the entry is not found. 100)
  • SRM without support for the boot controller: aboot can only boot from devices that SRM can read. Alternatives are a network boot, or aboot and the kernel on a disk on a supported controller. 101)

How it works

The SRM console does not read file systems or partition tables. The first sector of the disk holds the size of the secondary boot loader in 512-byte blocks at offset 480, its starting sector at offset 488, a flag word at offset 496, and a checksum of the first 63 quadwords at offset 504. SRM loads the loader at virtual address 0x20000000 and jumps to it. 102) swriteboot writes aboot starting at sector 2. 103)

aboot then:

  1. switches from the console PALcode to the OSF/1 PALcode, 104)
  2. reads the boot device, file, and flags from the SRM environment, 105)
  3. reads the disk through the SRM console callbacks, 106)
  4. finds the partition in the BSD disklabel, mounts its file system, and loads the kernel and initrd, 107)
  5. and jumps to the kernel.

aboot does no low-level hardware setup of its own and relies entirely on the SRM console's services. 108) Errors such as c000000000000000 when opening the boot device therefore come from SRM, not aboot. 109) Because SRM hides the differences between systems, a single aboot binary works on every SRM system. 110)

History

aboot is based on the kernel's own SRM boot loader in arch/alpha/boot, extended by David Mosberger and Michael Schwingen with a prompt for arguments and the /etc/aboot.conf file. 111) Mosberger added file system support, Schwingen the default command line handling, and Dave Larson network booting. 112) The ISO 9660 code came from MILO. 113) David Huggins-Daines merged the patches carried by Red Hat, Debian, and SuSE in version 0.6 in March 2000. 114) Will Woods maintained aboot from 2001 to 2004; his last snapshot was 1.0_pre20040408, and there was never a final 1.0. 115) The alphalinux/aboot repository added cross-compilation, ext4 support (first added in 2017, and extended by Magnus Lindholm with 64-bit group descriptors and multi-extent reads), 116) and XFS support by Jan-Jaap van der Heijden and Lindholm, and was tagged as version 2.0 in September 2026. 117) 118) 119)

Versions

Version Date Changes
0.9b November 2002 Builds with GCC 3 and newer glibc. 120)
1.0_pre20040408 April 2004 Extra kernel arguments after an aboot.conf entry. 121)
2.0 September 2026 ext4, XFS, cross-compilation. 122)

Conflicting information

The following sources conflict with each other or with the account given above. They are listed here for further investigation.

  • Space to reserve before the first partition
    • swriteboot(8): "It is therefore suggested to reserve the first 512 sectors of a harddisk for boot purposes."
    • SRM Firmware Howto, v0.8.1: "We suggest that the disk be partitioned such that the first partition starts at an offset of 2048 sectors."
    • "Re: Boot via SRM on poweron", Jay Estabrook, axp-list, 20 Oct 1996: "aboot fits fine in front of partition 1 if you offset the start of partition 1, say 512-1024 sectors"
  • Whether the kernel position limit was fixed
    • README, aboot 0.9: "Failure to boot when kernel was past the 2GB boundary on ext2 fs fixed"
    • "aboot size limitation in Woody", Bob Lindell, debian-alpha, 12 Jul 2004: "I could get aboot to fail to read either the /etc/aboot.conf file or the kernel images if they were too far into the 20GB partition."
  • Whether aboot reads ReiserFS
  • Whether network booting works

Documentation

Document Part number Date
SRM Firmware Howto, v0.8.1 by Rich Payne and David Huggins-Daines, in the aboot repository February 2004
Man pages for aboot, aboot.conf, abootconf, swriteboot, e2writeboot, isomarkboot, netabootwrap, and sdisklabel
README.md (aboot 2.0)
ChangeLog and README from before aboot 2.0, with the history of versions 0.1 to 1.0_pre20040408

See also SRM console: Booting Linux.


1) README.md, aboot 2.0
2) aboot(8), aboot 2.0
3) COPYING, aboot 2.0
4) aboot, tracker.debian.org
5) aboot-base file list, packages.debian.org
7) Makefile, aboot 2.0
8) Makefile, aboot 2.0
10) Makefile, aboot 2.0
11) README.md, aboot 2.0
12) SRM Firmware Howto, v0.8.1, 14 Feb 2004
13) "Re: Newbie question about booting.", Larry Sendlosky, axp-list, 5 Apr 2000
15) "Re: [gentoo-alpha] fdisk on mini-installer iso", Matt Turner, gentoo-alpha, 8 Apr 2024
16) "RE: srm / ide", Larry Sendlosky, axp-list, 29 Feb 2000
17) disk.c, aboot 2.0
18) "Re: swriteboot ?", Michal Jaegermann, axp-list, 23 Jan 2003
20) README.md, aboot 2.0
21) "Re: aboot install fails", Steve Langasek, debian-alpha, 1 Oct 2004
22) SRM Firmware Howto, v0.8.1, 14 Feb 2004
24) SRM Firmware Howto, v0.8.1, 14 Feb 2004
26) "Re: aboot problems with AlphaStation 200", Maciej W. Rozycki, axp-list, 15 Sep 1998
27) "Re: swriteboot vs debian installer wrt Tru64 disklabel", Steve Langasek, debian-alpha, 4 May 2005
29) "Re: Boot via SRM on poweron", Michael Schwingen, axp-list, 21 Oct 1996
30) README, aboot 0.9, 25 Oct 2001
31) SRM Firmware Howto, v0.8.1, 14 Feb 2004
32) abootconf(8), aboot 2.0
33) "Re: AW: installing kernel-image", Tyson Whitehead, debian-alpha, 15 Jul 2003
34) include/config.h, aboot 2.0
35) README, aboot 0.9, 25 Oct 2001
37) "Re: equivalent of mkrescue for the alpha ??? rescue CDs", Steve Langasek, debian-alpha, 19 Feb 2004
38) e2writeboot(8), aboot 2.0
39) srmbootfat(1), aboot 2.0
40) SRM Firmware Howto, v0.8.1, 14 Feb 2004
41) disk.c, aboot 2.0
42) "Re: SRM unplugged", Xenophon Fenderson, axp-list, 5 Oct 1998
43) aboot.conf(5), aboot 2.0
44) disk.c, aboot 2.0
45) "RE: Alpha Server 2000:Up and Running:THANKS!!", Jay Estabrook, axp-list, 20 Mar 1997
46) disk.c, aboot 2.0
47) "Re: SRM unplugged", Xenophon Fenderson, axp-list, 5 Oct 1998
48) disk.c, aboot 2.0
49) README.md, aboot 2.0
50) "Re: Getting out of aboot in SRM?", Jay Estabrook, axp-list, 2 Jun 1997
51) disk.c, aboot 2.0
52) disk.c, aboot 2.0
53) aboot.conf(5), aboot 2.0
54) aboot.conf(5), aboot 2.0
55) "Re: SRM vs. AlphaBIOS", Michal Jaegermann, axp-list, 8 Sep 1999
56) "Re: installing kernel-image", Ionut Georgescu, debian-alpha, 15 Jul 2003
57) disk.c, aboot 2.0
58) SRM Firmware Howto, v0.8.1, 14 Feb 2004
59) disk.c, aboot 2.0
60) "Re: boot failures", Jay Estabrook, axp-list, 12 Dec 2002
61) aboot.c, aboot 2.0
62) zip/misc.c, aboot 2.0
64) disk.c, aboot 2.0
65) zip/misc.c, aboot 2.0
66) "Re: Remote boot Multia...", Maciej W. Rozycki, axp-list, 27 Apr 1998
67) "Re: Debugging Multia boot problems: take one", Jay Estabrook, debian-alpha, 17 Feb 2006
68) netabootwrap(1), aboot 2.0
69) "Re: [BUG] 2.6.23-rc3 won't boot on alpha (fwd)", Steve Langasek, debian-alpha, 21 Aug 2007
72) "Re: [BUG] 2.6.23-rc3 won't boot on alpha (fwd)", Jay Estabrook, debian-alpha, 16 Aug 2007
73) "Re: Debugging Multia boot problems: take one", Steve Langasek, debian-alpha, 17 Feb 2006
74) dnsmasq(8), dnsmasq 2.90
75) "Re: Debugging Multia boot problems: take one", Steve Langasek, debian-alpha, 17 Feb 2006
77) "fs: Add ext4 support", alphalinux/aboot
79) "aboot 0.7 released", David Huggins-Daines, axp-list, 2 May 2000
80) README, aboot 0.9, 25 Oct 2001
81) README.md, aboot 2.0
82) "Initial XFSv5 suppport", alphalinux/aboot
83) disk.c, aboot 2.0
84) fs/ext2.c, aboot 2.0
86) fs/ext2.c, aboot 2.0
87) filefrag(8), manpages.debian.org
88) fs/ext2.c, aboot 2.0
89) "Re: RH6.2 cd install", G.L. Grobe, axp-list, 4 Dec 2001
90) "SGI XFS Red Hat 7.1 Installer for Alpha", Martin K. Petersen, axp-list, 30 Jul 2001
91) "Re: Alpha installation", sammyg, debian-alpha, 24 May 2004
92) "Re: Installing aboot ?", Steve Langasek, debian-alpha, 2 Mar 2007
93) "Re: Alpha installation", sammyg, debian-alpha, 24 May 2004
94) "Re: Installing aboot ?", Steve Langasek, debian-alpha, 2 Mar 2007
95) abootconf(8), aboot 2.0
96) "New Red Hat 7.2 Alpha install on DEC PWS 600au", Jim McCarthy, axp-list, 11 Dec 2004
97) "Re: Jensen DECPC150 install!", Sebastian Moeller, debian-alpha, 15 Nov 1999
98) cons.c, aboot 2.0
99) "Re: aboot gives no output on SX164", Falk Hueffner, axp-list, 23 Jul 2001
100) README.md, aboot 2.0
101) "Re: howto boot alpha via SRM without supported SCSI controller", Måns Rullgård, debian-alpha, 15 Oct 2004
102) SRM Firmware Howto, v0.8.1, 14 Feb 2004, "Loading The Secondary Bootstrap Loader"
104) utils.c, aboot 2.0
105) aboot.c, aboot 2.0
106) cons.c, aboot 2.0
107) disk.c, aboot 2.0
108) "Re: Boot failure on AS2100", Richard Henderson, axp-list, 7 Nov 1999
109) "RE: installing rh 7.0", Will Woods, axp-list, 27 Mar 2001
110) "Re: The aboot - Jensen saga", David Mosberger-Tang, axp-list, 6 May 1996
111) README, aboot 0.9, 25 Oct 2001
112) ChangeLog, aboot
113) fs/iso.c, aboot 2.0
114) ChangeLog, aboot 0.6, 6 Mar 2000
115) ChangeLog, aboot
116) "fs: Add ext4 support", alphalinux/aboot
119) "Bump version to 2.0", alphalinux/aboot
120) "aboot 0.9b", Will Woods, axp-list, 13 Nov 2002
121) ChangeLog, aboot
122) "Bump version to 2.0", alphalinux/aboot
software/boot_loaders/aboot.txt · Last modified: by 127.0.0.1