lukebrennan@iinet.net.au alpha.eastwood ALPHA XL-366 (ev56) RedHat 7.2 2.4.18-27.7.x.milo gcc 2.96 MicroVAX 3100 m10e KA41-D V1.0

VAX Linux HowTo:

How Do I get the source-code for VAX Linux?

You can get all the sources from sourceforge.net. These are stored in a CVS repository. There are CVS clients for UNIXes, MacOS and Windows.
An excellent intro to CVS and howto is at http://sourceforge.net/docman/display_doc.php?docid=14033&group_id=1

You can browse the linux-vax modules via http://linux-vax.sourceforge.net/download/index.html.

Connect to the source-code repository for linux-vax
$ cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/linux-vax login
and checkout the module (ie you want to download the module sources to your local machine).
co modulename
or do it in one command (the -z3 just says to compress things using gzip)
$ cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/linux-vax co modulename
Once you have everything down, you can also keep it up-to-date by issuing an update command from within your source dir.
$ cvs update -dP

How do I build for a VAX ?

http://linux-vax.sourceforge.net/docs/README has all this in detail.

First, you need the cross-compiler tools to compile on your alternate Linux OS and hardware to generate the Linux VAX binaries.
$ mkdir vax
$ cd vax
$ cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/linux-vax login
$ cvs -z9 -d:pserver:anonymous@cvs.linux-vax.sourceforge.net:/cvsroot/linux-vax co toolchain
There's a supplied script (build-vax.sh) to help you here. (change it if you want different locations,etc)
$ cd toolchain
$ ./build-vax.sh
$ su
# ./build-vax.sh install
NOTE: on my RH 7.2 alpha system I had to install gperf before this would complete. http://ftp.gnu.org/gnu/gperf/gperf-3.0.1.tar.gz
OK, the cross-compiler stuff is ready! So, go grab the kernel-2.5 module (at time of writing, the best bet)
$ cd ..
$ cvs -z9 -d:pserver:anonymous@cvs.linux-vax.sourceforge.net:/cvsroot/linux-vax co kernel-2.5
cd into the kernel dir created by cvs and check the Makefile
$ cd kernel-2.5
Look into /kernel-2.5/arch/vax/configs and someone's made it easy! Just choose the appropriate one for your hardware. eg for SIMH, you'd use ka650_defconfig
I have an ancient KA41-D, so I'll select ka42_defconfig.
$ make ka42_defconfig
$ make
NOTE: this was built with a wired-in kernel command line of: "root=/dev/nfs nfsroot=/home/disk_vax/vaxroot ip=bootp rw debug"

How do I boot my VAX ?

MOP::config

You remember MOP, don't you? "maintenance operations protocol".
We're going to mopboot a kernel for the uVAX via a mopd server. (ie on the Linux host holding the kernel) and then provide a root via NFS. (no we don't use tftp, we're using MOP, which will look in the /tftpboot/mop directory, though)

So, first off, you need to get mopd! Grab from http://linux-vax.sourceforge.net/download/mopd-linux.tar.gz

Because I'm on an ALPHA that doesn't support a.out formats, I have to edit the Makefile to say
AOUT_SUPPORT="-DNOAOUT"
#AOUT_SUPPORT=""
You should be able to build by simply running make. Ignore all the warnings - they are completely harmless.
To remove the warnings, go into the .H files and put comments after the #endif _blah_ so that it is #endif /* _blah_ */
if you want to put mopd somewhere so you don't have to keep looking for it, /usr/local/bin might be best.
$ su
# cp mopd /usr/local/bin
# cp mopd.8 /usr/local/man/man8
Create the directory /tftpboot/mop as mopd looks here, (ONLY here!) when searching for boot images.
# mkdir /tftpboot/mop
Put your ethernet into promiscuous mode
# ifconfig eth0 promisc
Now we can start up the mopd service
# mopd eth0
Create a link from /tftpboot/mop/.SYS to the vmlinux.SYS file in your development tree. <ether> is the ethernet address matching your VAX, in _lowercase_ with no separators. e.g. 08002b315f25.SYS.
On your VAX, issue the command
>>> SHOW ETHER which returned 08-00-2B-31-5F-25
$ cd /tftpboot/mop
$ su
# ln -s /home/lukeb/vax/kernel-2.5/vmlinux.SYS 08002b315f25.SYS
(if you're not sure that the VAX is MOP loading this, run MOPTRACE and TCPDUMP to watch things)

Once your VAX can mopboot, it'll need to access the vaxroot remote file-system. You'll need your NFS service running. Locate the Services control under foot->Programs->System->Service Configuration and tick nfs. If nfs isn't there, you'll have to go find/install the rpm.

NFS::config

Create the directory that your VAX will use over NFS once it boots.
$ su
# mkdir -p /home/disk_vax
Download and unpack the VAXROOT tar into this directory and then tell NFS that it can be exported.
Note - you MUST be root when you unpack so that the device nodes get created properly.
http://linux-vax.sourceforge.net/download/vaxroot-20010920.tar.bz2
$ bunzip vaxroot-20010920.tar.bz2
# cd /home/disk_vax
# tar -xvf /home/lukeb/vaxroot-20010920.tar
CHANGE:
The /etc/hosts of vaxroot will probably need to know some of my local machines.
# emacs /home/disk_vax/vaxroot/etc/hosts
192.168.0.4 alpha.eastwood alpha
192.168.0.110 uVAX.eastwood uVAX
192.168.0.120 simhVAX.eastwood simhVAX
CHANGE:
and also correct the entry in /etc/sysconfig/network to match your machine.
# emacs /home/disk_vax/vaxroot/etc/sysconfig/network
NETWORKING=yes
HOSTNAME=uVAX
DOMAINNAME=eastwood
CHANGE:
and yet another thing - if you get to runlevel 3 but don't get a login prompt, then you may need to alter the inittab file so that it references /dev/console (my SIMH needed this)
# emacs /home/disk_vax/vaxroot/etc/inittab
1:12345:respawn:/sbin/agetty 9600 /dev/console vt100
#1:12345:respawn:/sbin/agetty 9600 /dev/ttyS3 vt100

Now add an entry into the NFS config file /etc/exports so that it exports your root as expected by the mopboot kernel.
The IP mask just says let all-and-sundry on my home network get to the thing.
# emacs /etc/exports
/home/disk_vax/vaxroot 192.168.0.0/24(sync,rw,no_root_squash)
and make this known to NFS (see /var/lib/nfs/xtab)
# exportfs -a

DHCP::config

Lastly, you're going to need DHCP configured to answer the kernel bootp request.
# emacs /etc/dhcpd.conf
  allow bootp;

           subnet  192.168.0.0 netmask 255.255.255.0  {
            range 192.168.0.5 192.168.0.200;
            option routers 192.168.0.1;
            option subnet-mask 255.255.255.0;
            option domain-name-servers 192.168.0.1;
            option domain-name "eastwood";

            host uVAX  {
                 hardware ethernet 08:00:2b:31:5F:25;
                 fixed-address 192.168.0.110;
                 option host-name "uVAX";
                 server-name "alpha";
                 option root-path "/home/disk_vax/vaxroot";
           }
      }
     
Now restart DHCPD to pick up this new config.
# ./etc/rc.d/init.d/dhcpd restart

If I've done all the above correctly, I should be able to power-up the VAX. Say >>> BOOT ESA0 and watch it boot up. (or XQA0 or whatever)

How do I build the UserMode apps and libraries?

uClibc is the minimalist module usually used in embedded systems. This is the library being used until the GNU libraries are sorted out. You'll already have installed the toolchain and kernel sources as described earlier. So, go grab the source module
$ cd /home/lukeb/vax
$ cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/linux-vax co uClibc
Now, find the .config file and alter the KERNEL_SOURCE so that it point to your kernel directory. If you dig down to the extra/Configs directory, you'll see Config.vax.default and you'll want to change KERNEL_SOURCE to your location.
$ cd /home/lukeb/vax/uClibc
$ make clean
$ cd extra/Configs
$ emacs
#KERNEL_SOURCE="/home/airlied/devel/VAX/kernel/kernel-2.4"
KERNEL_SOURCE="/home/lukeb/vax/kernel-2.5"
$ cd /home/lukeb/vax/uClibc
$ make defconfig TARGET_ARCH=vax CROSS=vax-dec-linux-
$ make TARGET_ARCH=vax CROSS=vax-dec-linux-
$ su
# make install TARGET_ARCH=vax CROSS=vax-dec-linux-

How do I use SIMH to simulate a VAX?

http://simh.trailing-edge.com/
SIMH emulates a pile of wonderful old machines - including VAXen.
I have SIMH running on a seperate box to my NFS server for vaxroot, but with some trickery you can have it on the same box.

Under Linux and Windows, SIMH can emulate a DELQA.
on UNIX you'll want to have a current libpcap library http://tcpdump.org
For Win2000/XP you'll want a current WinPcap http://winpcap.polito.it/install/default.htm

OK, we're now ready to build SIMH itself and get going!
$ mkdir BIN
$ make USE_NETWORK=1 BIN/vax
(Assuming you've been able to build a kernel successfully as described above) Now, grab the Linux/VAX kernel-2.5 tree and compile with:
$ make ka650_defconfig
$ make
this kernel should be able to boot in SIMH. Copy your vmlinux.dsk into the SIMH vax directory (or link to it) and you should be able to boot.

To be able to get networking going between the Linux host and SIMH on the same host, you'll need the "mirror" (kernel-mode) network driver.
Download from http://linux-vax.sourceforge.net/download/mirror.tar.gz

This should compile without drama - just make sure KERNEL_DIR in Makefile is pointing at your kernel sources.
Note1: if your host Linux box sources aren't there, go install from the kernel-source-X.Y.Z.ARCH.src.rpm
Note2: if you don't have the exact-match sources to your currently running kernel, it may still compile, however do NOT try to -force an install ! My machine blew up... I then located and installed the correct sources...
$ su
# gunzip mirror.tar.gz
# tar -xvf mirror.tar
$ cd mirror
$ make
Next, you have to make this known as a kernel installable module and make it available to your running host's kernel. Use insmod to do this.
$ su
# insmod mirror.o
Now bring up the mirror0 interface and give it an address on a DIFFERENT subnet to your hosts subnet. (as you saw I've done for simhVAX in my dhcpd.conf above)
# ip addr add 192.168.201.1 dev mirror0
# ip link set mirror0 up
For your dhcpd.conf, you'll want something along these lines:

      # utilise a dummy network using mirror.o 
      # so that SIMH can run via a loopback bridge.
      # if not using loopback, just have simhVAX in the
      # normal subnet and it should work from whatever remote
      # machine it's on.
      subnet    192.168.201.0 netmask 255.255.255.0  {
            option routers 192.168.201.1;
            option subnet-mask 255.255.255.0;
            option domain-name-servers 192.168.201.1;

            host simhVAX  {
                 hardware ethernet 08:00:2b:aa:bb:cc;
      #          fixed-address 192.168.0.120;
                 fixed-address 192.168.201.2;
                 option host-name "simhVAX";
                 server-name "alpha";
                 option root-path "/home/disk_vax/vaxroot";
            }
      }
As per a normal VAX mopboot, you'll still do
# ifconfig eth0 promisc
# ifconfig mirror0 promisc
# mopd -a
NOW we can start up the simulator (whew!)
$ cd VAX
$ su
# ln -s /home/lukeb/vax/kernel-2.5/vmlinux.dsk 2.5.dsk
# ../BIN/vax ;;; you can put all the init commands into a file as vax.ini and start via # ../BIN/vax vax.ini.
VAX simulator V3.0-2
sim> load -r ka655.bin
sim> attach NVR ka655.nvr
sim> set cpu conhalt
sim> set cpu 64m
sim> set rq0 ra92
sim> attach rq0 vmlinux_2.5.dsk
sim> attach xq mirror0
sim> boot cpu
KA655-B V5.3, VMB 2.7
>>> BOOT XQA0
I didn't go further with the ALPHA, as it hung at that point (probably just need a route defined or something), as I have a much faster laptop sitting next to it, so I decided to run SIMH on the WinXP box.

Under WindowsXP, I installed the latest WinPcap as mentioned above, downloaded the precompiled exe (with ethernet support) and configured the dhcpd.conf on the NFS server (alpha) as normal (no special subnet for SIMH). So, I configured my dhcpd.conf as:

 # emacs  /etc/dhcpd.conf
        allow bootp;

        subnet  192.168.0.0 netmask 255.255.255.0  {
            range 192.168.0.5 192.168.0.200;
            option routers 192.168.0.1;
            option subnet-mask 255.255.255.0;
            option domain-name-servers 192.168.0.1;

            host uVAX  {
                 hardware ethernet 08:00:2b:31:5F:25;
                 fixed-address 192.168.0.110;
                 option host-name "uVAX";
                 server-name "alpha";
                 option root-path "/home/disk_vax/vaxroot";
           }
            host simhVAX  {
                 hardware ethernet 08:00:2b:31:5F:25;
                 fixed-address 192.168.0.120;
                 option host-name "simhVAX";
                 server-name "alpha";
                 option root-path "/home/disk_vax/vaxroot";
           }
      }
and then restarted dhcpd.
# ./etc/rc.d/init.d/dhcpd restart
Also, make sure your /vaxroot/etc/inittab has /dev/console as described earlier, otherwise you won't see a 'vax login: '.

Over onto the WinXP box, into the \SIMH\VAX directory and start VAX.exe
C:\SIMH\VAX> vax vax.ini
I successully boot using
sim> set cpu conhalt
sim> set cpu 64m
sim> load -r ka655.bin
sim> attach NVR ka655.nvr
sim> set rq0 ra92
sim> set rq1 rrd40
sim> att rq0 vmlinux.dsk
sim> att xq eth0
sim> boot cpu
KA655-B V5.3, VMB 2.7
>>> BOOT XQA0
and it chugs away and you'll see a 'vax login: '
login as root and you get the '#' prompt - YAHOO!!!