Some useful Hercules features

hercules console panel The Hercules console panel, which you can get by pushing Escape while in the Hercules console.

In this post we’ll look at the Hercules emulator itself in more detail including some useful features when running MTS.

Which version?

As noted at the MTS archive site, there are two versions of Hercules currently in development, 3.11 and 4.xx. Both run MTS OK, including fixes for printer support not present in older versions. 3.11 has Windows binaries at http://www.hercules-390.eu/ and source code that can be built on other platforms; 4.xx is just available in source form on Github. Apart from that it’s not clear if there are advantages in one version over the other for MTS users.

The below items were tested on both versions of Hercules running on Linux. If you encounter any other differences let me know and I’ll update this post.

One word of warning: although you can take an emulated system running on 3.11 and start it using 4.xx, it seems you cannot go the other direction: the 3.11 code will see the disk file written to using 4.xx as corrupt and try to repair it, which makes it unbootable on 3.11.

Suspend and resume

It’s possible to suspend a running instance of Hercules to disk and resume it later - useful if you need to reboot your host OS but don’t want to shut down and start up MTS again.

From the Hercules console, issue the suspend command. A file called hercules.srf.gz will be created in the same directory as the config file and Hercules will immediately exit.

When you are ready to start again, run Hercules as normal but issue the resume command rather than IPLing. You will also need to reconnect any 3270 terminals connected via socket.

This worked perfectly for me on 4.xx - the MTS clock updated itself and everything kept on running including any logged in sessions. 3.11 could suspend but not resume, at least with my build of the source code.

Shadow disks

Hercules has the concept of ‘shadow disks’, where an emulated disk’s contents can be started in one file and then continued with updates made to another file. If you take a look at the Disks directory you will see something like this on the 6.0A distribution:

$ ls -l Disks/
-r--r--r-- 1 rupert rupert 68738104 Jan 16  2012 mts600.dsk
-r--r--r-- 1 rupert rupert 13798923 Jan 18  2012 mts600_1.dsk
-rw-r----- 1 rupert rupert  6062763 Oct 28 20:16 mts600_2.dsk

The combination of mts600.dsk and the two shadow files (denoted with a _) make up the MTS600 disk file. The D6.0A distribution has been set up so mts600,dsk contains the base D6, mts600_1.dsk contains patches to bring it up to D6.0A and your updates are in _2. So you can delete the _2 file to restore the system to its initial D6.0A state.

You can use this yourself if you want to make changes to MTS and then have the ability to roll back to previous versions. To do this, shutdown MTS and make mts600_2.dsk read only. When you start up Hercules and IPL again, a new file mts5600_3.dsk will be created. To roll back, stop Hercules and remove the _3 file.

Sockets

It’s possible to define the card reader as a socket device instead of a file. This allows you to submit jobs over the network or from your host OS by connecting to a socket instead of writing to the file Units/RDR1.txt. You can use the netcat utility which is available for most OSs or you could write a program to do this.

First, edit the Hercules config file and replace the line under ‘Unit Record Devices’ for the 3505 device with something like this:

000C   3505   127.0.0.1:9090 sockdev ascii eof   # RDR1

When you start Hercules, this will listen on port 9090 on the loopback interface for incoming connections. You can change the IP and port as needed in the config file.

Once MTS is booted and HASP is started, use netcat like the below:

netcat 127.0.0.1 9090 < job.txt

Where job.txt is the batch file you want to submit, including a S8 card on the first line (See the post on using the card reader for more details on this.)

If all worked OK, netcat will not print any output, but you should see the results of the job on the printer device.

It’s also possible to define the printer as an output socket device: when something is printed it will connect to the socket defined in the config file and send the output.

Further information

See the Hercules user manual for more details on options available.

Comments

comments powered by Disqus