Linux for Alpha
A long time ago, the Digital Equipment Corporation's (DEC) Alpha processor aka. Alpha AXP (Wikipedia) looked to be the future. It dominated the super computer listings, spawned a number of workstation, server and OEM systems, and there was even a MS Windows port. In those heady days it also happened to find itself the target of the first non-x86 port of the Linux kernel. A porting effort at DEC was described by Jim Paradis in a series of Linux Journal Articles (1, 2, 3) back in 1995, and Linus Torvalds in his 1997 M.Sc. thesis: "Linux: a Portable Operating System", discusses the portability of the Linux kernel using the challenges encountered in adding support for Alpha and SPARC as examples.
The Alpha ultimately lost out to the joint HP & Intel Itanium business case when Compaq bought DEC in 1998, with the Alpha IP being sold to Intel in 2001. Compaq merged with HP in 2002, and HP continued marketing Alpha based systems until 2007 and supported the hardware until 2012.
As such there is a desire to replicate Alpha environments on more modern hardware. For some this is a way to run applications that were built for Alpha, and may even be exclusive to that platform. For others its a way to explore the behaviours of older systems and maybe learn from the differences. The QEMU system emulator provides an emulation of an Alpha based system capable of running Linux. Currently there are few Linux distributions that support Alpha...
Support for DEC Alpha came to Debian in the 1999 "slink" release (2.1), and the last official release of Debian Linux for Alpha machines was 2009's Debian Linux 5.0 ("lenny"). There in-official releases from the Debian Ports project with CD images for Debian Linux 9 ("stretch") currently available. For more recent Linux versions it looks like only the Gentoo Linux distribution provides an option using current versions of the kernel.
For the sake of simplicity I'm going with a DVD version of the Debian Linux 5.0 ("lenny") release, so I don't have to worry about the status of any of the supporting online archives.
QEMU
Sadly the Alpha support in QEMU is not yet at the point of being able to run operating systems (e.g. NetBSD, OpenBSD, HP Tru64 or OpenVMS) other than Linux for Alpha. Currently the SRM alternative firmware provided is sufficient to load the required PALcode and QEMU when run specifying a kernel and an initrd will run Linux happily. It appears that there is some progress on running NetBSD (see the "NetBSD/alpha on qemu-system-alpha" thread) , but it is unclear when this will be suitable for release.
The Alpha machine QEMU emulates is based on the Alpha DP264 platform, this is probably best known as the basis of the Compaq AlphaServer ES40 and Compaq AlphaStation ES40 systems, although a number of other AlphaStations (e.g. XP900 and XP1000), AlphaServers (e.g. DS10 and DS20) and OEM boards (e.g. AlphaPC 264DP and API UP2000) were also based on it. However the QEMU documentation doesn't say much about the default system configuration for the Alpha emulation...
System Information
Let's see what the system has to say for itself...
uname
Operating system name, version and system architecture.
$ uname -a Linux qalp-d5 2.6.26-2-alpha-generic #1 Sun Mar 4 21:08:03 UTC 2012 alpha GNU/Linux
So Linux release "2.6.26-2-alpha-generic", version "#1 Sun Mar 4 21:08:03 UTC 2012", on platform "alpha", for operating system "GNU/Linux" on node "qalp-d5".
lsb_release
The Linux Standard Base release information provides a little bit more:
$ lsb_release -a No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 5.0.10 (lenny) Release: 5.0.10 Codename: lenny
Confirming the distribution release information, and giving the release code name. Note that 5.0.10 corresponds to the last update to the Debian Linux 5.0 release.
/proc/cpuinfo
Details of the processor:
$ cat /proc/cpuinfo cpu : Alpha cpu model : EV67 cpu variation : 0 cpu revision : 0 cpu serial number : system type : Tsunami system variation : Clipper system revision : 0 system serial number : QEMU cycle frequency [Hz] : 250000000 timer frequency [Hz] : 1024.00 page size [bytes] : 8192 phys. address bits : 40 max. addr. space # : 255 BogoMIPS : 539.92 kernel unaligned acc : 0 (pc=0,va=0) user unaligned acc : 0 (pc=0,va=0) platform string : N/A cpus detected : 1 L1 Icache : 64K, 2-way, 64b line L1 Dcache : 64K, 2-way, 64b line L2 cache : n/a L3 cache : n/a
The combination of Tsunami & Clipper identifies the emulated system as an Compaq ES40, which sets some expectations.
The default processor is an EV67 running at 250 Mhz and giving a BogoMips score of 539.92. While this matches the processor type for an ES40 (an EV6 at 500 MHZ, an EV67 at 667 MHz or EV68AL at 833 MHz) the speed is much reduced. The BogoMips score is consistent with the stated "cycle frequency", since for the EV6 processors the BogoMips score can be approximated as 1.99 times the clock (1.99 * 250 = 497.5).
lspci
Report installed PCI bus devices:
# lspci 00:00.0 VGA compatible controller: Cirrus Logic GD 5446 00:01.0 Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet Controller (rev 03) 00:02.0 IDE interface: Silicon Image, Inc. PCI0646 (rev 07)
Here we see the graphics card (QEMU's default Cirrus Logic emulation), the ethernet interface (Intel e1000) and a Silicon Image IDE disk controller (CMD646 deriviative).
hw_report
The hw_report script generates a hardware report, by running various commands:
# report-hw umame -a: Linux qalp-d5 2.6.26-2-alpha-generic #1 Sun Mar 4 21:08:03 UTC 2012 alpha GNU/Linux lspci -knn: 00:00.0 VGA compatible controller [0300]: Cirrus Logic GD 5446 [1013:00b8] lspci -knn: Kernel modules: cirrusfb lspci -knn: 00:01.0 Ethernet controller [0200]: Intel Corporation 82540EM Gigabit Ethernet Controller [8086:100e] (rev 03) lspci -knn: Kernel driver in use: e1000 lspci -knn: Kernel modules: e1000 lspci -knn: 00:02.0 IDE interface [0101]: Silicon Image, Inc. PCI0646 [1095:0646] (rev 07) lspci -knn: Kernel driver in use: CMD64x_IDE lspci -knn: Kernel modules: cmd64x, ide-pci-generic, ata_generic lsmod: Module Size Used by lsmod: nls_utf8 2464 1 lsmod: isofs 45064 1 lsmod: zlib_inflate 18008 1 isofs lsmod: udf 108768 0 lsmod: nls_base 9704 3 nls_utf8,isofs,udf lsmod: crc_itu_t 2496 1 udf lsmod: ppdev 10096 0 lsmod: parport_pc 33360 1 lsmod: lp 12888 0 lsmod: parport 47496 3 ppdev,parport_pc,lp lsmod: ipv6 372312 16 lsmod: loop 18624 0 lsmod: pcspkr 3472 0 lsmod: psmouse 51488 0 lsmod: serio_raw 7292 0 lsmod: evdev 12441 1 lsmod: ext3 159168 1 lsmod: jbd 60240 1 ext3 lsmod: ide_cd_mod 41328 1 lsmod: cdrom 44968 1 ide_cd_mod lsmod: ide_disk 17030 4 lsmod: ata_generic 6652 0 lsmod: libata 189984 1 ata_generic lsmod: scsi_mod 189184 1 libata lsmod: ide_pci_generic 5292 0 [permanent] lsmod: cmd64x 8294 0 [permanent] lsmod: ide_core 131928 4 ide_cd_mod,ide_disk,ide_pci_generic,cmd64x lsmod: e1000 158100 0 df: Filesystem 1K-blocks Used Available Use% Mounted on df: /dev/hda4 7357608 2253000 4730856 33% / df: tmpfs 61240 0 61240 0% /lib/init/rw df: udev 10240 1112 9128 11% /dev df: tmpfs 61240 0 61240 0% /dev/shm df: /dev/hda2 73202 20874 48422 31% /boot df: /dev/hdb 4541512 4541512 0 100% /media/cdrom0 free: total used free shared buffers cached free: Mem: 122488 104544 17944 0 3936 36688 free: -/+ buffers/cache: 63920 58568 free: Swap: 1875960 135936 1740024 /proc/cmdline: root=/dev/hda4 /proc/cpuinfo: cpu : Alpha /proc/cpuinfo: cpu model : EV67 /proc/cpuinfo: cpu variation : 0 /proc/cpuinfo: cpu revision : 0 /proc/cpuinfo: cpu serial number : /proc/cpuinfo: system type : Tsunami /proc/cpuinfo: system variation : Clipper /proc/cpuinfo: system revision : 0 /proc/cpuinfo: system serial number : QEMU /proc/cpuinfo: cycle frequency [Hz] : 250000000 /proc/cpuinfo: timer frequency [Hz] : 1024.00 /proc/cpuinfo: page size [bytes] : 8192 /proc/cpuinfo: phys. address bits : 40 /proc/cpuinfo: max. addr. space # : 255 /proc/cpuinfo: BogoMIPS : 539.92 /proc/cpuinfo: kernel unaligned acc : 0 (pc=0,va=0) /proc/cpuinfo: user unaligned acc : 0 (pc=0,va=0) /proc/cpuinfo: platform string : N/A /proc/cpuinfo: cpus detected : 1 /proc/cpuinfo: L1 Icache : 64K, 2-way, 64b line /proc/cpuinfo: L1 Dcache : 64K, 2-way, 64b line /proc/cpuinfo: L2 cache : n/a /proc/cpuinfo: L3 cache : n/a /proc/ioports: 00000000-01ffffff : PCI IO bus 0 /proc/ioports: 00000000-0000001f : dma1 /proc/ioports: 00000020-0000003f : pic1 /proc/ioports: 00000040-0000005f : timer /proc/ioports: 00000060-0000006f : keyboard /proc/ioports: 00000070-00000080 : rtc /proc/ioports: 000000a0-000000bf : pic2 /proc/ioports: 000000c0-000000df : dma2 /proc/ioports: 000002f8-000002ff : serial /proc/ioports: 00000378-0000037a : parport0 /proc/ioports: 000003c0-000003df : alpha-vga+ /proc/ioports: 000003f8-000003ff : serial /proc/ioports: 00008000-0000803f : 0000:00:01.0 /proc/ioports: 00008000-0000803f : e1000 /proc/ioports: 00008040-0000804f : 0000:00:02.0 /proc/ioports: 00008040-0000804f : CMD646 /proc/ioports: 00008050-00008057 : 0000:00:02.0 /proc/ioports: 00008050-00008057 : CMD646 /proc/ioports: 00008058-0000805f : 0000:00:02.0 /proc/ioports: 00008058-0000805f : CMD646 /proc/ioports: 00008060-00008063 : 0000:00:02.0 /proc/ioports: 00008060-00008063 : CMD646 /proc/ioports: 00008064-00008067 : 0000:00:02.0 /proc/ioports: 00008064-00008067 : CMD646 /proc/iomem: 00000000-3fffffff : PCI mem bus 0 /proc/iomem: 09000000-0903ffff : 0000:00:01.0 /proc/iomem: 09040000-0905ffff : 0000:00:01.0 /proc/iomem: 09040000-0905ffff : e1000 /proc/iomem: 09060000-0906ffff : 0000:00:00.0 /proc/iomem: 09070000-09070fff : 0000:00:00.0 /proc/iomem: 0a000000-0bffffff : 0000:00:00.0 /proc/interrupts: 1: 1371 XT-PIC i8042 /proc/interrupts: 2: 0 XT-PIC cascade /proc/interrupts: 8: 2931319 RTC +timer /proc/interrupts: 12: 19914 XT-PIC i8042 /proc/interrupts: 24: 6094 CLIPPER eth0 /proc/interrupts: 28: 73840 CLIPPER ide0 /proc/interrupts: ERR: 0 /proc/meminfo: MemTotal: 122488 kB /proc/meminfo: MemFree: 18288 kB /proc/meminfo: Buffers: 3936 kB /proc/meminfo: Cached: 36688 kB /proc/meminfo: SwapCached: 30640 kB /proc/meminfo: Active: 62240 kB /proc/meminfo: Inactive: 21408 kB /proc/meminfo: SwapTotal: 1875960 kB /proc/meminfo: SwapFree: 1740024 kB /proc/meminfo: Dirty: 200 kB /proc/meminfo: Writeback: 0 kB /proc/meminfo: AnonPages: 38656 kB /proc/meminfo: Mapped: 18824 kB /proc/meminfo: Slab: 11824 kB /proc/meminfo: SReclaimable: 4712 kB /proc/meminfo: SUnreclaim: 7112 kB /proc/meminfo: PageTables: 2504 kB /proc/meminfo: NFS_Unstable: 0 kB /proc/meminfo: Bounce: 0 kB /proc/meminfo: WritebackTmp: 0 kB /proc/meminfo: CommitLimit: 1937200 kB /proc/meminfo: Committed_AS: 325968 kB /proc/meminfo: VmallocTotal: 8388608 kB /proc/meminfo: VmallocUsed: 2664 kB /proc/meminfo: VmallocChunk: 8385320 kB /proc/bus/input/devices: I: Bus=0011 Vendor=0001 Product=0001 Version=ab41 /proc/bus/input/devices: N: Name="AT Translated Set 2 keyboard" /proc/bus/input/devices: P: Phys=isa0060/serio0/input0 /proc/bus/input/devices: S: Sysfs=/class/input/input0 /proc/bus/input/devices: U: Uniq= /proc/bus/input/devices: H: Handlers=kbd event0 /proc/bus/input/devices: B: EV=120013 /proc/bus/input/devices: B: KEY=402000000 3803078f800d001 feffffdfffefffff fffffffffffffffe /proc/bus/input/devices: B: MSC=10 /proc/bus/input/devices: B: LED=7 /proc/bus/input/devices: /proc/bus/input/devices: I: Bus=0010 Vendor=001f Product=0001 Version=0100 /proc/bus/input/devices: N: Name="PC Speaker" /proc/bus/input/devices: P: Phys=isa0061/input0 /proc/bus/input/devices: S: Sysfs=/class/input/input1 /proc/bus/input/devices: U: Uniq= /proc/bus/input/devices: H: Handlers=kbd event1 /proc/bus/input/devices: B: EV=40001 /proc/bus/input/devices: B: SND=6 /proc/bus/input/devices: /proc/bus/input/devices: I: Bus=0011 Vendor=0002 Product=0006 Version=0000 /proc/bus/input/devices: N: Name="ImExPS/2 Generic Explorer Mouse" /proc/bus/input/devices: P: Phys=isa0060/serio1/input0 /proc/bus/input/devices: S: Sysfs=/class/input/input2 /proc/bus/input/devices: U: Uniq= /proc/bus/input/devices: H: Handlers=mouse0 event2 /proc/bus/input/devices: B: EV=7 /proc/bus/input/devices: B: KEY=1f0000 0 0 0 0 /proc/bus/input/devices: B: REL=143 /proc/bus/input/devices:
So reports various bit of hardware, using some of the commands we've already used, and a few we haven't. These results identify the IDE controller as a CMD646, and the default memory as 128 MiB.
dmesg
The system messages report on the discovery of hardware and loading of suitable drivers, Due to some messages, I'm looking directly at the system log to get to the same messages.
# head -250 /var/log/syslog imklog 3.18.6, log source = /proc/kmsg started. [ 0.000000] Initializing cgroup subsys cpu [ 0.000000] Linux version 2.6.26-2-alpha-generic (Debian 2.6.26-29) (dannf@debian.org) (gcc version 4.1.3 20080704 (prerelease) (Debian 4.1.2-25)) #1 Sun Mar 4 21:08:03 UTC 2012 [ 0.000000] Booting GENERIC on Tsunami variation Clipper using machine vector Clipper from SRM [ 0.000000] Major Options: MAGIC_SYSRQ [ 0.000000] Command line: root=/dev/hda4 [ 0.000000] memcluster 0, usage 1, start 0, end 15 [ 0.000000] memcluster 1, usage 0, start 15, end 16384 [ 0.000000] freeing pages 15:2048 [ 0.000000] freeing pages 2987:16384 [ 0.000000] reserving pages 2987:2988 [ 0.000000] Initial ramdisk at: 0xfffffc0007728000 (9271610 bytes) [ 0.000000] 1024K Bcache detected; load hit latency 2 cycles, load miss latency 7 cycles [ 0.000000] On node 0 totalpages: 16384 [ 0.000000] DMA zone: 112 pages used for memmap [ 0.000000] DMA zone: 0 pages reserved [ 0.000000] DMA zone: 16272 pages, LIFO batch:3 [ 0.000000] Normal zone: 0 pages used for memmap [ 0.000000] Movable zone: 0 pages used for memmap [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16272 [ 0.000000] Kernel command line: root=/dev/hda4 [ 0.000000] PID hash table entries: 512 (order: 9, 4096 bytes) [ 0.000000] HWRPB cycle frequency bogus, and unable to estimate a proper value! [ 0.000000] Using epoch = 1980 [ 0.000000] Turning on RTC interrupts. [4194001.864388] Console: colour VGA+ 80x25 [4194001.864388] console [tty0] enabled [4194001.868294] Dentry cache hash table entries: 16384 (order: 4, 131072 bytes) [4194001.868294] Inode-cache hash table entries: 8192 (order: 3, 65536 bytes) [4194001.876107] Memory: 113000k/131072k available (2162k kernel code, 17824k reserved, 3314k data, 304k init) [4194001.880990] Calibrating delay loop... 591.92 BogoMIPS (lpj=288768) [4194001.911263] Security Framework initialized [4194001.913216] Capability LSM initialized [4194001.913216] Mount-cache hash table entries: 512 [4194001.923958] Initializing cgroup subsys ns [4194001.923958] Initializing cgroup subsys cpuacct [4194001.923958] Initializing cgroup subsys devices [4194001.945443] net_namespace: 1208 bytes [4194001.949349] NET: Registered protocol family 16 [4194001.958138] EISA bus registered [4194001.964974] pci: enabling save/restore of SRM state [4194001.985482] Linux Plug and Play Support v0.97 (c) Adam Belay [4194002.008919] NET: Registered protocol family 2 [4194002.018685] IP route cache hash table entries: 1024 (order: 0, 8192 bytes) [4194002.025521] TCP established hash table entries: 4096 (order: 3, 65536 bytes) [4194002.025521] TCP bind hash table entries: 4096 (order: 2, 32768 bytes) [4194002.026497] TCP: Hash tables configured (established 4096 bind 4096) [4194002.026497] TCP reno registered [4194002.030404] NET: Registered protocol family 1 [4194002.036263] checking if image is initramfs... it is [4194004.932746] Freeing initrd memory: 9054k freed [4194004.940558] VFS: Disk quotas dquot_6.5.1 [4194004.940558] Dquot-cache hash table entries: 1024 (order 0, 8192 bytes) [4194004.942512] msgmni has been set to 238 [4194004.944465] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253) [4194004.944465] io scheduler noop registered [4194004.945441] io scheduler anticipatory registered [4194004.945441] io scheduler deadline registered [4194004.945441] io scheduler cfq registered (default) [4194004.946418] isapnp: Scanning for PnP cards... [4194005.392707] isapnp: No Plug & Play device found [4194005.425910] Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled [4194005.427863] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A [4194005.428839] serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A [4194005.448371] brd: module loaded [4194005.452277] serio: i8042 KBD port at 0x60,0x64 irq 1 [4194005.452277] serio: i8042 AUX port at 0x60,0x64 irq 12 [4194005.459113] mice: PS/2 mouse device common for all mice [4194005.466925] TCP cubic registered [4194005.466925] NET: Registered protocol family 17 [4194005.468879] registered taskstats version 1 [4194005.468879] drivers/rtc/hctosys.c: unable to open rtc device (rtc0) [4194005.468879] Freeing unused kernel memory: 304k freed [4194005.565558] input: AT Translated Set 2 keyboard as /class/input/input0 [4194018.421020] Intel(R) PRO/1000 Network Driver - version 7.3.20-k2-NAPI [4194018.421020] Copyright (c) 1999-2006 Intel Corporation. [4194018.422973] PCI: Setting latency timer of device 0000:00:01.0 to 64 [4194018.823364] e1000: 0000:00:01.0: e1000_probe: (PCI:33MHz:32-bit) 52:54:00:12:34:56 [4194018.980590] Uniform Multi-Platform E-IDE driver [4194018.980590] ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx [4194019.174926] e1000: eth0: e1000_probe: Intel(R) PRO/1000 Network Connection [4194019.175903] CMD646: IDE controller (0x1095:0x0646 rev 0x07) at PCI slot 0000:00:02.0 [4194019.176879] CMD646: UltraDMA capable [4194019.176879] CMD646: 100% native mode on irq 28 [4194019.176879] CMD646: IDE port disabled [4194019.177856] PCI: Setting latency timer of device 0000:00:02.0 to 64 [4194019.177856] ide0: BM-DMA at 0x8040-0x8047 [4194019.178832] Probing IDE interface ide0... [4194019.592895] hda: QEMU HARDDISK, ATA DISK drive [4194020.438597] hdb: QEMU DVD-ROM, ATAPI CD/DVD-ROM drive [4194020.491332] hda: host max PIO5 wanted PIO255(auto-tune) selected PIO4 [4194020.492308] hda: UDMA/33 mode selected [4194020.493285] hdb: host max PIO5 wanted PIO255(auto-tune) selected PIO0 [4194020.493285] hdb: UDMA/33 mode selected [4194020.493285] ide0 at 0x8050-0x8057,0x8062 on irq 28 [4194020.641722] SCSI subsystem initialized [4194020.669066] libata version 3.00 loaded. [4194021.238402] hda: max request size: 512KiB [4194021.238402] hda: 18874368 sectors (9663 MB) w/256KiB Cache, CHS=16383/255/63 [4194021.242308] hda: cache flushes supported [4194021.243285] hda: hda1 hda2 hda3 hda4 [4194021.286253] hdb: ATAPI 4X DVD-ROM drive, 512kB Cache [4194021.289183] Uniform CD-ROM driver Revision: 3.20 [4194024.497189] EXT3-fs: INFO: recovery required on readonly filesystem. [4194024.497189] EXT3-fs: write access will be enabled during recovery. [4194027.244258] kjournald starting. Commit interval 5 seconds [4194027.244258] EXT3-fs: recovery complete. [4194027.246211] EXT3-fs: mounted filesystem with ordered data mode. [4194030.163202] udevd version 125 started [4194048.779403] input: PC Speaker as /class/input/input1 [4194049.038192] input: ImExPS/2 Generic Explorer Mouse as /class/input/input2 [4194053.147565] Adding 1875960k swap on /dev/hda3. Priority:-1 extents:1 across:1875960k [4194053.719830] EXT3 FS on hda4, internal journal [4194055.919048] loop: module loaded [4194062.981544] e1000: eth0: e1000_watchdog: NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX [origin software="rsyslogd" swVersion="3.18.6" x-pid="1253" x-info="http://www.rsyslog.com"] restart DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 6 DHCPOFFER from 10.0.2.2 DHCPREQUEST on eth0 to 255.255.255.255 port 67 DHCPACK from 10.0.2.2 bound to 10.0.2.15 -- renewal in 36045 seconds. Found user 'avahi' (UID 104) and group 'avahi' (GID 109). Successfully dropped root privileges. avahi-daemon 0.6.23 starting up. Successfully called chroot(). Successfully dropped remaining capabilities. No service file found in /etc/avahi/services. [4194069.542088] NET: Registered protocol family 10 [4194069.546971] lo: Disabled Privacy Extensions Joining mDNS multicast group on interface eth0.IPv6 with address fe80::5054:ff:fe12:3456. New relevant interface eth0.IPv6 for mDNS. Joining mDNS multicast group on interface eth0.IPv4 with address 10.0.2.15. New relevant interface eth0.IPv4 for mDNS. Network interface enumeration completed. Registering new address record for fe80::5054:ff:fe12:3456 on eth0.*. Registering new address record for 10.0.2.15 on eth0.IPv4. Registering HINFO record with values 'ALPHA'/'LINUX'. [4194070.707126] parport0: PC-style at 0x378 [PCSPP,TRISTATE] [4194070.898533] lp0: using parport0 (polling). Server startup complete. Host name is qalp-d5.local. Local service cookie is 1033850574. [4194071.242282] ppdev: user-space parallel port driver Leaving mDNS multicast group on interface eth0.IPv6 with address fe80::5054:ff:fe12:3456. Joining mDNS multicast group on interface eth0.IPv6 with address fec0::5054:ff:fe12:3456. Registering new address record for fec0::5054:ff:fe12:3456 on eth0.*. Withdrawing address record for fe80::5054:ff:fe12:3456 on eth0. Started up. <info> starting... <info> eth0: Device is fully-supported using driver 'e1000'. <info> nm_device_init(): waiting for device's worker thread to start <info> nm_device_init(): device's worker thread started, continuing. <info> Now managing wired Ethernet (802.3) device 'eth0'. <info> Deactivating device eth0. Withdrawing address record for 10.0.2.15 on eth0. Leaving mDNS multicast group on interface eth0.IPv4 with address 10.0.2.15. Interface eth0.IPv4 no longer relevant for mDNS. Withdrawing address record for fec0::5054:ff:fe12:3456 on eth0. Leaving mDNS multicast group on interface eth0.IPv6 with address fec0::5054:ff:fe12:3456. Joining mDNS multicast group on interface eth0.IPv6 with address fe80::5054:ff:fe12:3456. IPV6_ADD_MEMBERSHIP failed: Invalid argument Registering new address record for fe80::5054:ff:fe12:3456 on eth0.*. Withdrawing address record for fe80::5054:ff:fe12:3456 on eth0. Interface eth0.IPv6 no longer relevant for mDNS. <info> Will activate wired connection 'eth0' because it now has a link. <info> SWITCH: no current connection, found better connection 'eth0'. message_handler: message handler not found under /com/redhat/dhcp/eth0 for sub-path eth0.dbus.get.reason <info> Will activate connection 'eth0'. <info> Device eth0 activation scheduled... <info> Activation (eth0) started... <info> Activation (eth0) Stage 1 of 5 (Device Prepare) scheduled... <info> Activation (eth0) Stage 1 of 5 (Device Prepare) started... <info> Activation (eth0) Stage 2 of 5 (Device Configure) scheduled... <info> Activation (eth0) Stage 1 of 5 (Device Prepare) complete. <info> Activation (eth0) Stage 2 of 5 (Device Configure) starting... <info> Activation (eth0) Stage 2 of 5 (Device Configure) successful. <info> Activation (eth0) Stage 3 of 5 (IP Configure Start) scheduled. <info> Activation (eth0) Stage 2 of 5 (Device Configure) complete. <info> Activation (eth0) Stage 3 of 5 (IP Configure Start) started... <info> Activation (eth0) Beginning DHCP transaction. <info> DHCP daemon state is now 12 (successfully started) for interface eth0 <info> Activation (eth0) Stage 3 of 5 (IP Configure Start) complete. Anacron 2.3 started on 2021-05-31 Will run job `cron.daily' in 5 min. Will run job `cron.weekly' in 10 min. Will run job `cron.monthly' in 15 min. Jobs will be executed sequentially <info> DHCP daemon state is now 1 (starting) for interface eth0 DHCPREQUEST on eth0 to 255.255.255.255 port 67 DHCPACK from 10.0.2.2 Joining mDNS multicast group on interface eth0.IPv4 with address 10.0.2.15. New relevant interface eth0.IPv4 for mDNS. Registering new address record for 10.0.2.15 on eth0.IPv4. Withdrawing address record for 10.0.2.15 on eth0. Leaving mDNS multicast group on interface eth0.IPv4 with address 10.0.2.15. Interface eth0.IPv4 no longer relevant for mDNS. Joining mDNS multicast group on interface eth0.IPv4 with address 10.0.2.15. New relevant interface eth0.IPv4 for mDNS. Registering new address record for 10.0.2.15 on eth0.IPv4. (CRON) INFO (pidfile fd = 3) (CRON) STARTUP (fork ok) (CRON) INFO (Running @reboot jobs) <info> DHCP daemon state is now 4 (reboot) for interface eth0 <info> Activation (eth0) Stage 4 of 5 (IP Configure Get) scheduled... <info> Activation (eth0) Stage 4 of 5 (IP Configure Get) started... bound to 10.0.2.15 -- renewal in 40400 seconds. message_handler: message handler not found under /com/redhat/dhcp/eth0 for sub-path eth0.dbus.get.host_name message_handler: message handler not found under /com/redhat/dhcp/eth0 for sub-path eth0.dbus.get.domain_name message_handler: message handler not found under /com/redhat/dhcp/eth0 for sub-path eth0.dbus.get.domain_search message_handler: message handler not found under /com/redhat/dhcp/eth0 for sub-path eth0.dbus.get.nis_domain message_handler: message handler not found under /com/redhat/dhcp/eth0 for sub-path eth0.dbus.get.nis_servers <info> Retrieved the following IP4 configuration from the DHCP daemon: <info> address 10.0.2.15 <info> netmask 255.255.255.0 <info> broadcast 10.0.2.255 <info> gateway 10.0.2.2 <info> nameserver 10.0.2.3 message_handler: message handler not found under /com/redhat/dhcp/eth0 for sub-path eth0.dbus.get.interface_mtu <info> Activation (eth0) Stage 5 of 5 (IP Configure Commit) scheduled... <info> Activation (eth0) Stage 4 of 5 (IP Configure Get) complete. <info> Activation (eth0) Stage 5 of 5 (IP Configure Commit) started... Withdrawing address record for 10.0.2.15 on eth0. Leaving mDNS multicast group on interface eth0.IPv4 with address 10.0.2.15. Interface eth0.IPv4 no longer relevant for mDNS. Joining mDNS multicast group on interface eth0.IPv4 with address 10.0.2.15. New relevant interface eth0.IPv4 for mDNS. Registering new address record for 10.0.2.15 on eth0.IPv4. <info> Activation (eth0) successful, device activated. <info> Activation (eth0) Finish handler scheduled. <info> Activation (eth0) Stage 5 of 5 (IP Configure Commit) complete. [4194092.517662] TSUNAMI machine check: vector=0x0 pc=0x1200d1bdc code=0x0 [4194092.517662] machine check type: unknown [4194092.517662] pc = [<00000001200d1bdc>] ra = [<00000001200909a0>] ps = 0008 Not tainted [4194092.517662] pc is at 0x1200d1bdc [4194092.517662] ra is at 0x1200909a0 [4194092.517662] v0 = 0000020000938000 t0 = 0000000000000207 t1 = 00000001202568e0 [4194092.517662] t2 = 0000000000000002 t3 = 0000000000000000 t4 = 0000000000000000 [4194092.517662] t5 = 0000020000416d20 t6 = 0000000000000004 t7 = 0000000000000004 [4194092.517662] a0 = 0000020000938000 a1 = 0000000000000000 a2 = 0000000000000028 [4194092.517662] a3 = 0000000000000000 a4 = 0000000000000005 a5 = 00000800000c0000 [4194092.517662] t8 = 00000001203a5130 t9 = 00000200007ed43c t10= 00000000000a0000 [4194092.517662] t11= 0000000000002000 pv = 00000001200d1bd0 at = 000000000baa0e6f [4194092.517662] gp = 0000000120267ae0 sp = fffffc0006a24000
Allowing for the appearance of some daemon start-up messages, this looks in line with our other findings. Although I'm not sure what the "TSUNAMI machine check" thing is about (I suspect an issue with the firmware), but there are a lot of repeats of this message in the system log, which makes dmesg a little awkward to use.
In any case we see the usual QEMU fingerprint in the disk drive names with "QEMU" appearing as the manufacturer string.
Benchmark
As well as the BogoMips pseudo-benchmark, it would be useful to have a more computational performance measure...
OpenSSL
The OpenSSL package includes a performance benchmark for each of the provided cryptographic algorithms. Since we're dealing with older systems we'll use the older RSA and MD5 methods:
$ openssl speed md5 Doing md5 for 3s on 16 size blocks: 550976 md5's in 3.45s Doing md5 for 3s on 64 size blocks: 449881 md5's in 3.25s Doing md5 for 3s on 256 size blocks: 389808 md5's in 3.50s Doing md5 for 3s on 1024 size blocks: 248046 md5's in 3.76s Doing md5 for 3s on 8192 size blocks: 52369 md5's in 3.83s OpenSSL 0.9.8g 19 Oct 2007 built on: Wed Jan 18 22:51:04 UTC 2012 options:bn(64,64) md2(int) rc4(ptr,int) des(idx,risc1,16,long) aes(partial) blowfish(idx) compiler: gcc -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DTERMIO -O3 -Wa,--noexecstack -g -Wall available timing options: TIMES TIMEB HZ=1024 [sysconf value] timing function used: times The 'numbers' are in 1000s of bytes per second processed. type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes md5 2558.73k 8848.56k 28471.95k 67522.09k 112009.95k $ openssl speed rsa Doing 512 bit private rsa's for 10s: 4244 512 bit private RSA's in 11.53s Doing 512 bit public rsa's for 10s: 74102 512 bit public RSA's in 11.56s Doing 1024 bit private rsa's for 10s: 1503 1024 bit private RSA's in 11.75s Doing 1024 bit public rsa's for 10s: 38062 1024 bit public RSA's in 11.96s Doing 2048 bit private rsa's for 10s: 348 2048 bit private RSA's in 11.78s Doing 2048 bit public rsa's for 10s: 15696 2048 bit public RSA's in 11.32s Doing 4096 bit private rsa's for 10s: 73 4096 bit private RSA's in 11.73s Doing 4096 bit public rsa's for 10s: 5913 4096 bit public RSA's in 12.07s OpenSSL 0.9.8g 19 Oct 2007 built on: Wed Jan 18 22:51:04 UTC 2012 options:bn(64,64) md2(int) rc4(ptr,int) des(idx,risc1,16,long) aes(partial) blowfish(idx) compiler: gcc -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DTERMIO -O3 -Wa,--noexecstack -g -Wall available timing options: TIMES TIMEB HZ=1024 [sysconf value] timing function used: times sign verify sign/s verify/s rsa 512 bits 0.002718s 0.000156s 367.9 6409.4 rsa 1024 bits 0.007814s 0.000314s 128.0 3182.7 rsa 2048 bits 0.033837s 0.000721s 29.6 1386.9 rsa 4096 bits 0.160718s 0.002041s 6.2 489.9
Extracting relevant figures for comparisons:
- OpenSSL speed MD5 8,192 bytes: 112,009.95k
- OpenSSL speed RSA 4,096 bytes sign/s: 6.2
- OpenSSL speed RSA 4,096 bytes verify/s: 489.9
For comparison the AlphaVM benchmarks (Benchmarks - EmuVM) include figures from real hardware. For this case the Compaq DS10 6/466 results provide the most useful comparison:
- OpenSSL speed MD5 8,192 bytes: 42,636k
- OpenSSL speed RSA 4,096 bytes sign/s: 3.5
- OpenSSL speed RSA 4,096 bytes verify/s: 232.0
As the DS10 is running an EV6 at 466 MHz, and our emulated processor is an EV67 running at about 250 Mhz we expect the DS10 to have roughly twice the performance. But the opposite turns out to be the case. There are a number of possible reasons for this:
- OpenSSL speed changes. Operating system and version differences, may mean differences in the execution of the 'speed' methods.
- OpenSSL implementation improvements. The reference would have used the OpenSSL provided with Tru64 or OpenVMS. Checking Tru64 5.1B that was "OpenSSL 0.9.6g [engine] 9 Aug 2002", but we're using "OpenSSL 0.9.8g 19 Oct 2007"
- Differences in compiler optimization. The reference would have been built using the native compiler, but the version we're using was built with GCC. There will be differences in the compiler optimizations that have an effect on performance.
- Operating system library performance and optimizations. Probably not a huge difference, but worth bearing in mind.
- QEMU's processor emulation is likely more efficient for some instructions and less efficient for others. So it is possible that the mix used in this test favors the emulation compared to real hardware.
So bearing in mind the flaws of benchmarks and emulation, and the differences in operating systems and compilers, it looks like this QEMU system has better performance for this specific kind of workload than the original hardware.
Thoughts
QEMU provides an emulated Alpha system that looks similar to the real thing:
- Compaq ES40 67/667:
- CPU: 1 to 4 Alpha 21264 (EV67) processors at 667 MHz
- RAM: from 512 MiB or 1 GiB to 16 or 32 GiB (depending on model)
- Network: various, including
- Intel i8255x based 10/100 ethernet (DE602)
- Broadcom based 10/100/1000 ethernet (DEGXA)
- Disk controllers:
- integrated IDE (Acer Labs M1543C) with CD-ROM drive
- SCSI Ultra2 LVD (KZPCA-AA; NCR53C895) with 18, 36 or 72 GB drive
- Graphics: optional
- Multi-function DEPVZ card, includes a Permedia 2 graphics adapter
- 3Dlabs Oxygen VX1 (aka. Permedia 3)
- Radeon 7500 (PBXGG)
- PowerStorm 300 or 350 (PBXGD), REALimage 2100 chipset
- Misc.: Acer Labs M1543C providing 1 parallel, 2 serial, USB, floppy, keyboard & mouse
- QEMU Tsunami/Clipper
- CPU: 1 or more Alpha EV67 (default) processors at ~250 MHz
- RAM: 128 MiB (default) or more (limited by host system RAM?)
- Network: various, including
- Intel PRO/1000 (aka. e1000) 82540EM based gigabit ethernet (default)
- DEC Tulip based 10/100 ethernet (DE4xx and DE5xx)
- Disk controllers:
- IDE CMD646 (default)
- various SCSI controllers including NCR53C810 & LSI53C895a
- Graphics: Cirrus Logic CL-GD5446 (default)
- Misc.: 1 parallel, 2 serial, keyboard & mouse
So the emulated system feels like an ES40 fitted with older cards. This could help compatibility, since the main operating systems for Alpha support a limited range of hardware, as do the SRM and AlphaBIOS firmware. However this is only an issue during boot for Linux, with probing of devices and many available drives mitigating the issue once the system is up and running.
While a real ES40 uses a different IDE controller, the CMD646 was used on early Digital Personal Workstation "Miata" MX5 mainboards, however the version of the CMD646 used suffered from issues with DMA, which meant later models used a revised mainboard (MiataGL) with a different IDE controller. The QEMU emulated CMD646 reports as a version of the chipset (0x07 aka. PCI0646U2) in which the issue had been fixed, and the dmesg output shows that UltraDMA mode is being enabled. For more information on the issue see the FreeBSD/alpha documentation and the source for the CMD64x Linux driver.
The emulated system performance falls a bit short of a real ES40. However this Linux for Alpha installation looks to be working fine, and performance is on a par with some of the older Alpha workstations and servers, so not an issue for experimenting with an Alpha based environment.
The BogoMIPS (Wikipedia; TLDP) result given by the system is reasonably consistent with the claimed processor clock of 250 MHz, and resembles the performance of the Alpha workstations of the mid-1990s. Realistically this is not bad for an emulated processor running in a virtual machine (Debian 10 on VirtualBox on MS Windows 10) on a processor more than 10 years old (Intel i7-860), especially since the default emulation is being used with no additional tuning.
Further Sources
Additional sources:
- Documentation/Platforms/Alpha - QEMU
- System emulation using QEMU
- Alpha Linux on Qemu | Fun with virtualization
- firstworks systems: Debian 5.0.10 Alpha
- Gentoo Forums :: View topic - DEC Alpha - boot partitions : SRM/aboot [workaround found]
- Alpha based systems:
- AlphaStation - Wikipedia
- AlphaServer - Wikipedia
- Alpha Processor Inc. (API):
- AlphaPC 264DP (MikeRoHard.de)
- UP1000 (AlphaLinux, MikeRoHard.de) & UP1100 (AlphaLinux, MikeRoHard.de)
- UP1500 (AlphaLinux, ManualsLib)
- UP2000 (MikeRoHard.de) & UP2000+ (MikeRoHard.de)
- CS20 (MikeRoHard.de)
- Compaq AlphaServer ES40 Compaq AlphaStation ES40 (QuickSpecs/c04282237.pdf)
- FreeBSD/alpha documentation
- Debian GNU/Linux Installation Guide for Debian 5 ("lenny") for the Alpha
Update 17-Jun-2021: added OpenSSL benchmark
Installation Notes - Debian Linux 5 ("lenny")
Installing Linux for Alpha on a QEMU emulated Alpha machine, encounters a few issues...
QEMU Command
The limitations of the current QEMU Alpha firmware, mean that it can't boot the system using the regular boot loader. Instead we need to extract the installation boot kernel and initrd from the installation media:
$ mkdir tmp_mnt $ fuseiso debian-5010-alpha-DVD-1.iso tmp_mnt $ cp tmp_mnt/boot/vmlinuz ./ $ cp tmp_mnt/boot/initrd.gz ./ $ fusermount -u tmp_mnt $ zcat vmlinuz > vmlinux
The last step makes an uncompressed copy of the kernel that we can pass to QEMU.
qemu-system-alpha \ -kernel vmlinux \ -initrd initrd.gz \ -drive file=hda_alpha_debian5.qcow2,if=ide \ -drive file=debian-5010-alpha-DVD-1.iso,if=ide,media=cdrom \ -net nic -net user \ -name 'Debian Linux 5 Installation on Alpha'
The kernel and ram-disk will start the Debian Installer, and later mount the DVD that contains the software repository.
Partitioning the Disk
The Alpha QEMU firmware (SRM analogue) expects the boot drive to have a BSD-like OSF/1 disk label rather than a MS DOS style (MBR) or GPT style partition table. Creating this on Linux is a bit tricky (see Further Sources), so I'm using an existing image with a OSF/1 disk label.
This disk started as a 2 GiB disk image, but I want a bit more space for an install from the DVD:
$ qemu-img info hda_alpha_debian5.qcow2 image: hda_alpha_debian5.qcow2 file format: qcow2 virtual size: 2 GiB (2147483648 bytes) disk size: 928 MiB cluster_size: 65536 Format specific information: compat: 1.1 compression type: zlib lazy refcounts: false refcount bits: 16 corrupt: false extended l2: false
So it needed to be resized:
$ qemu-img resize hda_alpha_debian5.qcow2 +7G Image resized.
To get a 9 GiB disk for the installation:
$ qemu-img info hda_alpha_debian5.qcow2 image: hda_alpha_debian5.qcow2 file format: qcow2 virtual size: 9 GiB (9663676416 bytes) disk size: 928 MiB cluster_size: 65536 Format specific information: compat: 1.1 compression type: zlib lazy refcounts: false refcount bits: 16 corrupt: false extended l2: false
While this has resized the disk image, the disk information in the existing disk label has not been updated, so we are going to have to update that too.
The 2 GiB image used a disk geometry of:
bytes/sector: 512 sectors/track: 63 tracks/cylinder: 255 cylinders: 261 sectors/cylinder: 16065 rpm: 3600 interleave: 1 trackskew: 0 cylinderskew: 0 headswitch: 0 track-to-track seek: 0
Using this as a starting point we calculate the number of cylinders that would give ~9 GiB of disk space:
9 GiB => 9,663,676,416 bytes / 512 => 18,874,368 sectors / 16065 => 1,174.87 cylinders
So if we update the disk label information and set the 'cylinders' parameter to 1174, that will give a close to 9 GiB disk, and then the partitions can be adjusted to fit.
So we run the Debian Installation process up to the "Partition disks" stage, where we're presented with a "Partitioning method" menu, so we can be sure of disk detection has been run and the corresponding device files created.
For the moment we don't use the partitioner, but instead hit Esc twice to get to the "Debian installer main menu". Once there scroll down and select the "Execute a shell" option, to run a command prompt that will give us access to the command-line partitioning tools.
Once at the command prompt start fdisk on the hard-disk, if you're not sure of which device corresponds to the disk, check dmesg to see the detection messages.
The disk I'm using as a starting point has a basic layout with:
- slice a aka. hda1 - small partition for the boot loader aboot
- slice b aka. hda2 - small partition for boot files mounts as /boot
- slice c aka. hda3 - large partition for all the other files, mounts as /
- slice d aka. hda4 - swap space
Since this is a small disk the '/' partition is quite small, but it looks a reasonable size to use for swap space, so I'm going to switch the swap space with the main partition, and make a larger main partition. While we won't actually need the boot loader partition, since we're loading the kernel directly, I'll leave it in so the installer has some where to go for that stage.
# fdisk /dev/hda Detected an OSF/1 disklabel on /dev/hda, entering disklabel mode. BSD disklabel command (m for help): m Command action d delete a BSD partition e edit drive data i install bootstrap l list known filesystem types m print this menu n add a new BSD partition p print BSD partition table q quit without saving changes r return to main menu s show complete disklabel t change a partition's filesystem id u change units (cylinders/sectors) w write disklabel to disk BSD disklabel command (m for help): p 5 partitions: # start end size fstype [fsize bsize cpg] a: 1* 1* 0* ext2 b: 1* 10* 9* ext2 c: 10* 244* 233* ext2 d: 244* 262* 17* swap BSD disklabel command (m for help): s # /dev/hda: type: SCSI disk: label: flags: bytes/sector: 512 sectors/track: 63 tracks/cylinder: 255 sectors/cylinder: 16065 cylinders: 261 rpm: 3600 interleave: 1 trackskew: 0 cylinderskew: 0 headswitch: 0 # milliseconds track-to-track seek: 0 # milliseconds drivedata: 0 5 partitions: # start end size fstype [fsize bsize cpg] a: 1* 1* 0* ext2 b: 1* 10* 9* ext2 c: 10* 244* 233* ext2 d: 244* 262* 17* swap BSD disklabel command (m for help): e bytes/sector (512): sectors/track (63): tracks/cylinder (255): cylinders (261): 1174 sectors/cylinder (16065): rpm (3600): interleave (1): trackskew (0): cylinderskew (0): headswitch (0): track-to-track seek (0): BSD disklabel command (m for help): u Changing display/entry units to sectors BSD disklabel command (m for help): p 5 partitions: # start end size fstype [fsize bsize cpg] a: 1 1954 1954 ext2 b: 1955 158205 156251 ext2 c: 158206 3910159 3751954 ext2 d: 3910160 4194303 284144 swap BSD disklabel command (m for help): d Partition (a-e): d BSD disklabel command (m for help): n Partition (a-p): d First sector (0-18860309, default 0): 3910160 Last sector or +size or +sizeM or +sizeK (3910160-18860309, default 18860309): Using default value 18860309 BSD disklabel command (m for help): t Partition (a-e): c Hex code (type L to list codes): L 0 unused 5 4.1BSD 9 4.4LFS d boot 1 swap 6 Eighth Edition a unknown e ADOS 2 Version 6 7 4.2BSD b HPFS f HFS 3 Version 7 8 ext2 c ISO-9660 10 AdvFS 4 System V Hex code (type L to list codes): 1 BSD disklabel command (m for help): t Partition (a-e): d Hex code (type L to list codes): 8 BSD disklabel command (m for help): p 5 partitions: # start end size fstype [fsize bsize cpg] a: 1 1954 1954 ext2 b: 1955 158205 156251 ext2 c: 158206 3910159 3751954 swap d: 3910160 18860309 14950150 ext2 BSD disklabel command (m for help): w Writing disklabel to /dev/hda. Syncing disks. Calling ioctl() to re-read partition table. BSD disklabel command (m for help): q #
So we have:
- Looked the the partition table (p)
- Looked at the disk-label information (s)
- Edited the disk-label to update the number of cylinders (e)
- Resized the last partition aka slice d:
- Delete slice d (d)
- Create slice d (n)
- Changed the type for slice c to 'swap' (t)
- Changed the type for slice d to 'ext2' (t)
- Committed the changes (w)
Now we'll give then an initial formatting, so the format detection will pick them up as we would expect:
# mkswap /dev/hda3 Setting up swapspace version 1, size = 1920992256 bytes # mkfs.ext3 -T small /dev/hda4 mke2fs 1.41.3 (12-Oct-2008) Filesystem label= OS type: Linux Block size=1024 (log=0) Fragment size=1024 (log=0) 1869824 inodes, 7475072 blocks 373753 blocks (5.00%) reserved for the super user First data block=1 Maximum filesystem blocks=74711040 913 block groups 8192 blocks per group, 8192 fragments per group 2048 inodes per group Superblock backups stored on blocks: 8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409, 663553, 1024001, 1990657, 2809857, 5120001, 5971969 Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 30 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override.
Okay now we have new partitions in place:
- slice a aka. hda1 - small partition for the boot loader aboot (unchanged)
- slice b aka. hda2 - small partition for boot files mounts as /boot (unchanged)
- slice c aka. hda3 - swap space
- slice d aka. hda4 - large partition for all the other files, mounts as /
Note: newer versions of Debian provide a BusyBox built-in version of fdisk, rather the older version used here. In my experiments the BusyBox version seems to have issues with managing a BSD disk-label, so I found using the older tools to work better.
Exit out of the shell, and abort this installation. This is very likely redundant, but this way we can be sure that the kernel sees only the new disk setup.
Actually Installing
So starting back up, we proceed through to the "Partition disks" stage of the installation process again. Here we select "Manual" and assign our disk slices mount points and roles:
- slice a aka. hda1 - aboot
- slice b aka. hda2 - /boot
- slice c aka. hda3 - swap
- slice d aka. hda4 - /
If the auto-detection has worked the system will have already assigned the aboot and swap slices to their roles. So we only have to deal with the '/boot' and '/' slices. Since we're keeping this, equivalent to a real hardware install, the partition configurations are:
- #2
- Set "Use as:" to "Ext2 file system"
- Set "Format the partition:" to "yes, format it"
- Set "Mount point:" to "/boot - static files of the boot loader"
- "Done setting up the partition"
- #4
- Set "Use as:" to "Ext3 journaling file system"
- Set "Format the partition:" to "no, keep existing data"
- Set "Mount point:" to "/ - the root file system"
- "Done setting up the partition"
- When all done "Finish partitioning and write changes to disk"
Since we already formatted our '/' filesystem, we don't bother reformatting it, this also preserves the "small" filesystem character we gave it earlier.
With this in place we can proceed with the rest of the installation, remembering that the remote repositories are not going to be available:
- For prompt "Use a network mirror?" respond "<No>"
- For warning "Cannot access repository" respond "<Continue>"
After a bit of time the main phase of the installation completes, and the installer starts to finalize the system. One of the parts of that is the "Install aboot on a hard disk" phase, which will fail and give an "Installation step failed" message. Since we're not going to actually use aboot, this isn't a problem, so we can skip this stage of the process, by selecting "Continue without boot loader" when presented with the "Debian installer main menu", this will give a message containing the location of the kernel and the required boot parameters:
You will need to boot manually with the /vmlinuz kernel on partition /dev/hda4 and root=/dev/hda4 passed as a kernel argument.
Before finishing the installation process, and stopping with an "Installation complete" message, that talks about rebooting. We don't want to reboot, since we need to extract the installed kernel and initrd from the installed system and boot with an updated command-line, which passes the boot parameter. So select "<Go back>" to get to the "Debian installer main menu" and select "Abort the installation" to perform a shutdown of the system.
Extract Installed Kernel
So we need to mount the installed system disk and copy the kernel and initrd so we can pass them to QEMU when booting. For this I use the libguestfs tools (libguestfs-tools package in Debian):
$ guestmount -a hda_alpha_debian5.qcow2 -m /dev/sda2 tmp_mnt $ ls tmp_mnt bootlx net_aboot.nh config-2.6.26-2-alpha-generic net_pad initrd.img-2.6.26-2-alpha-generic System.map-2.6.26-2-alpha-generic lost+found vmlinuz-2.6.26-2-alpha-generic $ cp tmp_mnt/initrd.img-2.6.26-2-alpha-generic ./ $ zcat tmp_mnt/vmlinuz-2.6.26-2-alpha-generic > ./vmlinux-2.6.26-2-alpha-generic $ guestunmount tmp_mnt
Note: we'll need to do this for any kernel and/or initrd updates, so we're booting with the right environment.
Start the Installed System
Now we start QEMU with the new kernel and initrd passing the root device for the new installation as a parameter:
$ qemu-system-alpha \ -drive file=hda_alpha_debian5.qcow2,if=ide \ -drive file=debian-5010-alpha-DVD-1.iso,if=ide,media=cdrom \ -net nic -net user \ -kernel vmlinux-2.6.26-2-alpha-generic \ -initrd initrd.img-2.6.26-2-alpha-generic \ -append 'root=/dev/hda4' \ -name 'Debian Linux 5 on Alpha'
Once booted, log in with the account you created during installation, and you're off...
No comments:
Post a Comment