I have not had much time to post any updates lately – largely because I’ve been so thoroughly distracted by some new old technology.
I use the SIMH simulator to allow me to run VAX/VMS on my linux desktop using an OpenVMS Hobbyist license. Previous versions have emulated a VAXserver 3900 but when I noticed that the latest release also included a MicroVAX II simulator I decided to try it out, since the first VAX that I managed to save from a skip was a MicroVAX II – and I still had a backup of my old system disk.
However since I was going to use the simulator to emulate a MicroVAX II I decided it to see if I could get it all working on my Raspberry Pi. I know is is possible as it has been done before but I wanted to see if I could do it, so I downloaded the latest source archive, and unzipped it.
$ wget –c https://github.com/simh/simh/archive/master.zip $ unzip master.zip Archive: master.zip 8116b7571d43c89b55cabfc284357334a1c98b48 creating: simh-master/ inflating: simh-master/.gitattributes inflating: simh-master/.gitignore inflating: simh-master/0readmeAsynchIO.txt inflating: simh-master/0readme_39.txt inflating: simh-master/0readme_ethernet.txt : : : inflating: simh-master/swtp6800/swtp6800/swtp6800mp-a.ini inflating: simh-master/swtp6800/swtp6800/swtp6800mp-a2.ini inflating: simh-master/swtp6800/swtp6800/swtp_defs.h $
Building the simulator was quite easy – if you want to include network support you need to make sure you have installed all the prerequisite packages first. It is worth reading the instructions in the text files included with the source code.
$ su Password: # apt-get install make # apt-get install libpcap-dev # apt-get install bridge-utils # apt-get install uml-utilities # exit
If you want to compile in support for SDL which is needed if you want to simulate a VAXstation need to install the SDL libraries.
# apt-get install libsdl1.2debian
Then it is simply a case of compiling the simulator using the make script provided. If you don’t specify any parameters it will build all the available simulators, since it can take a while to compile each one on the Raspberry Pi you want to specify just the ones you want.
$ make clean lib paths are: /lib/ /lib/arm-linux-gnueabihf/ ... using libdl: /usr/lib/arm-linux-gnueabihf//libdl.so ... : : : rm -f -r BIN/ $ make microvax2 vax lib paths are: /lib/ /lib/arm-linux-gnueabihf/ ... : : : cp BIN/microvax3900 BIN/vax $
Then copy the simulator binaries to the target directory and start the simulator – you will need to install VMS from the distribution media or restore the system using the standalone backup facility but I already had a working system disk.
$ cp ./BIN/microvax3900 <target folder> $ cp ./BIN/microvax2 <target folder> $ cd <target folder> $ chmod +x ./microvax2 $ chmod +x ./microvax3900 $ ./microvax2 MicroVAX II (KA630) simulator V4.0-0 Beta sim> load -r ka630.binattach nvr nvram.bin sim> set xq disable sim> set rq0 rd54 sim> attach rq0 system.dsk sim> set cpu conhalt sim> set console notelnet, wru=10 sim> set cpu autoboot sim> set cpu idle=vms sim> set cpu 16m sim> boot cpu MicroVAX II (KA630) simulator V4.0-0 Beta NVR: buffering file in memory libpcap version 0.9.8 KA630-A.V1.3 Performing normal system tests. 5..4..3.. Tests completed. Loading system software. 2..1..0.. VAX/VMS Version V5.4-3 Major version id = 1 Minor version id = 0 %SET-I-NEWAUDSRV,identification of new audit server process is 00049 %%%%%%%%%%% OPCOM 24-MAR-2013 17:06:22.37 %%%%%%%%%%% Operator _MERLIN$OPA0: has been enabled, username SYSTEM : : : SYSTEM job terminated at 15-APR-2013 14:04:07.81 Accounting information: Buffered I/O count: 1329 Peak working set size: 952 Direct I/O count: 705 Peak page file size: 3410 Page faults: 5893 Mounted volumes: 1 Charged CPU time: 0 00:01:38.64 Elapsed time: 0 00:02:14.24
Over two minutes to boot not including the time taken for the self tests and initial program load, from memory my old MicroVAX II used to take just about five minutes to start-up so the simulator is actually quicker even on a Raspberry Pi!
What to do next ..?
Well it has been a long time since I last used a MicroVAX II so it seemed appropriate to write the obligatory ‘Hello World’ program – in VAX COBOL.
IDENTIFICATION DIVISION. PROGRAM-ID. HELLO-WORLD. AUTHOR. mike632t. DATE-WRITTEN. 18 Mar 13. * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free * Software Foundation, either version 3 of the License, or (at your option) * any later version. * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of ERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * You should have received a copy of the GNU General Public License along * with this program. If not, see <http://www.gnu.org/licenses/> ENVIRONMENT DIVISION. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. MAIN SECTION. DISPLAY-LOOP. PERFORM WELCOME-MESSAGE 127 TIMES. WELCOME-MESSAGE. DISPLAY "Hello world !! " WITH NO ADVANCING.
Then all I had to do was to compile, link and run it..
$ cobol hello.cob /ansi $ link hello $ run hello Hello world !! Hello world !! Hello world !! Hello world !! : : : !! Hello world !! Hello world !! Hello world !!
Well It seemed like a good idea at the time...
However, soon I discovered that I couldn't get anything more involved to compile and it didn't take very long to realise that this was due to the differences between Microsoft COBOL-80 and VAX COBOL. Subsequently I've spent far too long porting a couple of my old projects to the VAX, and rewriting them in the process...
It is interesting to see how different my programming style has become.
Raspberry Pi is a trademark of the Raspberry Pi Foundation