Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
NOTE: It is YOUR responsibility to comply with the terms of the license for the operating system
you intend to run on the Hercules Emulator.
1.9 Trademarks
The following is a list of trademark acknowledgments and copyright notices for product and company
names mentioned in this book. Other product and company names in this book that are not listed below
may be the trademarks or registered trademarks of their respective owners.
IBM, System/370, ESA/390, z/Architecture, MVS, OS/390, z/OS, VM, VM/ESA, z/VM, VSE,
VSE/ESA, z/VSE are trademarks or registered trademarks of International Business Machines
Corporation (IBM).
Windows 95, Windows 98, Windows ME, Windows NT, Windows 2000, Windows XP, Windows
Vista, Windows Server 2000, Windows Server 2003, Visual C++ Toolkit 2003, Visual C++ 2005
Express are trademarks of Microsoft Corporation.
Linux is a trademark owned by Linus Torvalds. The Linux Mark Institute is the exclusive licensor
of the Linux trademark on behalf of its owner Linus Torvalds.
WinPcap is copyrighted by NetGroup, Politecnico di Torino (Italy).
Cygwin is copyrighted by Red Hat, Inc.
Vista tn3270 is copyrighted by Tom Brennan Software.
Pentium, XEON are trademarks or registered trademarks of Intel Corporation.
Athlon, Opteron are trademarks or registered trademarks of Advanced Micro Devices (AMD), Inc.
Xmit Manager is copyrighted by Neal Johnston-Ward.
FLEX-ES is a registered trademark of Fundamental Software, Inc.
UMX Virtual Mainframe is a registered trademark of UMX Technologies.
If anyone feels they have been forgotten on this list please let me know.
Peter Glanzmann
3.1 PC Hardware
The following section lists the requirements for various hardware components within the context of the
following categories:
Minimal (minimum required equipment)
Moderate (average older PC equipment)
Average (typical current PC equipment)
Good (fast, newer PC environment)
Optimal (recommended server equipment for best performance)
It is possible to run Hercules with less than the minimal recommended hardware but performance of any
operating system executing under the emulator will be severely constrained. For acceptable performance
you will need a configuration categorized as “average” or better. If you have access to PC hardware
categorised as “optimal” the performance of installed OS’s will be adequate for most practical purposes.
Most modern PC systems are delivered with adequate RAM, Processor and Disk for Hercules use. It has
been stated in previous Hercules documentation that a Pentium 200 MHz with 32 MB of RAM would be
sufficient for the emulator, however today such a system is no longer practical.
3.1.1 Processor
Hercules does not necessarily depend on the Intel Pentium architecture. It also has been built, installed
and run successfully on an Alpha 21164, SPARC and on z/Architecture Linux/390 systems. One of the
most extravagant implementations for testing purposes has run OS/360 under Hercules under Linux/390
under Hercules under Linux/390 under VM/ESA. This is of course an extreme example of emulation
layers. This document however only describes the implementation of the Hercules Emulator on an Intel
based or compatible PC system.
Hercules will benefit greatly from a fast processor, the faster the processor the better Hercules will run. If
you can employ a multiprocessor or dual-core system, so much the better. The Hercules Emulator makes
extensive use of multithreading to overlap I/O with CPU activity. A multiprocessor board with two slower
processors will in most cases outperform a uniprocessor board with a faster processor.
Pentium with 500 MHz or equivalent processor (minimal)
Pentium with 1 GHz or equivalent processor (moderate)
Pentium with 2 GHz or equivalent processor (average)
Pentium with 3 GHz (Dual or Quad Core) or equivalent processor (good)
2 or more Pentium Quad Core processors with 2.66 GHz or equivalent processors (optimal)
3.1.2 RAM
The more RAM installed in the system the better Hercules will perform. For maximum throughput you
should set your main and expanded storage sizes in the Hercules configuration file high enough to elimi-
nate installed operating system paging operations as much as possible. The S/390 guest system storage
is allocated out of the Linux or Windows host operating system storage so try to provide enough RAM to
your system to eliminate Linux or Windows paging as well.
There is a limit to the memory that the 32-bit version of Hercules can allocate under Windows (usually
around 1 GB), therefore normally 2 GB of installed RAM in the machine should be sufficient to allow for
both Hercules and the host OS. If however you plan to run more than one instance of Hercules on the
same machine, each instance can allocate 1 GB of RAM for its own use. In this case it makes sense to
install more than 2 GB RAM. This limitation does not apply when using the 64-bit version of Hercules.
Please note that you still can allocate more RAM than is physically available on the PC to the Hercules
emulator for use of the installed operating system(s). But in this case the Linux or Windows host opera-
ting system has to page out the missing physical RAM to its own swap files which will seriously degrade
Hercules performance.
4.1 MIPS
MIPS is an abbreviation of “Million Instructions Per Second” and presents a measure of the number of
instructions the CPU is executing in one second. MIPS is a measure of a computer's processor speed.
However this measure is useful only among processors with the same instruction set as different instruc-
tion sets take different numbers of instructions to do the same job. Many of the reported MIPS values
represent 'Peak' execution rates on artificial instruction sequences with few branches, whereas realistic
workloads consist of a mix of instructions some of which take longer to execute than others.
The performance of the memory hierarchy greatly affects processor performance, an issue also not con-
sidered in simple MIPS comparisons. In an attempt to address these issues researchers have created
standardized tests such as "SpecInt" to measure the real effective performance in commonly used
applications. The use of raw MIPS as a measure of overall system performance has fallen into disuse.
MIPS is sometimes pejoratively referred to as "Meaningless Indicator of Processor Speed" or "Meaning-
less Information Provided by Salespeople".
The Hercules console reports the MIPS rate for the emulated S/370, ESA/390 or z/Architecture instruc-
tions, not the underlying executed instructions of the hardware. As implied previously the MIPS rate can
vary significantly depending on the executed instruction and whether the instructions can be processed
entirely in cache, as can happen in a tight loop.
It is difficult to determine how the speed of the Hercules emulation corresponds to a real mainframe. This
is due to difficulties in comparing real mainframe hardware to PCs (or servers) as well as the actual per-
formance measurement itself. Hercules shows its processing speed in MIPS. Compared to the earlier
IBM System/360 and System/370 hardware, it is safe to say that Hercules will outperform them when it is
running on moderately powerful hardware, whereas newer IBM System/390 and z/Series hardware still is
much faster than the emulation.
On a Celeron 300 you should see an execution speed of 1 to 2 MIPS, which is enough to run OS/360
(MFT or MVT) or MVS 3.8 with a response time better than that of a 3033 from the 1970's. It's also fast
enough to run VSE/ESA with an acceptable response time. On a more recent system with a 2 GHz
Pentium processor, you may see the system peak at around 30 MIPS which is enough to run Linux/390
or z/OS with a light workload.
Performance on server class machines is now fairly respectable. For example, on a dual-core Intel Xeon
with "Hyperthreading" (4 CPUs) running at 3.46 GHz, you might expect to see a sustained MIPS rate of
40 to 60 MIPS. A dual-processor quad-core Mac Pro (8 cores, 3 GHz) will sustain over 150 MIPS. For
anyone who is prepared to spend a considerable amount of money on their Hercules system, there are
reports that a sustained 300+ MIPS rate has been achieved on an Intel Core i7 processor running at 3.75
GHz using all four cores plus "Hyperthreading" (8 CPUs).
The speed however depends greatly on the executed instructions. Instructions that are very expensive to
emulate can even on fast systems still be around 1 - 2 MIPS, see the tables further below for details.
Although there have been massive performance improvements in the Hercules Emulator software in re-
cent releases, the current rate of improvement cannot be expected to continue. On one hand, the maxi-
mum performance improvements available via software improvements will be reached, on the other hand
the developers of Hercules have architectural frameworks that impose certain limitations, as explained
below.
Firstly the Hercules software should be portable and is therefore written entirely in "C". The use of assem-
bler to give additional performance is not exploited. Secondly the developers try to emulate real hardware
as exactly as possible in accordance with IBM's "Principles of Operations" documentation. This leads to
code that may be not optimal for the underlying hardware, but provides perfect emulation of real main-
frame hardware, avoiding problems when running mainframe operating systems.
The performance of the Hercules Emulator software depends heavily on the set of executed (mainframe)
instructions as detailed in below ("Emulated Instruction Performance").
Both tests were performed on the same machine (2 x Opteron 280, 2.4 GHz with a Software RAID-0 hard
disk configuration). The measured performance degradation using CCKD emulation over CKD is only
approximately 7.0 percent.
The figures shown above are influenced by the I/O configuration used. As mainframe operating systems
running under Hercules are often heavily I/O based, bare CPU speed is not the only relevant performance
factor. An additional performance boost is achieved using RAID-0 striping and / or using several physical
disks in the host system under which the emulator is running, as discussed in the following section.
RAID
none RAID-0 none RAID-0
Configuration
These configurations reached the transfer rates as shown in the following figure.
While these measurements only show the “raw speed” of the disks without direct relationship to Hercules,
the next diagram shows the impact on the IPL time depending on the used disk configuration. Both tests
have been run using the same hardware (2 x AMD Opteron 280, 2.4 GHz), the only change being the
type of disk employed.
These tests demonstrate that fast disks and RAID-0 configurations provide a performance boost from
which Hercules will benefit.
PC Model
08/2003 09/2006 06/2008
(month/year)
Number of
1 2 2
physical CPUs
Number of CPU
2 4 8
Cores
RAM 2 GB 8 GB 8 GB
Operating System Windows XP Pro Windows XP Pro x64 Windows XP Pro x64
The first table of performance results shows the reachable MIPS rates of various single instructions. The
test is based on a modified INSTRATE program, originally written by Gary Brabiner.
Move 256 Bytes by MVC 0.31 MIPS 1.16 MIPS 15.84 MIPS
Move 256 Bytes by MVCL 3.25 MIPS 4.84 MIPS 11.48 MIPS
Clear 256 Bytes by MVC 0.93 MIPS 1.32 MIPS 15.23 MIPS
Clear 256 Bytes by MVCL 3.63 MIPS 6.11 MIPS 16.54 MIPS
The next table shows some performance data from the "CPU Speed Rating Monitor" of IMON (Interactive
Monitor IMON/370 and IMON for OS/390 and z/OS, see http://www.prycroft6.com.au).
For the RR instructions tests, the operation codes listed form 10% of the instruction mix. The main
slowing factors of test 2 compared to test 1 are the presence of the Divide instruction (DR) and the
Multiply instruction (MR). Something similar holds true when looking at the differences between tests 3
and test 4. In tests 5 and 6 again, Divide and Multiply are used to slow test 6 as well as increasing the
length of data processed by the MVC, ED, UNPK, CLC and TR instructions (one byte in test 5, maximum
length in test 6).
According to IMONs help text, the "official" MIPS rating of a CPU model is usually about 20% faster than
the results of test 2 (RR Slow).
The last table shows the results of tests consisting of a tight loop. These tests show the influence on raw
processor speed (only one job running) as well as the influence of having a multi-processor system and
running several jobs in parallel.
These tests show that, although the raw instruction speed of the four processor machine of scenario 2
compared to the two processor machine of scenario 1 is somewhat slower as shown in table 2 above, the
system greatly benefits from the four processors when doing real work, because it can handle more tasks
in parallel.
5.1.2 Stability
As Hercules appears to Windows as just another application program, it is possible to run other applica-
tions simultaneously with Hercules, however this is not recommended. While the Hercules Emulator is
extremely stable software it is impossible to guarantee that other applications will not degrade Hercules
performance or even crash the Windows system. The less software you have installed on your system
the more stable your emulated mainframe will be.
Intensive tests have proven the stability of Hercules, one of the test suites is repeated with every new
Hercules release. The tests run a mixed online and batch workload continuously and at high volumes.
The base system consists of a MVS 3.8J operating system with additional components. During the test
the system is loaded with between four and eight self submitting (therefore continuous) batch jobs exe-
cuting in parallel. These jobs consist of a mix of large sorts, assemblies, compilation and link jobs.
Additionally there are some TSO sessions active (up to ten sessions) on which a simulated user presses
enter once a second in a performance monitor application.
This workload keeps the system (emulated mainframe as well as Hercules and the base operating sys-
tem) busy at nearly 100% CPU and a produces a continuous I/O rate of more than 750 SIOs. In this state
the machine runs 7x24 hours during several days. One of these tests was stopped after more than 12
weeks with the system still running perfectly.
In general though the less software is installed the better the emulated mainframe will run.
5.2 Drivers
This Chapter describes the device drivers that are necessary specifically for the Hercules Emulator. A de-
vice driver is a routine or a set of routines that implement the device-specific aspects of generic I/O ope-
rations. Generally the Hercules Emulator does not need any special device drivers other than those provi-
ded by the operating system. An exception is WinPcap, which is required under the Microsoft Windows
operating systems to enhance networking capabilities of the native operating system.
Beginning with Release 3.03.0 the Hercules Emulator no longer requires Cygwin in order to run under
Windows. It is highly recommended that Windows users of Hercules begin using this new MSVC Win-32
version instead of the Cygwin versions.
5.4.1 Hercules
The Hercules executables are the heart of the emulator and a mandatory component. This is the software
implementation of the System/370, ESA/390 and z/Architecture mainframe hardware and processor
machine code instruction set.
Hercules runs as a DOS program and comes with a semi-graphical display in a DOS window (the Her-
cules Hardware Console - HMC) consisting of two screens, switched between using the ESC key. When
the Hercules HTTP server is running then Hercules can also be operated via a web browser interface.
Using the GUI all of the Hercules DOS utilities are available, it is no longer necessary to know the exact
syntax of each utility. Instead of having to issue cryptic command lines in native DOS such as
HETUPD -2 -b D:/MVS/TAPE/TLEV009.HET D:/MVS/TAPE/TLEV002.HET
a standard Windows dialog box can be used to call the utility. The following figure shows the pop-up
window, used to provide information to one of the Hercules utility programs (HETUPD).
The WinGUI has been developed by David B. Trout (Fish). More detail about the functionality provided by
the WinGUI can be found in the "User Reference Guide" and in Chapter 10 – Installing the Hercules
WinGUI.
5.4.3 CTCI-W32
Since Hercules runs as a user process under the control of the host Windows system it does not normally
have direct access to the driving system's network adapter. Until recently this presented a problem in
establishing connectivity between the network and the TCP/IP stack of an operating system running un-
der Hercules.
Since the development of device drivers by Fish, employing of the WinPcap's device driver, it is now
possible to establish a virtual point-to-point link between the TCP/IP stack running under Hercules and
Window's TCP/IP stack. This allows you to use Windows as a router to pass Ethernet frames between the
Hercules TCP/IP stack and the rest of the network.
Component Release
WinPcap V 4.1.1
HercWinGUI V 1.11.1.5265
CTCI-W32 V 3.2.1.160
FishLib V 2.7.1.564
HercPrt V 1.1.0.545
Component Release
WinPcap V 4.0.2
HercWinGUI V 1.11.1.5265
CTCI-W32 V 3.2.1.160
FishLib V 2.7.1.564
Component Release
WinPcap V 4.0.1
HercWinGUI V 1.11.1.5265
CTCI-W32 V 3.2.1.160
FishLib V 2.7.1.564
Component Release
WinPcap V 4.0
HercWinGUI V 1.11.1.5265
CTCI-W32 V 3.2.1.160
FishLib V2.7.1.564
Component Release
WinPcap V 3.0
HercWinGUI V 1.9.5.4734
FishPack V 1.3.0.323
TunTap32 V 2.1.0.404
tt32info V 1.0.2.133
Component Release
WinPcap V 3.0
HercWinGUI V 1.9.5.4734
FishPack V 1.3.0.323
TunTap32 V 2.1.0.404
tt32info V 1.0.2.133
Component Release
Cygwin V 1.5.12
WinPcap V 3.0
HercWinGUI V 1.8.8.4207
FishPack V 1.3.0.323
TunTap32 V 2.0.3.379
tt32info V 1.0.2.133
Component Release
Cygwin V 1.5.5
WinPcap V 3.0
HercWinGUI V 1.6.8.3981
FishPack V 1.3.0.323
TunTap32 V 2.0.3.379
tt32info V 1.0.2.133
Component Release
Cygwin V 1.5.5
WinPcap V 3.0
HercWinGUI V 1.6.8.3910
FishPack V 1.3.0.323
TunTap32 V 2.0.3.379
tt32info V 1.0.2.133
This screen gives you an informational about WinPcap. Click on “Next >” to continue with the installation.
This screen gives you the usual information presented when starting installation programs under
Windows. Click on “Next >” to continue with the installation.
After reading the license agreement, accept it by clicking on the “I Agree" button to continue the
installation process.
As soon as all files are copied to their default destination and the installation process is complete the final
screen shown below is displayed.
If an older version of WinPcap was installed on the machine it is strongly recommended that you reboot
the system. Click on "Finish" to complete the installation process, then continue with the customization
steps.
The System Information program starts and presents the main window shown below.
In this window select “Software Environment” and then “System Drivers”. After a few moments a list of all
installed system drivers is presented.
Although the service will be started automatically on request of Hercules via CTCI-W32, some users may
wish to have the service running automatically after Windows bootup. This behaviour can be controlled
using the following registry setting:
HKLM\System\CurrentControlSet\Services\NPF\Start
By default this key is set to 0x00000003 and the service is started automatically on request by CTCI-W32.
Where ‘v.rr’ in the filename specifies the version and release of the Hercules Emulator contained and
‘xxxx’ in the Cygwin version specifies the CPU type for which the package has been built.
The difference between these binaries and how each is installed are described in the following sections.
After reading the license agreement if you accept the terms confirm this using the radio button "I agree"
then click on "Next" to continue with the installation.
If you plan to run different Hercules versions in parallel then the default naming convention which con-
tains the version and release levels in the directory name is useful. If your intention is to run one Hercules
version at a time then you may prefer to shorten the directory name to simply "hercules" as in the
example above.
When you are satisfied with the installation options, click on "OK".
If you do not want to change any of your choices, click on "Next >" to start the actual installation process.
Click on "Close" to terminate the installation dialog and proceed to customise your installation as de-
scribed in the following sections.
After clicking the "Unzip" button the directories are created and files are extracted and copied to the
proper locations. Alternatively WinZip can be called to extract the files manually. When all files are copied
a confirmation window appears.
The root directory that is created is called hercules-v.rr, where v stands for the current version and rr for
the current release. This naming convention is useful if you plan to run several Hercules versions in
parallel. If your intention is to run only one Hercules version at a time the directory can be renamed to
"hercules" without a version or release indication.
Next proceed to section 9.6 ‘Customisation Steps’ below.
These manual customization steps are explained in detail over the following sections.
@ECHO OFF
REM
REM **************************************************************************************
REM CHECK / SET HERCULES PATH (1)
REM **************************************************************************************
REM
IF %SETHERC%.==1. GOTO RUNIT
SET SETHERC=1
PATH D:\Hercules;%PATH%
SET HERCULES_RC=D:\MVS\CONF\HERCULES.RC
:RUNIT
REM
REM **************************************************************************************
REM START HERCULES EMULATOR (2)
REM **************************************************************************************
REM
START D:\Hercules\Hercules -f D:/MVS/CONF/MVS38J.CONF >D:\MVS\LOG\Hercules_Log.txt
EXIT
@ECHO OFF
REM
REM **************************************************************************************
REM CHECK / SET HERCULES PATH (1)
REM **************************************************************************************
REM
IF %SETHERC%.==1. GOTO RUNIT
SET SETHERC=1
PATH D:\Hercules;%PATH%
SET HERCULES_RC=D:\MVS\CONF\HERCULES.RC
:RUNIT
REM
REM **************************************************************************************
REM START HERCULES WIN GUI AND HERCULES EMULATOR (2)
REM **************************************************************************************
REM
START D:\Hercules\HercGui -f D:/MVS/CONF/MVS38J.CONF
EXIT
If the "sh" (shell) command is used in the run-commands file, then the "startgui" keyword should also be
used when starting external applications if one of the following is true:
a) If starting Windows GUI applications (as opposed to command-line programs),
regardless whether or not the Hercules Windows GUI is being used.
b) If starting any program, Windows GUI programs or command-line programs (either via
the Hercules panel command-line or via the run-commands file), when running Hercules
via the Hercules Windows GUI.*
* If you wish to capture the output of a shell command however (e.g. "sh dir"), then you should not use
startgui since it prevents the output from being captured / piped back to Hercules or the Hercules
Windows GUI.
Creative use of the run-commands file can completely automate Hercules startup and initiate the IPL of
the mainframe operating system. For details about the usage of the run-commands file see the "Hercules
User Reference Guide".
Generally these three sections are identical except for the session profile used. The number of terminals
to be started depends on your needs although it is recommended that at least three terminal sessions
(master console, alternate console and TSO terminal) be started.
The WAIT command is used to define a one second delay and helps ensure that the terminal sessions
connect in the correct sequence to the intended addresses. The length of this wait interval depends on
the speed of the host system CPU and should be changed to a value appropriate for your environment.
You may need to experiment with this setting in order to discover an appropriate value.
Since version 1.9.5 the Hercules Windows GUI allows you to specify the target directory that the 'sh'
(shell) command will use. Simply browse to and select the desired directory using the GUI.
Once this is set any shell command entered will be processed using the defined directory as its current
working directory. This provides a workaround for the fact that the Windows GUI's current directory
changes depending on the dialog in use. This also compensates for the fact that prior to version 3.03
Hercules's current directory normally never changes.
9.5.1 Directories
The Directories tab allows you to specify the preferred directories for each file type.
The path for executable files, configuration files and log files are all required, all others are optional and
provided for convenience. If specified, they are used as default directories by the various device configu-
ration dialogs.
This feature allows each user to have different naming conventions for their reader, punch and disk files
etc.
The 'At Startup' option requests the filename of the console log file when the GUI is started. The 'At
Shutdown' option asks if the console log file should be saved or not when the GUI is about to be closed.
The 'Automatic' option does not ask for a filename at all and instead generates a filename automatically
based on the parameters provided. For example, if the base filename is "Hercules Logfile.txt" the gene-
rated log filename will be "Hercules Logfile.000.txt" the first time the GUI is started, then "Hercules Log-
file.001.txt" for the next start of the GUI, etc.
Starting with version 1.4.0, once log files are created by whichever method, they are written to con-
tinuously as new messages arrive. This removes the need to do a periodic "Save Messages".
As new messages are now automatically written to the log file during Hercules execution, it is recom-
mended to use the "Advanced Logging Options" dialog to specify the maximum log file size in number of
lines. This is meant to prevent the log file from filling up your hard drive. Use the ‘Advanced’ button on
the main Logging preferences tab to access these settings.
The log file is a wrap-around file, where the oldest messages will be overwritten by newer messages
when the specified size limit has been reached. Once the specified maximum number of lines has been
written to the log file, the GUI will reset its file position pointer back to the beginning of the file and begin
writing new log file messages over the top of older ones.
The file is not recreated when full. When it wraps around and begins to overlay older messages, the mes-
sages near the end of the log file are still present until eventually overwritten.
Note too that the Advanced Logging Options dialog lets you specify the maximum number of messages to
be retained in memory. A limit is required to prevent run-away memory consumption. This memory limit is
a separate value from the disk log file limit and essentially controls how far back you can scroll the con-
sole to see older messages.
9.5.4 Console
The Console Tab allows it to specify the preferred console font, font colour and background colour for the
Hercules console message area.
9.5.5 Misc
The Misc Tab allows you to specify various miscellaneous preferences, such as how the GUI should react
to your pressing the "Power Off" button.
When shell command support was added to Hercules for the Windows environment a bug was revealed
in the manner that Cygwin processed the 'fork' command. Although a workaround was developed the
GUI was also modified to be able to issue the shell commands directly instead.
In order for the GUI to be able to issue shell commands instead of Hercules itself a new program called
'conspawn.exe' was developed. The GUI passes the shell command to conspawn for execution. The
conspawn program is included as part of the GUI package and must reside in the same directory as the
other Hercules executables.
The Ignore Parse Errors option was created to allow you to open and use a Hercules control file that the
GUI would otherwise fail to parse properly for whatever reason.
When a control file is opened the GUI parses the statements and saves the information in an internal con-
trol area. This information is used later to complete various fields in the dialogs such as the device con-
figuration dialog. If the GUI cannot properly parse a given control file statement it throws a parse error
and prevents you from opening or using what it considers to be a bad control file. This option can be used
to bypass this error, for example when using a device statement containing a new parameter that Her-
cules understands but the GUI may not yet support.
The "Ignore Parse Errors" option instructs the GUI to ignore the parse error and open and use the control
file anyway. When this option is set the GUI ignores all parse errors and will always successfully open
whatever control file you instruct it to. As the GUI can update the Hercules control file, it is highly recom-
If you do need to enable this option, remember to disable it when no longer needed as once enabled it
will stay that way until you purposely disable it. Like all preference options it is persistent across
executions of the GUI.
9.5.6 Misc2
The Misc2 Tab provides additional options that would not fit on the original Misc options tab.
Since version 3.0 of Hercules support has been added for command-line options beyond the existing -f
(control file) option. Here you can enter any of the new command-line options you may wish to have
issued whenever the GUI starts up ("Powers On") the Hercules emulator.
Note that you must not specify the -f option here. The GUI constructs the -f option automatically based on
the configuration file previously defined in the Preferences dialog. You may enter any other command-line
options in addition to the required ones - see the important note immediately below.
This is an advanced option and should not be modified by end users. Please only change this if instructed
to by Hercules Technical Support or Hercules developers.
Since HercGUI version 1.9.5 the System Configuration dialog information is displayed in three separate
property pages: the Architecture page, the O/S Tailor settings page and the Other / Misc page.
The Identification section simply displays the full pathname of the configuration file that was opened and
provides an input field for a text description to be associated with this particular configuration file. This is
in case you have multiple system configurations where it is useful to have some indication that you are
modifying the correct one. The description you enter here is saved as a comment at the beginning of the
configuration file.
In the main System Configuration dialog, if the GUI finds a specially formatted file called "cpu-types.txt" in
your preferred configuration files directory, a small '>' button will appear next to the "CPU Model number"
edit-box. This file may contain a list of the various CPU model numbers, their names and their correspon-
ding STIDP (Store CPU ID instruction) values.
When the System Configuration dialog is initialized, if the GUI finds this file, it will parse the entries and
use them to construct a drop-down box that will be displayed when you click the '>' button. This allows
you to easily select the desired CPU Model you wish your virtual mainframe to be reported as.
Neither the GUI nor the Hercules Emulator itself makes any attempt to try and emulate all aspects or fea-
tures of a given CPU model. This CPU model number simply specifies what value to use in the STIDP
(Store CPU ID) instruction.
When your CPU Model is selected in this way the GUI automatically fills in the "CPU Model number" edit-
box field with the corresponding value it finds in the "cpu-types" file. You have the option of manually
overriding this value. A sample "cpu-types" text file is included with the distribution of the Hercules GUI.
When the "Enable licensed program product O/S" option is specified for a given control file any attempt to
power on Hercules using that control file will result in a dialog box being displayed that asks you to verify
your true intentions.
As soon as this dialog is displayed a 10-minute timer is started. If you respond before the timer expires
your response is accepted as-is. If your response is "No, I do NOT honestly wish to run in unrestricted
mode" then your virtual mainframe will not be powered on. If your response is "Yes" - whether explicit or
presumed (see next paragraph) - then Hercules will be powered on.
Please note that if you fail to respond within the 10-minute time limit your response is presumed to be
"Yes, I honestly DO wish to run in unrestricted mode". If you do not wish to wait the entire 10 minutes
then you will have to respond to the dialog manually yourself. There is no way to disable or override this
feature.
This dialog is displayed each time you attempt to power on Hercules during a given Hercules GUI session
when using a configuration file with the "Enable licensed program product O/S" option checked. Although
you only have to respond to this message once during a single session if you continue to use the same
configuration file. If you switch to a different configuration file and then return later to the first one (or exit
the GUI entirely and start it again), you will be asked once again to confirm your intent.
Hercules's HTTP Server support allows you to control Hercules via any standards compliant web
browser. This dialog allows you to define the HTTP Server parameters that Hercules is to use.
Enter the port number for Hercules's HTTP Server to listen on and if desired specify the authentication
criteria needed to connect to the server. You can also enter the root directory from which the web pages
will be served.
The "Maximum shutdown wait time expected for this configuration" setting defines a time limit to the
Hercules GUI. This limit is the amount of time the GUI is to expect between when the 'quit' command is
issued (or the "Power Off" button is pressed) and when Hercules finally finishes exiting after completing
its shutdown sequence.
When you use compressed disks (CCKD) Hercules needs time to write-back cached copies of track ima-
ges and adjust the free space for each disk before it can safely exit. If the expected wait time is exceeded
the GUI issues a warning asking whether to continue waiting or forcibly terminate the Hercules Emulator
process. If many compressed disks are frequently updated it can take over a minute to write all cached
data to disk.
It is safe to specify a value for this setting that is high enough for all likely cases in your environment. The
Hercules GUI will terminate as soon as Hercules itself ends regardless of the wait time setting.
Right clicking on a device statement presents a context menu from which you can select 'Edit' or 'Proper-
ties'. Selecting 'Properties' presents the "Reinitialize Device" dialog, also displayed by double-clicking the
device statement.
When 'Edit' is selected from the right-click context menu you are presented with a simple device state-
ment edit dialog. From here you can directly modify raw device statements.
To delete a device select the desired device first to highlight it and then click on the 'Remove' button. To
modify an existing device double-click on the entry for the desired device:
Note: If you used any of the new CCKD parameters on the main System Configuration dialog, some
controls in the above dialog will not be displayed. This occurs because the new System Configuration
CCKD parameters modify CCKD functionality on a system-wide basis and remove the ability to specify
these parameters on per-device basis.
If you need to modify real or virtual storage it is highly recommended that you use the Hercules Emulator
'r' and 'v' panel commands. These ensure that the hardware emulator is aware of any changes.
The "input data is from socket" option is found to the right of the device type field. It allows you to tell
Hercules to obtain card reader input from a specified socket instead of a disk file as by default. This
allows you to submit card decks remotely using a simple utility that connects to the specified socket and
writes card images directly to Hercules. Recent releases of the GUI provide a DOS program "HercRdr" to
support this capability. For more information on the HercRdr utility and the 'sockdev' option refer to the
Hercules User Reference Guide.
A grey diode indicates the device is offline and not open. A green diode indicates it is online or open. The
green diode changes to yellow whenever the device is busy and changes to red when there is an interrupt
pending for the device.
As the hosted system runs and performs I/O to the devices in your configuration you will see the diodes
change between yellow, red and green. This shows that there is I/O activity taking place on the device.
Devices are displayed in a tree-list with a branch for each class of device. Right-clicking the Devices with-
in a branch presents a context sensitive menu. You can also right-click each branch.
To add a new disk drive to your configuration right-click on the "DASD Devices" branch and select 'Add
device' from the menu that appears. To delete ("detach"), rename ("define"), reinitialize ("devinit") or pre-
sent an attention interrupt ("i") for a particular device, right-click the device and select the appropriate
option from the context menu presented.
MaxPacketBuffsize 1024 Maximum allowable TunTap32 DLL I/O buffer size (KB)
For details on how CTCI-W32 works internally see the Hercules "General Information" manual.
Make sure you have entered a valid IP address, subnet mask and default gateway. This is all that is
necessary on the Windows system side, the remaining configuration of the CTCI-W32 functionality is
controlled via Hercules device statements.
10.3.1.1 IP Forwarding
You may or may not need to have "IP Forwarding" enabled on your Windows system. Whether this is
required or not depends on your use of a router within your network. If you are using a router to define
routes to hosts on your LAN, then you should not need "IP Forwarding" enabled on your Windows sys-
tem. If however your are not using a physical hardware router then you will likely need to enable IP For-
warding.
To allow your Hercules guest operating system to communicate with hosts on the LAN apart from the
host machine itself (where Hercules is running), TCP/IP requires routes to and from the Hercules hosted
operating system. This is necessary so that the Hercules virtual guest OS's packets can be properly
routed to their final destination. This is typically the role performed by a hardware router. If you do not use
a hardware router then Windows "IP Forwarding", together with appropriate ROUTE statements, will per-
form this role.
To enable "IP Forwarding" on Windows 2000 / Windows XP, make the following registry change:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]
"IPEnableRouter"="1"
For Windows 98 / Windows ME, make the following registry change instead:
[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\MSTCP]
"EnableRouting"="1"
If the "IPEnableRouter" (or "EnableRouting") registry value does not yet exist under the mentioned re-
gistry key then you will have to add it manually. Select 'New' from the 'Edit' menu and add a new DWORD
value with the indicated name.
Note that the format of the Hercules configuration file statements for networking emulation has changed
from previous releases of Hercules. The older 'CTCI-W32' format has been deprecated. Please ensure
your CTC device statements are updated to use the newer 'CTCI' or 'LCS' format in order to remain com-
patible with current and future releases of Hercules. For example:
The first IP address (192.168.0.4) is the IP address of your Hercules system, i.e. the guest operating sys-
tem running under Hercules. The second IP address (192.168.0.2) identifies the CTCI-W32 logic, i.e. the
network adapter that CTCI-W32 is to use in order to reach the Windows TCP/IP stack.
Note that it is possible to place the guest OS in a separate subnet to your Windows host if you are pre-
pared to define the proper routing entries. However it is usually a lot simpler and less problematic to de-
fine all hosts in the one IP subnet.
If your network adapter does not have a static IP address then instead of specifying an IP address as the
second parameter in the Hercules device statement, you must specify the MAC address of the adapter
you wish to use:
If you wish to try using an LCS (LAN Channel Station) device instead then the following sample may be
useful. LCS can handle any Ethernet packet rather than just IP packets:
*********************************************************
* Dev Mode Port Entry specific information *
*********************************************************
0E20 IP 00 PRI 172.16.9.93
HWADD 00 00-00-5E-90-09-5D
0E22 IP 01 SEC 172.16.10.93
HWADD 01 00-00-5E-90-0A-5D
-----------------------------------------------------------------
Sample TCPIP PROFILE statements for Enterprise Extender
(Note: not all statements are shown)
IPCONFIG DATAGRAMFWD VARSUBNETTING SYSPLEXROUTING
DEVICE LCS1 LCS E20 AUTORESTART
LINK ETH1 ETHERNET 0 LCS1
DEVICE VDEV1 VIRTUAL 0
-----------------------------------------------------------------
(Not shown: VTAM definitions)
Alternatively if you do have a real router then your default gateway should be the IP address of your
actual router. In the sample LCS configuration immediately above 172.16.13.1 is a real network router
and thus knows how to route traffic to the other end of the guest's Enterprise Extender link. Note that, as
recommended, the guest's IP addresses (172.16.9.93 and 172.16.10.93) are within the same subnet
(255.255.0.0) as the Windows host that Hercules is running under (172.16.9.163).
The second number (64 in the above example) is the size in KB of the I/O buffer allocated inside the
TunTap32 DLL. This defines how much data TunTap32 will request from the device driver each time it
needs to do an I/O operation to the physical adapter and therefore how much data will be transferred from
the device driver's internal buffer to TunTap32's I/O buffer. The memory for this buffer is allocated in vir-
tual memory from the Hercules process's address space and should not impact Windows's performance
unless a ridiculously large number is specified. If too high a number is specified then Windows will likely
‘thrash’ attempting to page the entire Hercules address space and performance will be degraded.
The TunTap32 DLL passes packets to Hercules one at a time. When it runs out of packets in its internal
I/O buffer it requests more data from the WinPcap device driver via the FishPack DLL. The TunTap32 I/O
buffer size determines how much data and therefore how many packets it will receive from WinPcap for
each request.
The larger this buffer, the fewer actual I/O's TunTap32 will perform to WinPcap via FishPack, but at the
same time the longer the interval between those I/O's. This implies that the WinPcap device driver will
have to buffer its data for a longer period between less frequent I/O's. This requires a larger kernel buffer
in order to ensure that no packets are lost during periods of high network activity. Conversely, the larger
the actual I/O (i.e. the more bytes transferred per I/O), the longer each I/O takes. Although this is mea-
sured in microseconds, the delay holds up the entire Windows operating system during transfers of data
from kernel-space to a user-space. It is good to perform as little I/O as possible as these can be expen-
sive, but the benefit drops quickly if each I/O has significant impact on the overall system, so choose
these settings carefully.
Unless you are using a Gigabit or faster network it is usually best to leave these at their default settings.
The currently implemented minimum, maximum and default values are:
If you decide to adjust these buffer size values to try and increase network throughput and performance,
you may find the Hercules "tt32stats" command useful.
The tt32stats command shows the actual tt32 statistics as shown below:
If the reported "Maximum DLL I/O Bytes Received" value is identical to the value specified for the "Size of
DLL I/O Buffer", then each time TunTap32 requested more packets the WinPcap device driver had at
least a full buffer worth waiting to be delivered to TunTap32.
This generally indicates that the default buffer size is too small or that your network is extremely busy.
This would be the least common situation though. TunTap32 is rarely unable to deliver an entire buffer of
packets to Hercules before another buffer arrives unless Hercules is performing extremely poorly or your
network really is under heavy load.
www.tombrennansoftware.com
The downloaded version of Vista tn3270 can be used for a free trial for 30 days following installation.
After this free trial period a license key must be entered for continued use of the software.
Host IP Name/Alias This name is usually a dot address like 206.85.100.23 or a DNS (Domain Name
Server) name, such as "tn3270.company.com". It can also be an Alias name that
points to either a DNS or dot address (see Assign Host to Alias below). IP names
and their associated port numbers are stored in the VISTA.INI file rather than the
session file so that they can be shared among sessions.
The special host name "localhost" or the IP address "127.0.0.1" means the local
machine.
IP Port Each Host IP Name has an associated IP Port number which you can change
using this field. Normally TN3270 is defined to port 23 but in some cases your
connection may need to use a different port number. This port number has to be
the same as that specified for the CNSLPORT system parameter in the Hercules
Configuration File.
If you need to logon to the same hostname using various port numbers create
multiple Alias names which point to the same host but use different ports.
Additionally you can define aliases for IP addresses. This can help you remem-
ber which host Vista is connecting to.
Delete Host This button can be used to delete the selected Host IP Name if you want to clean
up the list.
Assign Host to Alias Dot addresses and DNS IP names can be cryptic to look at. Instead you can type
a more descriptive name such as "P390" in the Host IP Name or Alias field then
press the Assign Host to Alias button to relate the alias name to a real DNS
name or dot address. Alias names can also provide the ability to logon to the
same hostname using different port or LU names.
LU Name When in TN3270E mode, you have the option of specifying a VTAM 8 character
LUNAME to be used when establishing the connection. If you need to logon to
the same hostname using various LU names, create multiple Alias names which
point to the same host but have different LU’s.
Connect Button When this button is pressed, Vista attempts to connect to the specified Host IP. If
all is correct Vista connects to Hercules and presents the Hercules welcome
screen. If however there is a problem you may see an error window such as the
following one:
http://www.cbttape.org/njw/
When you are satisfied with your choice of the installation directory click on "Next >" to continue.
When you are satisfied with your installation choices, continue by clicking “Next”. The installer will start
copying files to your harddisk, creating icons and updating registry settings.
You can now either exit the setup program or optionally select to launch the application as you exit setup.
Click on "Finish" to complete.
Note: Beginning with release 1.5.1.1805 of AWS Browse additional DLLs are required. These are Micro-
soft MFC and VC Runtime DLLs that you can download from the address mentioned above. The instal-
lation takes a few seconds and does not require a reboot. There are a 32-bit and a 64-bit version of these
DLLs. Please ensure you are using the correct one according to the product you are installing (32-bit or
64-bit version of the Windows GUI).
If you previously installed the Hercules Windows GUI as described earlier in this manual then these DLLs
are already present on your system. Note that you only need to install these C Runtime DLLs once even if
new versions of AWS Browse are subsequently installed.
14.1 Introduction
This section provides instructions on how to build the MSVC version of Hercules. Once you have
successfully set up the build environment (which you only need to do once) the process of actually
building Hercules is very simple. Just open the provided ‘Hercules.sln’ solution file and click the ‘Build’ or
‘Rebuild All’ button.
c. Define a ZLIB_DIR environment variable pointing to the path from the previous step.
c. Define a BZIP2_DIR environment variable pointing to the path from the previous step.
c. Define a PCRE_DIR environment variable pointing to the path from the previous step.
5. Start Visual C++ 2008 Express, open the Hercules provided “Hercules.sln” solution file and click
on the ‘Build’ or ‘Rebuild All’ button.
\$(ZLIB_DIR)
zlib1.dll
zlib1.pdb
\Debug
\include
zconf.h
zlib.h
\lib
zdll.lib
\x64
zlib1.dll
zlib1.pdb
\Debug
\include
zconf.h
zlib.h
\lib
zdll.lib
\$(BZIP2_DIR)
\Debug
bzlib.h
libbz2.dll
libbz2.lib
libbz2.pdb
\x64
\Debug
bzlib.h
libbz2.dll
libbz2.lib
libbz2.pdb
\$(PCRE_DIR)
\bin
pcre3.dll
pcre3.pdb
pcreposix3.dll
pcreposix.pdb
\include
pcre.h
pcreposix.h
\lib
pcre.lib
pcreposix.lib
\x64
\bin
pcre3.dll
pcre3.pdb
pcreposix3.dll
pcreposix.pdb
\include
pcre.h
pcreposix.h
\lib
pcre.lib
pcreposix.lib
15.1 Introduction
This chapter provides instructions and suggestions to help maximize the amount of available memory on
Windows systems. It is the result of research conducted by Fish (David B. Trout) into this subject from a
Hercules developer's perspective although it pertains to all general Windows application development.
Please note, that these steps are optional. They are not necessary to run Hercules.
As can be seen even though each process has 4GB of address space (addressable using 32 bits) only
slightly less than 2 GB (31 bits) is actually available to any given application. The rest is reserved for the
operating system and cannot be accessed.
To further complicate matters, just as with most operating systems, any application or binary image (i.e.
.EXE, .DLL, etc.) can define at link time its preferred base address. Also known as a load address, this is
the address at which the image in question prefers to be loaded.
The reason images (.EXEs and .DLLs, etc.) have defined preferred base or loading addresses is simply
to relieve the operating system from having to relocate the image to another part of memory. At link-edit
time - when the image gets built - all of the program's address constants etc. are pre-initialized with what-
ever preferred base address and offset was defined on the LINK statement. Using this method, if the
image can be loaded at the preferred base address, the operating system has no other work to do for the
image, specifically; all address constants etc are already set to the values they need to be for this binary
image.
If however the image cannot be loaded at the preferred base address then the operating system, after
loading it at a different address, must then adjust all of the address references in the entire image to re-
flect the new base. Applications that do a lot of image loading and may be running on slow systems can
take a few extra microseconds to do this work. With the expansion of addressable memory and the speed
of both RAM and CPU today such things are no longer really a concern, although Windows is still de-
signed to cater for this.
The end result being that a default build always creates EXE’s with a preferred base address of
0x00400000 (4MB) as this is the lowest address an image can be loaded at on Win 9x. If you try speci-
fying a lower base address the linker will issue a warning that the resulting executable may not run on
Win 9x.
Additionally the default preferred base address for DLLs is at 0x10000000 which is 256MB. Thus up to
256MB of valuable virtual address space will be wasted as it cannot be used for the "malloc heap" and
serves only as space to load additional DLLs if required.
Note 1: It is likely that the default build for the Hercules MSVC version has been changed since the time
this analysis was performed. Thus the information above may no longer be accurate and it is included for
illustrative purposes only.
Note 2: The VADUMP utility does not display its report in any meaningful sequence. All these displays
were manually sorted into ascending virtual address sequence.
Note how hengine.dll has moved down from its default 0x10000000 slot thus freeing up valuable con-
tiguous memory. This is exactly the outcome we desire.
The above displays illustrate how a simple rebasing of DLLs helps to free up valuable virtual memory,
over 300MB in this particular case, as well as the apparent reshuffling of already loaded DLLs caused by
specifying a large MAINSIZE. It is an educated guess based on the observed evidence that Windows
does this in order to try and make room for a heap of the specified size.
Continuing the same effort but on a production development system provided the following results:
PRODUCTION SYSTEM
As can be seen from the above displays the result of rebasing both Hercules's DLLs - and perhaps more
importantly the Google desktop DLL - resulted in the recovery of over 800 MB of usable virtual address
space.
If you still wish to rebase such a module you will need to identify which process or processes are using
the module and shut these down or in the case of a service, stop that service. Note that stopping a key
system service when other system services depend on it may have negative ramifications for your system
overall. Make changes such as this at your own risk carefully testing each individual change and be pre-
pared to recover the entire system from backups if necessary.
As a practical example, in the test case, rebasing "DbgHelp.dll" was easy, as it was not in use. Rebasing
"GoogleDesktopNetwork1.dll" is a more difficult process. The RpcSs ("Remote Procedure Call, RPC")
service was using it and shutting down this particular critical system service requires several steps. You
need to go into "REGEDIT" and set the services 'Start' value from 2 (Automatic) to 4 (Disabled) then re-
boot into Safe Mode. During this reboot the Windows Explorer may take much up to several minutes to
start. Also, once disabled, you will not be able to re-enable it via the Services snap-in. You will need to
use "REGEDIT" again to change its 'Start' value back from 4 to 2 and then reboot.
Once you have disabled the RpcSs service and have rebooted into Safe Mode go into the directory
"Program Files\Google\Google Desktop" and rebase Google's network DLL as needed. This should work
now that RpcSs is no longer running, use the following command:
Once you have rebased it go back into "REGEDIT", change RpcSs back to automatic as described above
and reboot normally.
There is no known Microsoft Windows utility that will tell you what process is using a given DLL. The
Company "Sysinternals" provides a free "Process Explorer" similar to the Windows' Task Manager with
more functionality and features.
You may also want to make some registry tweaks to Hercules Windows GUI so it will accept MAINSIZE
values larger than 1024. See the Registry Tweaks section of the Hercules GUI help pages for more in-
formation.
Finally the size of the Windows swap file limits the amount of memory a program can acquire. If the Win-
dows swap file is too small then no matter what Hercules does it will never obtain the memory it requests.
If possible, set "Maximum paging size" value to the maximum supported.
http://www.hercules-390.org
http://www.ivansoftware.com/snapshots/snapshots
http://hercdoc.glanzmann.org
http://www.bsp-gmbh.com/turnkey/index.html
http://www.mvs-turnkey.de
http://www.softdevlabs.com/Hercules/hercgui-index.html
http://www.softdevlabs.com/Hercules/ctci-w32-index.html
http://www.mvsdasd.org/hercstudio
http://www.winpcap.org
http://www.tombrennansoftware.com
http://x3270.bgp.nu
http://www.softdevlabs.com/Hercules/hercgui-index.html
XMIT Manager
www.cbttape.org
www.cbttape.org
http://www.microsoft.com/express/download/
ZLIB
http://www.zlib.net
http://www.softdevlabs.com/Hercules/ZLIB1-1.2.3-bin-lib-inc-vc2008-x86-x64.zip
BZIP2
http://www.bzip.org
http://www.softdevlabs.com/Hercules/BZIP2-1.0.5-bin-lib-inc-vc2008-x86-x64.zip
http://www.pcre.org
http://www.softdevlabs.com/Hercules/PCRE-6.4.1-bin-lib-inc-vc2008-x86-x64.zip
Installation Guide
HEIG030700-00
Version 3 Release 07
Hercules Emulator
Page 138