You are here

OpenVMS on GNU/Linux – part 3 (Alpha emulation)

In this instalment we will try (mostly without success) to run Alpha emulation on GNU/Linux.  There are some links that are a good starting place.  There is a good starting guide about Personal Alpha, which was mentioned in the registration process.  However this software is not free and is not for a free operating system, but the link is useful for demonstrating the steps for installing OpenVMS.

Firstly we will try to use qemu.  Running qemu-system-alpha reports an error immediately: qemu: hardware error: no palcode provided.  The alpha architecture needs something called SRM PAL code to provide some basic system calls to OpenVMS or Tru64.  It turns out that this file for qemu is an alpha GNU/Linux ELF executable.  Next, download it with wget https://github.com/qemu/qemu/raw/master/pc-bios/palcode-clipper and try again.  Running qemu-system-alpha -snapshot -cdrom ALPHA084.ISO -bios ./palcode-clipper -nographic now provides a cryptic boot prompt with no apparent method to proceed.

PCI: 00:00:0 class 0300 id 1013:00b8
PCI:   region 0: 10000000
PCI:   region 1: 12000000
PCI: 00:01:0 class 0200 id 8086:100e
PCI:   region 0: 12020000
PCI:   region 1: 0000c000
PCI: 00:02:0 class 0101 id 1095:0646
PCI:   region 0: 0000c040
PCI:   region 1: 0000c048
PCI:   region 3: 0000c04c
>>> show dev
got: show dev
>>> boot
got: boot
>>>

It doesn't look like we are going to get very far with this.  Some searching located this page which gives a link to download software from emuvm.com, but this is not free software so we will come back to this later if all else fails.

Some additional investigation found some free software called ES40.  There are two versions released.  The stable version and the CVS version.  Both are quite old now, but code that has remained unchanged for years often means stable code.  We'll try the stable version first.  Download it, create a new directory, change into that directory and unzip the file, and install some development libraries if you don't have them installed already, e.g. apt-get install libsdl1.2-dev libsdl2-2.0-0 libpcap-dev libx11-dev.  Build the es40 executable by simply running make.

If you want a graphical console (I do not recommend it as it is slow and does not support X anyway), download the VGA BIOS with wget http://savannah.gnu.org/download/vgabios/vgabios-0.6a.debug.bin.  Also grab the SRM PAL code update from hp.com.  Edit the es40.cfg file and run ./es40 to start the emulation.

Pretty quickly I found that it would suffer from random seg faults.  I eventually managed to install OpenVMS by running a minimal installation multiple times.  But even then the system did not behave normally.  The installation had no node name and I could only load some of my PAK codes before I saw more segfaults whenever I ran show license.

So I tried the CVS version.  Installation of this newer version proved interesting.  All the source files are in DOS format (so the build rules do not work), the version of GNU auto tools is too old, another library is required, and another bug in the current GNU auto tools needs to be fixed.  Let's run through the steps to get this built.

mkdir es40_cvs
cd es40_cvs
unzip ../es40_cvs_20080503_1030_src.zip
for f in `find . -type f`; do sed -i -s "s/^V^M//g" $f; done
chmod +x reconf src/make_vms.sh
apt-get install libxt-dev libpoco-dev
./reconf

Now, in configure_2.sh, find the line below.

  if test "$sdl_found" = "true" ; then

Change it to this.  The script goes to great lengths to set the value to yes or no, then compares it to true, which will never work.

  if test "$sdl_found" = "yes" ; then

Now, just a few more steps.  Choose [yes] when running configure, below.

cd src
./make_vms.sh
cd ..
./configure
make -j 4

Now to test.  The OpenVMS installation disk did not suffer random seg faults, but installation could never reach more than 50% (about 439M of used disk space).  Trying the SCSI adapter instead of IDE proved even more unstable.  So this software will not suit our purposes either.

But we have the decompressed SRM ROM code now.  Perhaps we can use that with qemu and solve all our problems.  We will try.

objcopy decompressed.rom palcode-es40.o -I binary -O elf64-little --rename-section .data=.text,alloc,contents,load,readonly,code
ld --accept-unknown-input-arch -e _binary_decompressed_rom_start -M palcode-es40.o -o palcode-es40
objcopy palcode-es40 palcode-es40 -F elf64-little --change-section-address .text-0x400000
objcopy palcode-es40 palcode-es40 -F elf64-little --set-start 0x0
objcopy palcode-es40 palcode-es40 -F elf64-little --alt-machine-code=0x9026
qemu-system-alpha -snapshot -nographic -cdrom ALPHA084.ISO -bios ./palcode-es40

The result?  A hang.  Perhaps we have incorrect serial hardware and cannot see the SRM boot prompt.  But passing any old fake alpha executable to qemu causes a hang, so it is more likely that my method of converting the ROM image is flawed.

So now it seems the only option is to try the free of charge version of the commercial AlphaVM.  I thought this version would be crippled as the documentation states it run ten times slower than the commercial version.  But this was not the case; it actually ran faster than the free es40 software.  Please read the documentation carefully before setting up the configuartion file.  The applies especially around networking (server of type tap is not in the example configuation file).  Create a disk and run the installation of OpenVMS.  It actually works!  At the SRM prompt you may type show dev and then boot to start the system.  Install socat instead of PuTTY though with apt-get install socat.

No we've got OpenVMS installed, let's get the licenses on.  Build a CD ISO file with the PAKs and FAQ from HP.

xorriso -for_backup -outdev pak.iso -blank as_needed pathspecs on\
 -joliet on -volid PAK -fs 64m\
 -dummy off\
 -add /VMS_PAKS.COM=./vms_paks.com\
      /FAQ.TXT=./faq.txt

SImply reboot with the pak.iso CD loaded.  Logon to the console.

Username: system

Password:
%LICENSE-I-NOLICENSE, no license is active for this software product
%LOGIN-S-LOGOPRCON, login allowed from OPA0:
   Welcome to OpenVMS (TM) Alpha Operating System, Version V8.4
    Last interactive login on Friday, 14-FEB-2014 13:14:39.24

$ mount dka400 pak
%MOUNT-I-WRITELOCK, volume is write locked
%MOUNT-I-CDROM_ISO, PAK: (1 of 1) , mounted on  _DKA400:
$ copy dka400:[000000]vms_paks.com []
$ set file vms_paks.com /attribute=(rfm:STMLF)
$ dismount dka400
$ @vms_paks
%SHOW-I-NOLICENSE, no licenses exist
%LICENSE-I-DISABLED, ACMS HOBBYIST-VA-KEYXXXXX-XXXXXX has been disabled
%LICENSE-W-NOENT, no license was loaded for this product - DEC ACMS
%LICENSE-I-ENABLED, ACMS HOBBYIST-VA-KEYXXXXX-XXXXXX has been enabled
%LICENSE-I-LOADED, DEC ACMS was successfully loaded with 0 units
[...]

You can now logon to any terminal.  Now let's get networking up.  First IPv4.

$ @SYS$MANAGER:TCPIP$CONFIG.COM
%TCPIP-I-INFO, TCP/IP Services startup beginning at 15-FEB-2014 21:23:50.11
[...]
%TCPIP-I-DHCPC_STRD_CLNT, DHCP client started with PID 0000043E
%TCPIP-S-STARTDONE, TCP/IP Kernel startup completed
[...]
%TCPIP-S-STARTDONE, TCPIP$DHCP_CLIENT startup completed
%TCPIP-S-STARTDONE, TCPIP$SSH_CLIENT startup completed
%TCPIP-S-STARTDONE, TCP/IP Services startup completed at 15-FEB-2014 21:25:05.38

And finally, IPv6.

@TCPIP$IP6_SETUP.COM

Restart networking  using tcpip$config.com again.  Now enable the @SYS$STARTUP:TCPIP$STARTUP.COM call in SYS$STARTUP:SYSTARTUP_VMS.COM to enable TCP/IP services to start automatically each boot.

Define the system's queue(s) and enable the ENABLE AUTOSTART /QUEUES and START /QUEUE SYS$BATCH calls in the system startup.  You may also want to create a SYS$PRINT queue.

$ START/QUEUE/MANAGER/NEW
%JBC-I-CREATED, SYS$COMMON:[SYSEXE]QMAN$MASTER.DAT; created
$ INITIALIZE/QUEUE/START/BATCH/JOB_LIMIT=3 SYS$BATCH

Finally, create at least one user account.  Change the login directory to be [USERS.username], for tidyness.

$ create/directory sys$sysdevice:[users]
$ assign sys$sysdevice:[users.] sys$users
$ show log sys$users
   "SYS$USERS" = "SYS$SYSDEVICE:[USERS.]" (LNM$PROCESS_TABLE)

$ @SYS$EXAMPLES:ADDUSER.COM
Username(s) - separate by commas: ewan
Full name for EWAN: Ewan Parker
Password (password is not echoed to terminal) [EWAN]:
UIC Group number [200]:
UIC Member number: 200
Account name: STAFF
Privileges [TMPMBX,NETMBX]:
Login directory [EWAN]:
Login device [SYS$SYSDEVICE:]: sys$users:

%CREATE-I-CREATED, SYS$SYSDEVICE:[USERS.][EWAN] created
%UAF-I-ADDMSG, user record successfully added
%UAF-E-RDBADDERRU, unable to add EWAN value [000200,000200] to rights database
-SYSTEM-F-DUPIDENT, duplicate identifier
%UAF-I-DONEMSG, system authorization file modified
%UAF-I-RDBNOMODS, no modifications made to rights database

Is everything satisfactory with the account [YES]:

$ deassign sys$users
$ set def sys$system
$ run authorize
UAF> modify ewan /device=sys$sysdevice:
%UAF-I-MDFYMSG, user record(s) updated
UAF> modify ewan /directory=[users.ewan]
%UAF-I-MDFYMSG, user record(s) updated
UAF> exit
%UAF-I-DONEMSG, system authorization file modified
%UAF-I-RDBNOMODS, no modifications made to rights database
Classifications: 

Comments

It's been a while since this (great) article was written, I wonder if things have changed on the qemu front that would bring this closer to reality.

I still cannot get past the boot prompt or find free palcode that works. In fact the source code on GitHub reveals that this >>> boot prompt is just an empty infinite loop that is reached when no kernel address is passed. This suggests that the palcode-clipper is solely for Linux.

Agreed, and you can see from my ramblings how long it took to find any form of working emulation. Just have to wait for OpenVMS on the amd64 architecture.