Hercules
Hints and Tips
Background
Hercules is a Linux application
that can emulate S/360, S370, S390 and z/Architecture instruction set.
More detailed doco on the background and internals can be found at: - www.conmicro.cx/hercules/
This means that you can run
your favourite OS (VM, MVS, OS/390, z/OS) on a PC.
Running Hercules under Linux
is best, but if your working environment means you are forced to use Windows,
then that is possible. Unfortunately, I have to use the Windows OS and
in the Windows environment, life is not always straightforward.
The purpose of this note is
to explain the pre-reqs, install and set-up process, and throw in a few
hints and tips, with a Windows bent. The documentation referred to above
is far more complete, this just fills in a few of the gaps.
Pre-reqs and how it hangs
together
The following list notes the
‘things’ you require, and what they look like ‘turned on’.
Hardware
-
Any old PC will do, obviously
the bigger and faster the better.
-
In particular, loads of RAM will
help
-
Also running on a multiprocessor
(only valid for Win 2000 top end OS)
-
SCSI disks, the biggest bottleneck
is I/O
-
Disk space – don’t panic if you
only have 1GB free, that should do nicely. How can this be when a 3390
M3 is nearly 3GB ? The compression facility provided really squishes things
down, and greatly improves I/O – less data at a cost to CPU.
PC OS
-
I use Windows 98, many others
use NT, I am sure ME will work fine
-
However, Windows is not POSIX
compliant and does not therefore implement all the facilities we need for
running Hercules which is POSIX, so we need a few other bits and pieces.
-
Windows TCP/IP stack does some
funny magic in order to allow intra-PC TCP/IP comms, something to do with
pseudo Mac addresses. This is referred to as the TAP/TUN problem – means
nothing to me, but does mean that I can get my Windows TCP/IP to talk IP
to Hercules, but not to MVS or any other IP stack you may have running
under Hercules. This issue is being looked at by some of the Hercules developers,
and may be resolved in the future.
C Run time & Pthread support
-
You need the C-run time environment.
In Linux or Unix this is provided, unfortunately Windows does not comply.
-
You can download the cygwin environment
from Redhat, which emulates Unix /Linux under Windows. This is pretty large.
-
If you know which DLL’s you need
to get the right support, then just install them. The issue here is, how
much tweaking of Hercules do you want to do. If you need to recompile the
source for Hercules (not me), then you will need the full Cygwin implementation
which can run to several hundred GB.
-
The minimal set required just
to run Hercules (no tweaking of the emulator possible) is: cygbz21.0.dll,
cygwin1.dll, cygz.dll, pthreadGCE.dll, pthreadVCE.dll, pthreadVSE.dll –
approx. 800 KB in total.
-
Install these into the root directory
(or high level anyway) of the directory you intend to run Hercules from.
-
Download the cyg*.dll’s from http://.sources.redhat.com/cygwin/
-
Download the pthread DLL’s from
ftp://sources.redhat.com/pub/pthreads-win32
-
Or get them with the Hercules
emulator version m212 at www.tsdd.co.uk/papers/hercules.zip
– but be careful, this version is correct and works fine as a package,
it may not be satisfactory for a more recent version of Hercules.
Hercules
-
Hercules is the emulator software,
it takes a S/390 instruction and converts it to the appropriate Wintel
instructions.
-
There are many different distributions
(versions) of Hercules, the latest at the time is probably the best. It
can be downloaded from http://www.conmicro.cx/hercules
-
It runs in a DOS window.
-
Its input is a configuration file,
which reads the OS disks and will perform an IPL based on the loadparm
you specify in the config file.
-
The contents of the config file
are well documented at the web site referred to in the introduction.
-
Whilst running, the Hercules window,
acts as an operator console for Hercules – not MVS. MVS needs its own consoles.
-
The Hercules console has two modes,
line feed reporting, or ‘graphical’ display. Best to switch to the ‘graphical’
display, it seems to run a lot faster in this mode. To switch between the
two modes, hit Escape.
-
The Hercules console has a whole
range of commands that can be entered, but as long as you know the one
that does the IPL you will be fine. (ipl devaddr) Check out the documentation
at the site referenced in the introduction for more detail.
MVS
-
Get it wherever you can.
-
Its not free, unless you go for
the MVS 3.8.
-
You could run a D/R version of
your sites OS ? Check your contract.
-
Efforts are being made by the
Hercules community to get some kind of home/office single user license
for MVS. Watch this space.
Other s/w
-
You need a TN3270 emulator, this
is how you get an MVS Console and TSO session up and running.
-
You simply config this to connect
to your PC’s IP address using a port number. The port number should be
the same as the one you provide in the Hercules config file. I use different
port numbers for different machines and versions of MVS, that way you can
cripple a PC by running lots of MVS’s at once.
-
Pick your own favourite, options
include anything from PCOM (IBM), through to TnVista (www.tombrennansoftware.com)
-
..er that’s it.
Putting it together
Pretty simple to download
all the pieces you need. The layout needs a little thought.
-
Probably best to have one directory
with the config files in it.
-
A subdirectory with your Hercules
version(s) in
-
Another subdirectory with your
MVS’s in, so again you can have multiple versions
-
Yet another subdirectory with
the Shadow files in if you are using them, see below.
-
It may look a little like this:
-
C:\Playground
-
Top level directory containing
config files, doco and the cyg and pthread DLL’s
-
C:\Playground\Hercules
-
C:\Playground\Hercules\ver212m
-
Contains Hercules programs and
utilities
-
C:\Playground\Hercules\ver21xxxm
-
Another version containing Hercules
programs and utilities
-
C:\Playground\MVS
-
C:\Playground\MVS\MVS38
-
Contains MVS DASD volumes as PC
files
-
C:\Playground\MVS\MVSxx
-
C:\Playground\Shadow
-
Place to store the MVS DASD shadow
volumes
The DASD side of things can
be a little tricky.
-
Hercules sees each MVS disk as
a PC file.
-
Best to name the PC files with
both the Volser and the unit address you will use to address the disk volume.
e.g WORK01.700 is volser WORK01 and will be mounted as device 0700.
-
You need about 12GB of 3390 M3
to run recent MVS’s.
-
That’s a lot of PC disk.
-
Unfortunately, Hercules (or Windows
– can never be sure which) has a max file size restriction of 2GB. Yet
a 3390 M3 is roughly 3Gb. What Hercules does is check the file name at
open, if there is an underscore followed by a numeric as the last part
of the filename (not extension) it will assume this is part of a multi
file disk. E.g. WORK01_1.700 & WORK01_2.700 are part of the same volume.
Compression
-
Hercules comes with a utility
that compresses the MVS DASD vols down to very small.
-
This is good from a space point
of view, but also fantastic from a performance point of view, unless you
have a SCSI controller and drive. The biggest performance bottleneck is
I/O on my PC’s.
-
The utility is called ckd2cckd
and is in the standard distribution, just run it from a DOS window with
the appropriate parameters, well documented as per above references.
-
The output is a very small file
which you now need to tell Hercules about, you specify this in the config
file.
Shadows
-
Hercules can be set up to only
store writes into a shadow disk file for each DASD volume.
-
This makes performance even better,
and allows you a certain amount of safety from fat finger trouble. If you
really screw up, just delete the shadow file and you are back to the base
DASD volume.
-
To use this option, specify the
name of a shadow file for each DASD volume when you specify the device
in the config file.
-
The shadow file is created automatically
the first time you use it.
-
You can have up to 9 shadow files
per base, but I think the I/O chain would get a little severe on reads
if you went that far.
-
When you are happy with the state
of a particular volume, you can merge the shadow back into the base, using
the sf-dev address command from the Hercules console.
-
DO NOT do this while MVS is running.
-
Each time I have done it, when
I next IPL, I get read free space errors, which Hercules automatically
fixes.
-
In order to get this whole shadow
thing to work as intended, you must mark the actual base DASD files as
read only. Remember to unmark them if you merge a shadow back into the
base.
Running Hercules
-
Start a DOS window. (I use a bat
file with the Hercules start up command in it)
-
Type in the Hercules program name
and point it to the config file with the appropriate Hercules switch (-f),
e.g. hercules -f c:\Playground\OS.cnf where OS.cnf is my config file.
-
Now it is running – yippee !
-
Best to start a Tn3280 session
before you start Hercules, remember to code your PC’s IP address plus Port
number as per the config file.
-
If you forget to start the Tn3270
session first, Hercules will wait until you have done so.
-
I find that he sometimes doesn’t
see it even when I do start it, so have to ‘nudge’ IP to interrupt, usually
starting winipcfg and closing it is enough.
-
Now you need to IPL, but first
lets look at the config file.
The config file
-
Use notepad to create a text file
(a sample is contained with the distribution and it is well documented
as above).
-
Basically, this tells Hercules
what devices and OS you are going to use. It includes such things as:
-
the Port address for your console
-
device addresses for you 3270
non-SNA devices
-
device addresses for printers
and other peripherals
-
device address and PC file name
(and shadow names if used) of your MVS DASD volumes
-
the loadparm you want to use
-
CPU Serial number you are emulating
-
Remember this is really UNIX not
Windows, so any file names are coded using UNIX notation, i.e. the slash
is the other way around, / versus \
IPL & shutdown
-
Right, you have an emulator, and
a console, now you can IPL
-
Type IPL xxx where xxx is your
device address, then put the kettle on
-
I find the whole thing runs a
lot faster if you switch the Hercules console (the DOS window you opened
originally) is in graphic mode.
-
This displays the PSW and Registers,
plus other stats such as MIPS and I/O rates.
-
I also find that during NIP, it
is best if you have the Hercules Window on the screen in a minimal view,
could be that a watched pot boils faster, but it does seem to improve IPL
speed.
-
Once you have IPLed, you are on
your own. Start another Tn3270 session which will use the next 3270 device
in your config file, and you should have had this configured as a non-SNA
3270 device. Now you are on TSO.
-
All the MVS config stuff, such
as IODF and VTAM definition needs to be planned before you build the PC
version of the disks. The ADCD implementation of MVS from IBM’s PID program
do all this for you, providing an IODF using documented device addresses,
and looking for Volsers that are expected. If you are not using an ADCD
distribution of MVS, then you will have to do some serious planning.
-
To shut down, just type quit on
the Hercules console, but I hope for your sake you have taken MVS as low
as it can go before you do that, otherwise the next IPL could be even longer,
or maybe never happen.
Questions directed to paul_TSD@compuserve.com
will be replied to, but may not have the answer you want, I am no expert,
just a happy user.
Home
| About | Services
| Software | Education
| Contact | Papers
| Links |