Building Hercules 3.13 on VMS This document describes a method for building version 3.13 of the Hercules IBM mainframe emulator on VMS. Some of the less portable Hercules features are not implemented such as SCSI tape support, TUN/TAP based networking, FBA block device support and dynamically loadable modules. Hercules devices which are implemented using HDL only will not work. These features could probably be included given some porting effort, however there does not seem to be sufficient requirement for them at present to justify the effort required. Compilation is done with the default (32 bit) pointer size as there are issues with the argv pointer size, arguments to setvbuf() and several problems with getopt() when compilation is attempted with 64 bit pointers. This suggests there are likely to be problems trying to configure Hercules with main storage or expanded storage in the gigabytes range, however, I have not explored this. A hack is performed to get the softfloat package to compile with least effort. This means that binary floating point operations may not work correctly if more than one CPU is configured in Hercules on VMS. This procedure has been developed and tested on OpenVMS Alpha V8.3 with HP C V7.1-015 and Multinet V5.2 Rev A. It should work on other comparable versions of VMS / C / Multinet / TCPIP Services on Alpha or Itanium without modifications or with minor tweaks. Let me know if you experience any problems and I will try to fix them. You will need: - A VMS version of UNZIP (available from several locations including HP - The Hercules 3.13 source hercules-3.13.zip - Miscellaneous support files for running Hercules on VMS hercules-vms-support.zip - The source for ZLIB (if ZLIB support is required) (version 1.2.3 is suitable) - The source for BZIP2 (if BZIP2 support is required) (version 1.0.2 is suitable) Firstly, unzip the Hercules 3.13 source zipfile in a suitable location on your VMS system. Use the -a option on unzip to get the file attributes right. Secondly, unzip hercules-vms-support.zip in the same location. This will result in the creation of a [.vms] subdirectory to contain some of VMS specific support files. If you want to compile Hercules with BZIP2 and ZLIB support, the bzlib.h, zconf.h and zlib.h header files and libbz2.olb and libz.olb object libraries built from the source should also be placed in the [.vms] subdirectory. I am not going to go into the detail of building these packages here as there are too many variables involved. If you run into any difficulties with them, let me know and I will help sort them out. If BZIP2 and ZLIB support is not required, comment out or remove the 5 lines referencing ZLIB, LIBZ, BZLIB and BZIP2 in [.vms]config.h and the 2 lines referencing libz and libbz2 in hercules.opt. Eight of the source files supplied with Hercules should be modified as described below. It is necessary to modify hdl.h to fix a bug which causes a compilation error when compiling without HDL (which is the path of least resistance on VMS). It is necessary to modify hmacros.h to avoid very poor performance and DBG error messages on the Hercules console due to calling select() with a non-socket file descriptor. The other changes are not essential but recommended, otherwise different parts of Hercules may fail to work. If panel.c is not modified, the control panel does not accept keyboard input and Hercules can only be controlled using it's web interface (which is tricky to configure correctly but can be done. Ask me for details if you want it.) If cardrdr.c is not modified, card readers do not work. If hetlib.c is not modified, HET tapes do not work. If hscutl.c is not modified, 2703 communication adaptors may cause Hercules to hang. If hostopts.h is not modified, there will be many warnings that default host options are being used but few consequences. The changes to hdlmain.c avoids 2 undefined symbols at link time due to lack of TUN/TAP support. However, there do not appear to be any ill effects if this issue is ignored. A command procedure UPDATE.COM is provided to ease the process of making most of the required source modifications. It may be invoked as follows: @update cardrdr.c @update hetlib.c @update hmacros.h @update hostopts.h @update hscutl.c @update panel.c Next edit hdl.h and fix a minor bug which prevents compiling without dynamically loadable module support, which we want to do on VMS, because we've seen the code in ltdl.c (which curiously describes itself as "system independent") and cannot contemplate how code like this could be ported to any reasonable operating system like VMS: Locate 'typedef struct _HDLINS'. Move this 8 line structure up above the line containing : '#if !defined(OPTION_DYNAMIC_LOAD)' Finally, edit hdlmain.c and comment out the following two lines. This step may be omitted if you are not worried about linker warnings due to unresolved symbols. HDL_DEVICE(CTCI, ctci_device_hndinfo ); HDL_DEVICE(LCS, lcs_device_hndinfo ); That's it. All source modifications are now done and compilation can begin. Set default to the [.vms] subdirectory. Issue this command: @[-]compile vms Set default to the [.decnumber] subdirectory. Issue this command: @compiledecnumber Set default to the [.softfloat] subdirectory. Issue this command: @compilesoftfloat Expect one THREADNYI warning. Set default to the main source directory. Issue this command: @compilehercules Expect three MAYLOSEDATA2 warnings when compiling cpu.c and another three when compiling sie.c. There may also be some informational messages. If all went well, all the hercules source should now be compiled. If so, issue this command: @linkhercules and HERCULES.EXE should be generated. This can be run with command line arguments by setting up a foreign command symbol or a simple RUN HERCULES will run it with no command line arguments and it will look for a configuration file called hercules.cnf in the current default directory. If you also wish to build the Hercules support utilites such as dasdinit and hetinit, issue these commands: @update dasdls.c @compileothers @linkothers If building without LIBZ and BZIP2 support, comment out or remove the references to libz and libbz2 from cckd.opt, dasd.opt and het.opt before linking. Please note that I have not tested all the support utilities for correct operation but if any problems are found, I am happy to look into them. Mail _software_@_beyondthepale_._ie_ (without the underscores) for further information or help with any problems building or running Hercules on VMS.