Hercules General Info
Hercules General Info
Hercules General Info
HEGI040000-00
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 of product and company
names mentioned in this book. Other product and company names in this book which 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 XP, Windows Vista, Windows 7, Windows Server 2003, Windows Server 2008, Visual
C++ Toolkit, Visual C++ 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.
If anyone feels they have been forgotten on this list please let me know.
Peter Glanzmann
• Chapter 2 (Related Publications): New manual “Operations and Utilities Guide” added.
• Chapter 3 (Summary of changes) added.
• Chapter 4 (Hercules Emulator Overview): Section “Production Use” removed.
• Chapter 4 (Hercules Emulator Overview): Figures in section “Hercules Source Code” replaced.
• Chapter 5 (Implemented Features): Section “Implemented optional features of z/Architecture”
updated.
• Chapter 5 (Implemented Features): Section “Not yet implemented optional z/Architecture
features” updated.
• Chapter 5 (Implemented Features): Section “S/370 Extension (S/370 backport of compatible
ESA/390 and z/Architecture instructions)” added.
• Chapter 6 (Emulated Device Types): PTP protocol in section “Channel-to-Channel Adapters”
added.
• Chapter 13 (REXX support) added.
• Chapter 14 (Summary of Hercules Changes): Changes for Hercules Emulator Release 4.00.0
added.
• Chapter 17 (Hebe - Hercules Image Manager) added.
• Chapter Error! Reference source not found. (Error! Reference source not found.): Figure
“CTCI-WIN Implementation” replaced.
• Chapter 26 (Hercules Developers): List of Herculeans updated.
• Appendix A. Links: List of links updated.
4.1 Introduction
Hercules is an open source software implementation of the mainframe System/370, ESA/390 and
z/Architecture hardware. The Hercules emulator runs under Linux on several hardware platforms in-
cluding the Intel Pentium PC, under Windows XP SP3, Windows Vista, Windows 7, Windows Server
2003, Windows Server 2008, Solaris, FreeBSD and under MAC OS X 10.3 and later.
Hercules was created by Roger Bowler. Jay Maynard (“the Tron Guy”) was the maintainer from 2000 to
2012. Jan Jaeger designed and implemented many of the advanced features of Hercules, including dy-
namic reconfiguration, integrated console, interpretive execution and z/Architecture support. For a com-
plete list of the Hercules developers see chapter 6 (“Who are the Herculeans?”).
With the Hercules Emulator, your PC can emulate an IBM mainframe processor. The mainframe can
range from a 360 to a z196 – running in System/370 mode, ESA/390 mode or z/Architecture mode. Her-
cules executes S/370, ESA/390 and z/Architecture instructions and channel programs. It emulates main-
frame I/O devices by using PC devices. As an example, 3390 DASD devices are emulated by large files
on the hard disk of the PC and local 3270 screens are emulated by tn3270 sessions. Please note that not
all 370 and 390 features have been implemented. Details about implemented, partially implemented and
not implemented features can be found later in this chapter.
Hercules only implements the raw S/370, ESA/390 and z/Architecture instruction sets, it does not provide
any operating system facilities. This means that you need to provide an operating system or standalone
program which Hercules can load from an emulated disk or tape device. You will have to write the opera-
ting system or standalone program by yourself unless you have a license from IBM to run one of their
operating systems on your PC. You may also use IBM programs and operating systems which have been
placed in the public domain.
The following figures show the main panels of the Hercules Emulator Hardware Management Console
(HMC) and the Hercules web browser interface.
Hercules is OSI (Open Source Initiative) certified open source software and is released under the Q Pub-
lic License. For details on OSI, see Chapter 28, for more information on the Q Public License please refer
to Chapter 29.
During spring 2000, others began to make significant contributions to the work:
• Dutch Owen created a neat system activity display, giving the console a more authentic main-
frame look.
• Jay Maynard added S/370 mode virtual storage capability, making it possible to run MVS/370.
• Jan Jaeger added HMC, dynamic CHPID and CPU reconfiguration and the Interpretive Execution
Facility (SIE) which allows Hercules to run VM/ESA.
• Peter Kuschnerus added the hexadecimal floating point instructions.
• Several researchers, including Valery Pogonchenko, Juergen Dobrinsky and Clem Clarke, dog-
gedly experimented with optimization of the instruction interpretation (CPU) critical path, resulting
in a quantum leap in performance.
• John Kozak was the first to successfully port Hercules to run under Windows, a milestone which
brought Hercules to a significantly broader audience.
• Fish (David B. Trout) created the massively popular graphical frontend for Hercules under Win-
dows systems.
• Volker Bandke created the phenomenally popular MVS Turnkey CD. MVS up and running on
your PC in 15 Minutes.
• Willem Konynenberg added 3088-TCP/IP and binary floating point instructions, essential for
people wanting to run Linux/390.
• Matt Zimmerman structured Hercules into a Debian package.
• Greg Smith added support for compressed DASD, and more recently for shared DASD which
allows multiple instances of Hercules to be formed into a loosely coupled multiprocessor
complex.
• Paul Leisy identified and corrected numerous subtle bugs in the architectural implementation.
In May 2000 the need to get a job meant that Roger Bowler could no longer continue full-time work on
Hercules and he handed over control of the project to Jay Maynard, who continues to be the official main-
tainer and champion of Hercules. Jay’s regular Hercules presentations at SHARE conferences attract
large audiences and his session at SHARE 99 in San Francisco received a “Best Session Award” for a
session in the MVS program.
In autumn 2000, IBM announced a new 64-bit z/Architecture (also known as ESAME or ESA Modal Ex-
tension). Using publicly available information together with his deep knowledge of the evolution of the
S/360, S/370 and S/390 architecture, Jan Jaeger was able to predict the likely form that the 64-bit archi-
tecture extensions would take. This enabled him to design preliminary support for the new architecture
and to implement many of the new instructions in advance of the publication of the full technical details in
January 2001. During some busy weekends which followed, Roger Bowler added support in Hercules for
64-bit mode IDAW, Cross Memory and DAT, with the result that at the end of February 2001 only five
weeks after publication of the z/Architecture principles of Operation manual, Hercules became the first
(and for 18 months the only) non-IBM implementation of the new 64-bit mainframe architecture!
A series of performance enhancements by Greg Smith, Gabor Hoffer, Juergen Dobrinski and Paul Leisy
during the period 2002 to 2004, coupled with a significant increase in the power of entry-level processors,
brought Hercules up to a respectable MIPS level of around 25 mainframe MIPS an a 3 GHz Pentium CPU
in 2005. During the same period Hercules also kept pace with the evolution of the mainframe architecture,
adding support for new features introduced by the latest IBM z990 and z9 processors.
www.hercules-390.eu
There are three repositories containing the Hercules source code, the Hyperion, the Spinhawk and the
Sandhawk repository as shown in the diagram below.
Developer ¬¬¬¬ push ¬¬¬¬¬Ê Hyperion (4.xx) ¬¬¬¬¬¬§¬¬¬¬¬¬¬ clone ¬¬¬¬¬¬¬Ê user (1)
ª¬¬¬¬¬¬ zip-file ¬¬¬¬¬Ê user (2)
¬¬¬¬¬ snapshots ¬¬¬¬¬Ê user (3)
~¬¬¬¬¬¬¬¬¬¬¬¬¬ (4) ¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¯
ø
Gatekeeper ¬¬¬ push ¬¬¬¬¬Ê Spinhawk (3.xx) ¬¬¬¬¬¬§¬¬¬¬¬¬ clone ¬¬¬¬¬¬¬¬Ê user (5)
¬¬¬¬¬¬ zip-file ¬¬¬¬¬Ê user (6)
¬¬¬¬¬¬¬¬Ê Sandhawk (4.xx) ¬¬¬¬¬¬§¬¬¬¬¬ download ¬¬¬¬¬¬Ê user (7)
¬¬¬¬¬ zip-file ¬¬¬¬¬¬Ê user (8)
“Hyperion” is the development repository that contains the current development version of Hercules. It is
the repository where the developers commit their changes. Users have the possibility to clone the reposi-
As an alternative pre-built snapshots (3) are available for those users that don’t want to build Hercules by
themselves. In both cases it is the development version which is not release quality and might not even
compile cleanly. Therefore it is essential to make backups of the guest operating system data before wor-
king with the development version.
A “gatekeeper” (4) promotes selected changes to the “Spinhawk” and “Sandhawk” repositories. “Spin-
hawk” is the repository for the production-quality version (release 3.xx) of the Hercules Emulator. “Sand-
hawk” is the developer sandbox repository that contains selected changes from the “Hyperion” repository.
Spinhawk is the release repository that contains all the changes that have passed the tests in the Sand-
hawk repository and will make their way into the next release. The sources of the Spinhawk repository
have been proven to be stable. Users have the possibility to clone the current state of the Spinhawk repo-
sitory (5) or to download a zip file (6) containing all the sources to build Hercules by themselves.
Sandhawk is the repository that contains selected changes for the next version of Hercules. Users have
the possibility to clone the current state of the Sandhawk repository (7) or to download a zip file (7) con-
taining all the sources to build Hercules by themselves.
Please note that there are no precompiled snapshots for the Spinhawk and Sandhawk repositories. To
get the current Hercules source code from one of the repositories, you have to install one of the available
Git packages. To get the development version use the following commands, where “x:\path” points to the
directory you want to have the source code:
a) Hyperion repository:
b) Spinhawk repository:
c) Sandhawk repository:
These commands will clone the repository source tree to the directory specified. No password is required.
Instructions on how to build Hercules can be found in the Hercules “Installation Guide”.
5.8 Compliance
Hercules is compliant with IBM’s ALS-1, ALS-2 and ALS-3 architectural level sets to the degree neces-
sary to run all OS/390 versions through OS/390 V 2.10, all known versions of z/OS in both ARCHLVL 1
and ARCHLVL 2 modes and Linux and z/VM in both ESA/390 and z/Architecture mode.
5.9.1 Introduction
Some ESA/390 and z/Architecture features and their instructions are architecturally compatible with the
S/370 architecture. Although they are not present in the S/370 “Principles of Operation” (GA22-7000),
they are not in contradiction with the reference manual.
For example, there is no contradication for an instruction such as LHI (Load Halfword Immediate) to be
included as part of the S/370 architecture presented by Hercules. However, since these instructions are
not part of the original architecture, it is necessary that these extensions to the architecture be controlled
at runtime.
In Hercules, the fact that such or such facility or feature is built for such or such architecture is controlled
by a series of C preprocessor macros in the feat370.h, feat390.h and feat900.h files. Furthermore, the
availability of the instructions is controlled by operation code tables in opcode.c.
Before runtime control was available, a select number of features were made available in feat370.h and
then commented out. Removing the comment and rebuilding Hercules made it possible to access those
features in the S/370 architectural mode.
However, requiring a rebuild seemed a little too stringent for the casual user of Hercules, meaning that
designers of programs requiring those additional instructions would have required the users of those pro-
grams to have custom built version of Hercules. Therefore the S/370 extension was implemented as a
loadable module.
Although there are some software packages that are optional, their use is highly recommended. Some
are necessary for full implementation of certain functionality (especially TCP/IP), others help in the daily
use of Hercules itself (Windows GUI, Hercules Studio, Hebe, AWS Browse) or for exchanging data with
the Hercules world (XMIT Manager).
To use this device a tn3270 client must connect to the host machine via the port number specified on the
CNSLPORT statement (see “Hercules User Reference Guide”). A valid tn3270 device type such as IBM-
3278 must be used. If the tn3270 client software supports it a device-type suffix can be used to connect to
a specific device number.
To use this device a tn3270 client must connect to the host machine via the port number specified on the
CNSLPORT statement (see “Hercules User Reference Guide”).
When defining this type of device the argument can be used to specify a list of file names containing card
images (see “Hercules User Reference Guide”).
When defining this type of device the argument is used to specify the name of a file to which the printer
output will be written (see “Hercules User Reference Guide”) or a socket device in the form "host:port".
The output is written in the form of variable length lines of ASCII characters delimited by line feed or by
carriage return/line feed sequences. Trailing blanks are removed from each line. Carriage control charac-
ters are translated to blank lines or ASCII form feed characters.
This parameter only affects compressed HET files. On AWS tapes the limit is always enforced
but the file is not truncated (i.e. the write does not occur, because AWS tapes are never truncated
and the effects of the write are known in advance (no compression)). Regardless of strictsize, any
write operation (Write, Write TM) will return a Unit Check with Equip Check to the program if the
file size exceeds the predefined limit. If strictsize is 0 the write will actually have been performed
on the tape file. If strictsize is 1 the file will be truncated on the preceeding tape block boundary.
Care must be taken that regardless of the ‘strictsize’ setting, the tape may become unusable for
the guest program should an event such as absence of a Tape Mark occur for example. This
option has no effect if MAXSIZE is 0.
• EOTMARGIN=nnnn. This option specifies, in bytes, the threshold before reaching maxsize during
which an indication will be returned to the program to indicate that an EOT marker has been
reached for a write type operation. The indication of reaching near-capacity is indicated to the
program by presenting Unit Exception in the CSW on a Write type operation along with Channel
End and Device End.
For certain device types, sense information may also indicate this information independently of a
write operation. The purpose of this option is to allow the program to determine that it is time to
change and request a new tape.
The argument for this device type specifies the name of a file that contains the FBA DASD image or the
INET address of a Hercules shared device server. The file consists of a 512-byte device header record
followed by fixed length track images. The length of each track image depends on the emulated device
type and is always rounded up to the next multiple of 512 bytes.
Volumes larger than 2 GB (eg: 3390 model 3 or 9) can be supported by spreading the data across more
than one file similarly to the original IBM P/390 implementation. Each of the files contains a whole number
of cylinders. The first file, containing cylinders 0 to 2518 in the case of a 3390, usually has “_1” as the last
two characters of its name. The ckddasd driver allocates the remaining files by replacing the last charac-
ter of the file name by the character ”2”, “3” etc. This implementation was originally necessary as the IBM
P/390 ran under the OS/2 operating system which supported a maximum file size of 2GB.
Hercules also has implemented so called “Large File Support”. If the operating system supports large file
sizes (or 64-bit offsets) then volumes larger than 2 GB can be kept in a single file.
x x x x 0 0 0 0 : Dial # 0
x x x x 0 0 0 1 : Dial # 1
.
.
x x x x 1 0 0 0 : Dial # 8
x x x x 1 0 0 1 : Dial # 9
x x x x 1 1 0 0 : EON
x x x x 1 1 0 1 : SEP
In order to perform an outgoing call, the data must follow these specifications:
Where n is any dialing number from 0 to 9 and SEPp is the separator. The first four groups of digits
represent the IP address. The last group represents a TCP port number. For example if "*" is the SEP
character representation, the following will issue a TCP connection to 192.168.0.1 port 8888:
192*168*0*1*8888
The EON is optional. If it is present it must be the last character of the dial data.
To the host OS the line emulates an asynchronous TELE2 connection. The communication is emulated
over a telnet connection.
• A device header
• Free spaces
The first 3 types only occur once at the beginning of the file in order. The rest of the file is occupied by the
other 3 space types.
reserved
reserved
0 4 6 8
0 ->image length unused
1 ->image length unused
.
.
.
254 ->image length unused
255 ->image length unused
Figure 11: Secondary Lookup Table
0 5 n
hdr Track or block group data
Figure 12: Track or Block Group Image
The 5 byte header contains a 1 byte flag field and 4 bytes that identify the track or block group. The for-
mat of the identifier depends on whether the emulated device is CKD or FBA.
0 1 3 5
flags CC HH
Figure 13: CKD Header
The 2 byte CC is the cylinder number for the track image and the HH is the head number. These numbers
are stored in big-endian byte order. When the flag byte is zeroed, the 5 byte header is identical to the
Home Address (or HA) for the track image. The data, which may or may not be compressed, begins with
the R0 count and ends with the end-of-track (or eot) marker, which is a count field containing 8 0xff’s. The
HA plus the uncompressed track data comprise the track image.
0 1 5
flags nnnn
Figure 14: FBA Header
The 4 byte nnnn field is the FBA block group number in big-endian byte order. The data contains 120
FBA blocks which may or may not be compressed. Uncompressed, the FBA block group is 60K. The
header for FBA, unlike CKD, is not used as part of the uncompressed image.
0 1 2 3 4 5 6 7 8
0 0 0 0 0 0 c c
Figure 15: Flags Byte
0 0 Data is uncompressed
0 1 Data is compressed using ZLIB
1 0 Data is compressed using BZIP2
1 1 Not valid
Figure 16: Compression Algorithm Bits
0 4 8 n
->next length residual
Figure 17: Free Space
The minimum length of a free space is 8 bytes. The free space chain is ordered by file offset and no two
free spaces are adjacent. The compressed device header contains the offset to the first free space. The
chain is terminated when a free space has zero offset to the next free space. The free space chain is read
when the file is opened for read-write and written when the file is closed; while the file is opened, the free
space chain is maintained in storage.
7.4.1 Reading
A track or block group image is read while executing a channel program or by the readahead thread. An
image has to be read before it is updated or written to. An image may be cached. If an image is cached
then the channel program may complete synchronously. This means that if all the data a channel pro-
gram accesses is cached and Hercules does not have to perform physical I/O, then the channel program
runs synchronously within the SSCH or SIO instruction in the CPU thread. All DASD channel programs
are started synchronously. If a CCW in the channel program requires physical I/O then the channel pro-
gram is interrupted and restarted at that CCW asynchronously in a device I/O thread.
All compressed devices share a common cache; the devices can be a mixture of FBA and / or CKD
device types. Each cache entry contains a pointer to a 64K buffer containing an uncompressed track or
block group image. If the track or block group image being read is not found in the cache then the oldest
(or least recently used or LRU) entry that is not busy is stolen. A cache entry is busy if it is being read,
last accessed by an active channel program, updated but not yet written or being written. If no cache
entries are available then the read must enter a cache wait. When images are detected to be accessed
sequentially then the readahead thread(s) may be signalled to read following sequential images.
A single garbage collector thread runs for all compressed devices. By default it wakes up at 5 second
intervals. The garbage collector performs space recovery for each compressed device in the order that
the device was defined or attached. After space recovery the garbage collector flushes the cache to force
all outstanding writes. Once all the writes have been completed a file synchronization (“fsync()”) may
optionally be performed. This commits any outstanding host I/O to the physical disk. Finally free space is
flushed (to be explained later).
We see that with the fsync option enabled that the physical disk file has a coherent emulation file at the
end of each garbage collection cycle. Space freed since the last garbage collection cycle completed is not
available for allocation until the current garbage collection cycle completes. This free space is called
pending free space. That is, previous track or block group images are not overwritten until the current
garbage collection completes. If a catastrophic error occurs, then the emulation file should be recoverable
at least up to the point of the last garbage collection cycle.
However, performing an fsync() may decrease performance. You can increase the garbage collection
interval to reduce the number of fsync()’s, but this may also increase the probability of a cache wait
occurring. You can increase the size of the cache to decrease this probability, but you may increase
paging or have to decrease the size of emulated memory.
Another possibility is to not enable the fsync option. This is the default. In this circumstance, by default,
freed space is not available until 2 garbage collection cycles complete. That is, pending free space is not
an attribute but a count. You have the option to explicitly set the pending free space count. However by
increasing the free space count or by increasing the garbage collection interval then you may be increa-
sing the size of the emulation file.
At the very end of the garbage collection cycle the free space is flushed. This means that the pending free
space count is decremented for all free spaces with a non-zero count. If the count goes to zero and the
preceding space is a free space with a zero count then the spaces are combined.
The space recovery process of the garbage collector simply attempts to move some amount of used
space towards the beginning of the file causing free space to move towards the end of the file. When a
free space reaches the end of the file, the file is truncated reducing its size. The amount of used space
moved depends on the ratio of free space to used space and on the number of free spaces. The larger
the numbers, the more space the garbage collector attempts to move. That is, the garbage collector
attempts to decrease the ratio of free space vs. used space and to decrease the number of free spaces.
Within a cycle, the garbage collector might not move the selected amount of used space if the moves are
detected to be counter-productive (i.e. the offset of the new space is greater than the current offset).
For example:
0100 3390 localhost:3990:0100
which says, there is a shared device server on the local host, listening on port 3990 and we want to use
its 0100 device as our 0100 device. Because the default port number is actually 3990 and the default re-
mote device number is the local device number we could shorten the above statement, providing we do
not have actually a file named ‘localhost’, to
0100 3390 localhost
Interestingly the instance on the local host listening on port 3990 could itself have a statement like this:
0100 3390 192.168.200.1::0200
which means that this Hercules instance will use device 0200 on the server at 192.168.200.1 listening on
port 3990. The original instance will have to hop through this second instance to get to the real device.
Device sharing can also be split between multiple instances. For example, suppose the following
definitions for instance A:
SHRDPORT 3990
0100 3390 localhost:3991
0101 3390 mvscat.dasd
In this case each instance acts as both a client and a server. Both instances of Hercules are running on
the same machine.
When "SHRDPORT" is specified in the Hercules configuration the thread "shared_server" is started at the
end of Hercules initialization. In the example above neither Hercules instance can initialize their devices
until the server is started on each system. In this case the device trying to access a server gets the ‘con-
necting’ bit set on in the DEVBLK and the device still needs to initialize. After the shared server is started
a thread is attached for each device that is connecting, to complete the connection (the device init
handler).
8.3 Caching
Cached records (i.e. CKD tracks or FBA blocks) are kept independently on both the client and server
sides. Whenever the client issues a START request to initiate a channel program, the server will return a
list of records to purge from the clients cache. These will have been updated by other clients since the
last START request. If the list is too large the server will indicate that the client should purge all records
for the device.
8.4 Compression
Data that would normally be transferred uncompressed between the client and the host can optionally be
compressed by specifiying the "COMP=n" keyword on the device definition statement or on the attach
command.
For example:
0100 3390 192.168.2.12 COMP=3
The value n of the "COMP=n" keyword is the zlib compression parameter which must be a number bet-
ween 1 and 9. A value closer to 1 means less compression but less processor time to perform the com-
pression. A value closer to 9 means the data is compressed more but also more processor time is re-
quired to compress the data.
If the server is on localhost then you should not specify compression. Otherwise you are just stealing
processor time from Hercules to facilitate compression/decompression. If the server is on a local network
then a low value such as 1, 2 or 3 is recommended. There is a tradeoff curve, attempting to trade CPU
cycles for network traffic to derive an optimal throughput.
8.6 Protocol
The following sections describe the protocol used for the communication between the client and the ser-
ver in the Shared Device Server implementation.
Please note that knowledge of the protocol used as described below is not necessary for exploitation of
the Shared Device Server functionality. This information is presented purely for the more technically in-
terested readers of this book.
0 1 2 4 6 8
data
0xe0 CONNECT Connect to the server. This requires the server to allocate resources to
support the connection. Typically issued during device initialization or after
being disconnected after a network error or timeout.
0xe1 DISCONNECT Disconnect from the server. The server can now release the allocated re-
sources for the connection. Typically issued during device close or detach.
0xe2 START Start a channel program on the device. If the device is busy or reserved by
another system then wait until the device is available unless the NOWAIT
flag bit is set, then return a BUSY code. Once START succeeds then the
device is unavailable until the END request.
0xe3 END Channel program has ended. Any waiters for the device can now retry.
0xe4 RESUME Similar to START except a suspended channel program has resumed.
0xe5 SUSPEND Similar to END except a channel program has suspended itself. If the
channel program is not resumed then the END request is not issued.
0xe6 RESERVE Makes the device unavailable to any other system until a RELEASE request
is issued. Must be issued within the scope of START / END.
0xe7 RELEASE Makes the device available to other systems after the next END request.
Must be issued within the scope of START / END.
0xe8 READ Read from a device. A 4-byte ‘record’ identifier is specified in the request
data to identify what data to read in the device context. Must be issued within
the scope of START / END.
0xe9 WRITE Write to a device. A 2-byte ‘offset’ and a 4-byte ‘record’ is specified in the
request data, followed by the data to be written. ‘record’ identifies what data
is to be written in the device context and ‘offset’ and ‘length’ identify what to
update in ‘record’. Must be issued within the scope of START / END.
0xea SENSE Retrieves the sense information after an i/o error has occurred on the server
side. This is typically issued within the scope of the channel program having
the error. Client side sense or concurrent sense will then pick up the sense
data relevant to the i/o error. Must be issued within the scope of START /
END.
0xec COMPRESS Negotiate compression parameters. Notifies the server what compression
algorithms are supported by the client and whether or not data sent back
and forth from the client or server should be compressed or not. Typically
issued after CONNECT. This action should actually be SETOPT or some
such; it was just easier to code a COMPRESS specific SETOPT (less code).
0x80 NOWAIT For START, if the device is unavailable then return BUSY instead of waiting
for the device.
‘devnum’ identifies the device number on the server instance. The device number may be different than
the device number on the client instance.
‘id’ identifies the client to the server. Each client has a unique, positive (non-zero) identifier. For the initial
CONNECT request ‘id’ is zero. After a successful CONNECT the server returns in the response header
the identifier to be used for all other requests (including subsequent CONNECT requests). This is saved
in dev -> rmtid.
‘length’ specifies the length of the data following the request header. Currently length is non-zero for
READ / WRITE requests.
0 1 2 4 6 8
data
0x00 OK OK indicates success, other codes may also indicate success but qualified in
some manner.
0x80 ERROR An error occurred. The server provides an error message in the data section.
0x40 IOERR An i/o error occurred during a READ/WRITE request. The status byte has
the ‘unitstat’ data. This should signal the client to issue the SENSE request
to obtain the current sense data.
0x20 BUSY Device was not available for a START request and the NOWAIT flag bit was
turned on.
0x10 COMP Data returned is compressed. The status byte indicates how the data is
compressed (zlib or bzip2) and at what offset the compressed data starts
(0 .. 15). This bit is only turned on when both the ‘code’ and ‘status’ bytes
would otherwise be zero.
0x08 PURGE START request was issued by the client. A list of ‘records’ to be purged from
local cache is returned. These are ‘records’ that have been updated since
the last START/END request from the client by other systems. Each record
identifier is a 4-byte field in the data segment. The number of records then is
‘length’ / 4. If the number of records exceeds a threshold (16) then ‘length’
will be zero indicating that the client should purge all locally cached records
for the device.
‘stat’ contains status information as a result of the request. For READ / WRITE requests this contains the
‘unitstat’ information if an IOERR occurred.
‘devnum’ identifies the server device number.
‘id’ specifies the system identifier for the request.
‘length’ is the length of the data returned.
9.1 Basics
Real SCSI tape drives used with Hercules must provide a certain minimum set of "IBM compatible"
support in their SCSI command set/behavior in order to work properly with Hercules. Furthermore the
Hercules device-type used on the Hercules configuration file device statement must match the level of
support/behavior that the SCSI device(s) provide.
For example all SCSI tape drives used with Hercules must provide the ability to set variable-length blocks
as well as long erase-gaps. Long erase-gaps allows new data to be appended to the end of existing data
without having to write a tape-mark to separate the new data from the old existing data first.
Another example would be using a model of SCSI tape drive that happens to report physical block-id
values in a format different from the way real IBM mainframe tape drives report them. 3480/3490 tape
drives report their block-ids (used in Read Block Id and Locate CCW’s) in a very specific format wherein
bits 1-7 of the high-order byte of the reported 4-byte block-id indicates the tape’s physical segment where
the location of the lower 22-bit block number physically exists on the tape. The block-id segment is used
to allow the tape drive to quickly position itself to the approximate location where the desired block ac-
tually resides on the tape and thus allows high-speed positioning for the Locate CCW.
If the model of SCSI tape drive used with Hercules does not use this same block-id format then it can not
be used with Hercules as a 3480 or 3490 model tape drive with certain defined options.
If the SCSI tape drive used reports its block-ids using a 32-bit block-id value (the same way a 3590 model
tape drive does), then similarly it should be defined to Hercules as a model 3590 device-type, since that is
how it is behaving with respect the format of the returned blockid values. If you wish to define it in Hercu-
les as a model 3480 or 3490, then you will need to use certain defined options before it will work properly
as the model of drive you wish it to emulate.
It should be noted that partial support for 3590 device emulation is possible with judicious use of the
mentioned special options, but full or complete 3590 support is unlikely due to lack of publicly available
documentation. Details regarding the 3590 CCW handling is restricted (confidential) IBM proprietary infor-
mation and is not normally available outside of IBM. Not long ago IBM was required by US law to publish
such information but unfortunately for Hercules this is no longer the case.
The only required device statement parameter for SCSI attached tape drives is the name of the device as
it is known by the host. However depending on what actual model of SCSI tape drive is used and how it
behaves, it may be necessary to specify one or more optional parameters for Hercules to provide proper
emulation of the desired device type.
For example: a Quantum ‘DLT‘ (Digital Linear Tape) SCSI tape drive does not return or use a block-id
format compatible with 3480/3490 drives. It uses a full 32-bit block-id just like the model 3590 does. It
also does not support the Erase Gap CCW at all. Thus in order to use a Quantum DLT drive with
Hercules, you must specify some special additional options to prevent the Erase Gap command from
being issued to the drive as well as to inform Hercules that the drive uses 32-bit block-ids.
This option should only be used for drives such as the Quantum which support switching from read mode
to write mode in the middle of a data stream without the need of an intervening Erase Gap command.
Specifying it for any other model SCSI drive may cause incorrect functioning as a result of the Erase Gap
command not being issued to the actual SCSI hardware.
Check the manufacturer information for your particular model of SCSI-attached tape drive (and/or use
Fish’s "ftape" Windows utility) to determine whether or not this option is needed for your particular drive.
Specifying this option on a 3480/3490 device statement will cause Hercules device emulation logic to
automatically translate the actual SCSI tape drive’s 32-bit block-id into 22-bit format before returning it
back to the guest operating system. This is the format the guest will expect for a model 3480/3490 drive.
The guest’s 22-bit format block-id will also be translated into 32-bit format before sending it to the actual
SCSI hardware, since that is the format that the actual hardware requires it to be in.
The loader has 2 basic functions; module load and module unload. When the module load function re-
ceives a path name along with the module name, the module is loaded from that specific path. If no path
is given, the module is loaded from the default library search order. Note that this is different from the
standard search order.
Additionally there are two resolve functions. The first one will return the entry point of a symbol name, the
second one will return the previous entry point, i.e. the entry point that was active before the current entry
point was registered. This function is intended to allow a module to call the original routine.
There are some special considerations for systems that do not support the concept of back-linking. Back-
linking is the operating system support of dynamically resolving unresolved external references in a dyna-
mic module, with the main module or other loaded modules. Cygwin does not support back-linking.
Unload will remove all references to a specific module but currently it will not actually remove the loaded
module from memory. This is because there is no safe way (yet) to synchronize unloading of code and
besides, it may still be in use. This should however pose no practical limitations.
When a module lists a new dependency, that dependency will be registered. Unloading the module does
not remove the dependency; this is to be consistent with the previous note about unloading.
The following subchapters describe some of the Hercules Dynamic Loader sections in more detail.
11.2 Troubleshooting
In the event that a certain CP or VM Assist disrupts normal operations it is possible to selectively disable
each discrete component. In this situation the best method of diagnoses is to disable all VM and CP
Assists (except STEVL and SSM if done prior to IPL) and to enable each feature until the problem re-
occurs. If it is unknown whether the problem lies in the VM or CP Assist it is also possible to enable / dis-
able the entire group of assists.
ECPSVM STA allows you to see how often each assist is invoked. The hit and hit-ratio make it possible to
determine how effective the assists are. A low hit ratio may be normal in some situations, for example the
LPSW hit ratio will be very low when running VM under VM as most PSW switches cannot be resolved by
the assist.
A low invocation count simply shows that in that particular situation the related assist is not used often, for
example there are very few LCTLs, when running CMS. Some assists are just invoked once at IPL, such
as STEVL. This is normal behaviour.
11.3.1 CP Assists
The following CP Assists are implemented:
• FREEX, FRETX (CP Free Storage Management)
• DISP0, DISP1, DISP2 (CP Dispatching)
• PGLOCK, PGULOCK (Real Frame Locking/Unlocking)
11.3.2 VM Assists
The following VM Assists are implemented:
• Virtual Interval Timer
• LPSW Simulation
• SSM Simulation
• SVC Simulation
• LCTL Simulation
11.4.1 CP Assists
The following CP Assists are not (yet) implemented:
• FREE, FRET (Original CP Storage Management, replaced by FREEX, FRETX)
• CCWNG, DFCCW, DNCCW, UXCCW (CCW/CSW Translation Assists)
• LCSPG (Locate Changed Shared Page/Segment Invalidation)
• VIPT, VIST (Virtual Translation Page/Segment Invalidation)
• LINK, RETURN (SVC 8/SVC 12)
• Prefered Machine Assists (Insufficient information available)
11.4.2 VM Assists
The following VM Assists are not (yet) implemented:
• V=R Shadow Table Bypass Assists (including LRA instruction)
• SIO
• DIAG
• IUCV
• STxSM
• ISK, SSK, ISKE, SSKE, IVSK (Extended Key Operations Assists)
• VM Assists for MVS
The target is a regular expression as defined by your host platform. When running on Linux, Hercules
uses POSIX Extended Regular Expression syntax. On a Windows platform, regular expression support is
provided by Perl Compatible Regular Expression (PCRE). The HAO facility can only be used if regular
expression support was included in Hercules at build time.
The associated command is whatever valid Hercules panel command you wish to issue in response to a
message being issued that matches the given target pattern.
Where nnn is the (optional) number of an existing rule. This gives you the list of all rules with the specified
identifier or lists the rule with identifier ‘nnn’. Then use the next command to delete the specific rule identi-
HAO CLEAR
12.4 Limitations
The current implementation limits the total number of defined rules to 64. This limit may be raised by in-
creasing the value of the HAO_MAXRULE constant in module “hao.c” and rebuilding Hercules.
All defined rules are checked for a match each time Hercules issues a message. There is no way to
specify “stop processing subsequent rules”. If a message is issued that matches two or more rules, each
associated command is then issued in sequence.
13.1 Prerequisites
Since version 4.00 the Hercules Emulator supports Rexx. The Rexx environment is based on two Rexx
packages:
• Open Object Rexx (ooRexx)
• Regina Rexx (Regina)
It is a prerequisite that at least one of these packages is installed to use Rexx. It is however possible to
have installed both of these packages and dynamically switch between the two environments depending
on the needs.
Rexx support is fully dynamic, only header files are required to build Rexx support into Hercules. If the
headers “rexx.h” and “oorexxapi.h” are found then support for ooRexx will be included. If the header
“rexxsaa.h” is found then support for Regina will be included. Please refer to the “Installation Guide” and
“User Reference Guide” for more information on how to activate Rexx under Hercules.
The available Rexx interpreters will be determined at run time, trying to load the appropriate dynamic
libraries. For which Rexx packages support is activated can be seen in the build information that is issued
during the startup of Hercules.
The Rexx initialization stub will check the availability of the packages in the order ooRexx first and Regina
second. In case both interpreters are installed ooRexx will be the first choice.
Rexx will be invoked implicitly if an existing script file starts with “/*”.
Example 1:
EXEC d:\rexx\script1.rex arg1 arg2
In the first example the Rexx script named “script1.rex” located on drive d: in directory “rexx” will be called
with “arg1” and “arg2” as arguments.
Example 2:
EXEC script2.rex arg1
In the second example the Rexx script named “script2.rex” is called with “arg1” as argument. The script
will be searched in the path specified in the Rexx environment or in the default path if none is given.
Example 3:
EXEC script3
In the last example the Rexx script named “script3” is called without any arguments. The script will be
searched in the path specified in the Rexx environment or in the default path if none is given. The search
looks for an extension as defined through the extensions or suffixes settings or one of the default exten-
sions is none is specified.
For details on how to set the Rexx environment please see the REXX console command or system para-
meter described in the ”User Reference Guide”.
Note: This version only applies to the Mac OS X 10.4 (Tiger) platform. Version 3.04 is current for
all other platforms.
15.1 Introduction
The Hercules Windows GUI provides a graphical interface to the Hercules Emulator itself. Hercules itself
has only a semi-graphical user interface, the Windows GUI gives a full graphical user interface. Working
with native Hercules one has to deal with many batch-oriented or line-command utilities, whereas with the
Windows GUI these utilities are directly usable from the GUI itself without having to know the exact com-
mand-line syntax.
The Windows GUI also helps in creating and maintaining the configuration files and helps working with
the Hercules log files. The Hercules Windows GUI is also known under the short name HercGUI. The
Hercules Windows GUI is written and maintained by David B. Trout, known as “Fish”.
The following figure shows the main panel of the Hercules Windows GUI.
16.1 Introduction
The Hercules Studio provides a graphical user interface under Linux and Mac OS X to the Hercules
Emulator itself. Hercules has only a semi-graphical user interface, the Hercules Studio gives a full
graphical user interface. The Hercules Studio is the Linux/Mac OS X counterpart to the Hercules Win-
dows GUI described in the previous sections.
Hercules Studio is written and maintained by Jacob Dekel. See Appendix A for download links.
The following figure shows the main panel of the Hercules Studio.
17.1 Introduction
Hebe, the Hercules Image Manager, is a KDE (KDE 4.4) front-end GUI for the Hercules Emulator. It was
designed to have a modern look, like the VirtualBox interface. Hebe provides two consoles, one for Her-
cules and one for the SCP (system control program, the operating system running under Hercules). Input
is automatically routed to the correct receiver. Hebe can manage as many Hercules instances as the
hardware can support.
Hebe is written and maintained by Robin Atwood. See Appendix A for download links.
The figures on the following pages show Hebe’s Hercules and system console.
18.1 Introduction
HercPrt is a remote Hercules printer spooler written by Fish (David B. Trout), the author of the widely
used HercGUI, CTCI-WIN, AWSBrowse and FTAPE packages. HercPrt is designed to receive text output
from a Hercules “socket device” (sockdev) line printer and use it to create a disk file on the local Windows
system.
Because HercPrt uses standard TCP/IP sockets to communicate with a Hercules line printer, the actual
Hercules system whose line printer output HercPrt is spooling, can be physically located at any place
reachable via standard IP networking.
HercPrt supports creation of either plain text files, HTML files, Rich Text Format files (RTF) or Portable
Document Files (PDF) according to the options provided in a “Job Separator Control File”. Several
sample job separator control files are provided with the HercPrt package.
The job separator control file tells HercPrt what the Hercules guest operating systems job separator
pages look like, so that it can automatically create separate Windows files for each print job, each optio-
nally named according to a choice of job accounting field values extracted directly from the job separator
page itself. HercPrt will create these spooled print files in whatever directory you choose using your spe-
cified options.
Several HercPrt instances can be run simultaneously, each spooling a different Hercules line printer for
either the same instance or a completely different instance of Hercules. The options used for each printer
are saved under a user specific printer ID so that the same options can easily be specified the next time
HercPrt is run, by simply selecting the desired printer ID from a provided list of previously defined printer
IDs.
The main dialog user interface is fully resizable and can be completely hidden (minimized) to the system
tray area for minimal interference with normal Windows use. Automatic connection and reconnection sup-
port (with a user configurable delay between retries) is provided as well as complete control over the dis-
play of popup balloon tooltips used to notify the user of either incoming print output or loss of connectivity.
The following figure show the main panels of the HercPrt utility.
First, a capture system needs to bypass the protocol stack in order to access the raw data transiting on
the network. This requires a portion running inside the kernel of OS, interacting directly with the network
interface drivers. This portion is very system dependent, and in WinPcap it is realized as a device driver,
called Netgroup Packet Filter (NPF). WinPcap currently is provided in different versions of the driver for
Microsoft Windows. These drivers offer both basic features like packet capture and injection, as well as
more advanced ones like a programmable filtering system and a monitoring engine. The first one can be
used to restrict a capture session to a subset of the network traffic (e.g. it is possible to capture only the
ftp traffic generated by a particular host), the second one provides a powerful but simple to use mecha-
nism to obtain statistics on the traffic (e.g. it is possible to obtain the network load or the amount of data
exchanged between two hosts).
Second, the capture system must export an interface that user-level applications will use to take advan-
tage of the features provided by the kernel driver. WinPcap provides two different libraries: packet.dll and
wpcap.dll.
The second one exports a more powerful set of high level capture primitives that are compatible with lib-
pcap, the well known Unix capture library. These functions allow to capture packets in a way independent
from the underlying network hardware and operating system.
The following figure shows the various components of WinPcap:
The following paragraphs will describe the interaction of NPF with the OS and its basic structure.
• Network interface card or NIC drivers. NIC drivers directly manage network interface cards,
referred to as NICs. The NIC drivers interface directly to the hardware at their lower edge and at
their upper edge present an interface to allow upper layers to send packets on the network, to
handle interrupts, to reset the NIC, to halt the NIC and to query and set the operational charac-
teristics of the driver. NIC drivers can be either miniports or legacy full NIC drivers.
Miniport drivers implement only the hardware-specific operations necessary to manage a NIC,
including sending and receiving data on the NIC. Operations common to all lowest level NIC
drivers, such as synchronization, is provided by NDIS. Miniports do not call operating system
routines directly; their interface to the operating system is NDIS. A miniport does not keep track of
bindings. It merely passes packets up to NDIS and NDIS makes sure that these packets are
passed to the correct protocols.
Full NIC drivers have been written to perform both hardware-specific operations and all the syn-
chronization and queuing operations usually done by NDIS. Full NIC drivers, for instance, main-
tain their own binding information for indicating received data.
• Transport drivers or protocol drivers. A protocol driver implements a network protocol stack
such as IPX/SPX or TCP/IP, offering its services over one or more network interface cards. A
protocol driver services application-layer clients at its upper edge and connects to one or more
NIC driver(s) or intermediate NDIS driver(s) at its lower edge.
The next figure shows the position of NPF inside the NDIS stack:
Notice that the various Win32 operating systems have different versions of NDIS: NPF is NDIS 5 com-
pliant under Windows 2000 and its derivations (like Windows XP), NDIS 3 compliant on the other Win32
platforms.
The interaction with the OS is normally asynchronous. This means that the driver provides a set of call-
back functions that are invoked by the system when some operation is required to NPF. NPF exports
callback functions for all the I/O operations of the applications: open, close, read, write, ioctl, etc.
The interaction with NDIS is asynchronous as well: events like the arrival of a new packet are notified to
NPF through a callback function (Packet_tap() in this case). Furthermore, the interaction with NDIS and
the NIC driver takes always place by means of non blocking functions: when NPF invokes a NDIS
function, the call returns immediately; when the processing ends, NDIS invokes a specific NPF callback to
inform that the function has finished. The driver exports a callback for any low-level operation, like
sending packets, setting or requesting parameters on the NIC, etc.
NPF is able to perform a number of different operations: capture, monitoring, dump to disk, packet
injection. The following paragraphs will describe shortly each of these operations.
• A packet filter that decides if an incoming packet has to be accepted and copied to the listening
application. Most applications using NPF reject far more packets than those accepted, therefore a
versatile and efficient packet filter is critical for good over-all performance. A packet filter is a
function with boolean output that is applied to a packet. If the value of the function is true the
capture driver copies the packet to the application; if it is false the packet is discarded. NPF
packet filter is a bit more complex, because it determines not only if the packet should be kept,
but also the amount of bytes to keep.
The filtering system adopted by NPF derives from the BSD Packet Filter (BPF), a virtual
processor able to execute filtering programs expressed in a pseudo-assembler and created at
user level. The the application takes a user-defined filter (e.g. “pick up all UDP packets”) and,
using wpcap.dll, compiles them into a BPF program (e.g. “if the packet is IP and the protocol type
field is equal to 17, then return true”). Then, the application uses the BIOCSETF IOCTL to inject
the filter in the kernel. At this point, the program is executed for every incoming packet, and only
the conformant packets are accepted.
Unlike traditional solutions, NPF does not interpret the filters, but it executes them. For
performance reasons, before using the filter NPF feeds it to a JIT compiler that translates it into a
native 80x86 function. When a packet is captured, NPF calls this native function instead of
invoking the filter interpreter, and this makes the process very fast. The concept behind this
optimization is very similar to the one of Java jitters.
• A circular buffer to store the packets and avoid loss. A packet is stored in the buffer with a header
that maintains information like the timestamp and the size of the packet. Moreover, an alignment
padding is inserted between the packets in order to speed-up the access to their data by the
applications.
Groups of packets can be copied with a single operation from the NPF buffer to the applications.
This improves performances because it minimizes the number of reads. If the buffer is full when a
new packet arrives, the packet is discarded and hence it’s lost. Both kernel and user buffer can
be changed at runtime for maximum versatility: packet.dll and wpcap.dll provide functions for this
purpose.
The size of the user buffer is very important because it determines the maximum amount of data that can
be copied from kernel space to user space within a single system call. On the other hand, it can be
noticed that also the minimum amount of data that can be copied in a single call is extremely important. In
presence of a large value for this variable, the kernel waits for the arrival of several packets before
copying the data to the user. This guarantees a low number of system calls, i.e. low processor usage,
which is a good setting for applications like sniffers. On the other side, a small value means that the
kernel will copy the packets as soon as the application is ready to receive them. This is excellent for real
time applications (like, for example, ARP redirectors or bridges) that need the better responsiveness from
the kernel. From this point of view, NPF has a configurable behavior that allows users to choose between
best efficiency or best responsiveness (or any intermediate situation).
The wpcap library includes a couple of system calls that can be used both to set the timeout after which a
read expires and the minimum amount of data that can be transferred to the application. By default, the
read timeout is 1 second, and the minimum amount of data copied between the kernel and the application
is 16K.
In normal situations, the sending rate of the packets to the network is not very high because of the need
of a system call for each packet. For this reason, the possibility to send a single packet more than once
with a single write system call has been added. The user-level application can set, with an IOCTL call
(code pBIOCSWRITEREP), the number of times a single packet will be repeated: for example, if this
value is set to 1000, every raw packet written by the application on the driver’s device file will be sent
1000 times. This feature can be used to generate high speed traffic for testing purposes: the overload of
context switches is no longer present, so performance is remarkably better.
The monitoring engine is made of a classifier followed by a counter. The packets are classified using the
filtering engine of NPF that provides a configurable way to select a subset of the traffic. The data that
pass the filter go to the counter, that keeps some variables like the number of packets and the amount of
bytes accepted by the filter and updates them with the data of the incoming packets. These variables are
passed to the user-level application at regular intervals whose period can be configured by the user. No
buffers are allocated at kernel and user level.
In traditional systems, the path covered by the packets that are saved to disk is the one followed by the
black arrows in Figure 3: every packet is copied several times, and normally 4 buffers are allocated: the
When the kernel-level traffic logging feature of NPF is enabled, the capture driver addresses the file
system directly, hence the path covered by the packets is the one of the red dotted arrow: only two
buffers and a single copy are necessary, the number of system call is drastically reduced, therefore the
performance is considerably better.
The current implementation dumps to disk in the widely used libpcap format. It gives also the possibility to
filter the traffic before the dump process in order to select the packet that will go to the disk.
The TunTap32 dll uses the FishPack dll to send / receive packets on the actual physical adapter via
WinPcaps device driver. By responding appropriately to ARP (Address Resolution Protocol) packets the
driver makes Windows think there is another physical adapter connected somewhere on the local net-
work. However this adapter is only a virtual one, created simply by having TunTap32 respond to Windows
ARP request packets, using a MAC address constructed from Hercules’ assigned ‘fake’ IP address.
Hercules’ virtual adapter MAC address is calculated to be 00-00-5E-xn-nn-nn, where xn-nn-nn’ is always
the last three octets of the IP address assigned to Hercules with the high-order x’80’ bit OR’ed on (that’s
what the ‘x’ means in ‘xn-nn-nn’). Thus in the above example the MAC address of Hercules’ virtual
adapter would be 00-00-5E-A8-00-04, because the last three octets of Hercules’ IP address 192.168.0.4
are ‘168’ (‘A8’ in hex), ‘0’ and ‘4’.
TunTap32 dll simply reads packets from, and writes packets to, the real Windows adapter via the
FishPack dll. From Windows’ point of view these packet come from a real workstation somewhere on the
The following sections give an introduction to the supported TN3270 terminal emulations.
Vista tn3270 is a Windows program designed to emulate IBM 3270 terminals connected to a mainframe
via IP link. Vista has some unique features designed especially for programmers, such as built-in multiple
cut and paste buffers, fully tailorable keyboard, extensive select / copy / paste functions – including
“SelectJCL”, which can pick out dataset names, parms and other items with a single mouse click.
Vista runs on any current Windows platform and due to its lightweight implementation can even run on
older machines with little memory and disk space. Vista uses bitmapped raster fonts for the clearest text
possible. There are two font sets in 73 sizes from 4x6 to 16x36 pixels to suite any monitor size and
terminal model preferences, either fullscreen or windowed.
x3270
x3270 is an IBM 3270 terminal emulator for the X Window System and Windows. It runs on most UNIX-
like operating systems, e.g. Linux, Mac OS X, Solaris, and Cygwin. It also runs natively on Windows.
x3270 runs over a TELNET connection, emulating either an IBM 3279 (color) or 3278 (monochrome)
terminal.
The window created by x3270 can use its own font for displaying characters and is an accurate represen-
tation of an IBM 3278 or 3279.
x3270 began life as 3270tool, a 3270 emulator for Suntools (Sun’s original proprietary windowing environ-
ment). 3270tool was developed by Robert Viduya at Georgia Tech. 3270tool was then ported to X11R4
by Jeff Sparkes and given the name x3270. Paul Mattes has been modifying and extending x3270 since
version 3.1 in 1993 and is the current maintainer. Over the years a number of people have made signifi-
cant contributions to x3270.
Please note, that x3270 does not yet support graphics. x3270 is distributed as source code, can be used
for free and is downloadable from http://x3270.bgp.nu.
x3270 is available in several different forms:
• x3270 is for use on a graphic display
• c3270 is a curses-based version for use on a dumb terminal (e.g. a serial terminal or a Linux
console)
• wc3270 is the Windows console version of c3270
• s3270 is a displayless version for writing screen-scraping scripts
• tcl3270 is similar to s3270, but integrated with Tcl
• pr3287 is for printer emulation
• wpr3287 is the native Windows version of pr3287
• x026 is an IBM 026 keypunch emulator
22.1 Introduction
The XMIT Manager is a Windows based tool that allows for the manipulation of IBM mainframe created
Xmit format files. The XMIT manager was developed by Neal Johnston-Ward. With XMIT Manager you
can open Xmit files and view or extract the data within them, whether binary or text based. Xmit files with
partitioned datasets or sequential dataset contents are dealt with similarly through the graphical interface.
The XMIT Manager is no longer available directly through Neal’s website but is now available via the CBT
Tape website (www.cbttape.org).
On the right of the screen the members of any PDS file are displayed. The members can be selected by
clicking on them. Double clicking a member will automatically open that member in a view screen. The
data contained within the Xmit file can be viewed in a separate window. For sequential datasets the entire
file is opened for view in the right side window.
The type of view is determined by the format type of the data to be viewed. Data with record format of
fixed (F or FB) will be treated as text and is displayed as ASCII text. Data that has a record format of
undefined (U) will be viewed as binary data.
Data selected for viewing will appear in a separate window. This window has some basic menu options
such as printing and printer setup, as well as the ability to save the screen data (which is the same as
extracting the data to a file).
The XMIT Manager is very useful for analyzing the contents of an Xmit file (e.g. from the CBT collection)
before uploading it to a mainframe system. It is also useful if you only need one or a few members from a
large Xmit file and do not wish to transfer the entire file to the mainframe. It is also possible to use Win-
dows based file systems for long term retention of mainframe data in Xmit format.
23.1 Introduction
The AWS Browse Utility can be used to view the contents of emulated mainframe tapes (AWS tapes and
HET tapes) from the Windows desktop without having to start a mainframe operating system. There are
currently two implementation of AWS browse.
The first (and older one) is from Rob Storey. Because this version does not have a real version identifi-
cation number and there is currently a newer, improved utility available, we will use version 0.9.x to de-
note this utility.
The newer implementation of AWS Browse comes from David B Trout (“Fish”) and has more features
than the original program. As the version from Rob Storey is no longer supported the following sections
provide details only of this newer functionality.
The enhanced AWSBROWSE can be downloaded directly from Fish’s website:
http://www.softdevlabs.com/Hercules/hercgui-index.html
23.6.1 Fixes
• Block detail dialog highlighting glitch fixed.
• Fixed bug preventing proper spannedblock handling.
• Fixed some minor ‘Find’ bugs (e.g. “Match Whole Word”).
23.6.2 Enhancements
• New project build system: NullSoft (NSIS) installation program.
• Project converted to Visual C++ 2008 SP1.
• Flex FakeTape support (file extension impartiality).
• File-type associations and default icons adjusted.
• Compression functionality (zlib/bzip2) moved to FishLib.
• Default maximum block size increased to 2MB.
• “Show Block Details” now shows all chunks associated with the logical block.
23.7.1 Fixes
• Fixed Visual Studio 2005 SP1 manifest issue.
23.7.2 Enhancements
• VS2005 and 64-bit support (requires VS2005 64-bit FishLib).
• Added “File -> Close” command.
• Load zlib/bzip2 DLLs at startup.
• Trailing garbage detection/recovery.
• Recognize Bus-Tech hardware compression flag.
• Add support for Bus-Tech segmented-block default.
• Registration of file-type associations with default icons.
• Tape summary (detailed statistics including standars label information).
• New “Go to…” command to go directly to start of any standard label file.
23.8.1 Fixes
• Minor UI fixes.
23.8.2 Enhancements
• VS2005 and 64-bit support.
• Added "File – Close" command.
• New tape summary report.
• New "Go To" command to jump to start of any standard label file.
• Recognize all Bus-Tech flags.
• Trailing garbage detection 7 recovery.
• Registration of file-type associations with default icons.
• Update to latest versions of BCMenu and FishLib.
23.9.1 Fixes
• Fix block data display to show 32-bit block displacements instead of 16.
• Fix divide-by-zero bug in Progress Dialog handling.
23.9.2 Enhancements
• Report FishLib DLL version information too.
• Support for searching within block, file or entire tape.
23.10.1 Enhancements
• Support for block sizes grater than 64 kB (controllable via registry entry settings).
• Support for extremely large files (greater than 4 GB).
• Support for Bus-Tech ZLIB compressed AWS files.
23.11.1 Enhancements
• Much more functional und friendly user interface, much faster than old AWSBROWS.EXE..
• Supports both AWS and HET files (including spanned block files).
• Supports both ZLIB and BZIP2 compressed file formats.
• User configurable (font and layout) hex display.
• Hex / text search capability.
• Displays both EBCDIC or ASCII.
• “Ditto”-like toolbar buttons for quick positioning to next / previous block or file.
• Clipboard support for hex and text as well as binary data.
• Printing and print preview support.
EBT1102 BTAM
EDS1102 DM Support
EER1400 EREP
EGA1102 GAM
EIP1102 IPCS
EMF1102 MF/1
EMI1102 MICR/OCR
EML1102 Multi-Leaving WS
EMS1102 MSS
ESY1400 SMP4
ETC0108 TCAM
ETI1106 TIOC
EUT1102 Utilities
EVT0108 VTAM
FDZ1610 DSF
FMID Description
As with most Open Source products support os available via a dedicated group of individuals and
enthusiasts who are willing to put in their spare time helping others with whatever problems and/or
questions others may have regarding Hercules. This dedicated group of Hercules enthusiasts is known as
"the user community" and in this authors opinion, vie the Hercules-390 forum this group provides an
excellent first point for all Hercules technical support.
If your question or concern regarding Hercules is not already addressed in the FAQ on the website or
within other areas of Hercules source-code and documentation,,consider posting your question to either
the main Hercules-390 forum or one of the more "focused" forums discussed in the next section:
25.3 Forums
There are several discussion groups for users of the Hercules ESA/390 mainframe emulator. The
Hercules-390 forum is in fact your primary source for Hercules support and you are strongly encouraged
to subscribe. There is a vibrant, active community of over 5000 members, many of which are very
knowledgeable in many different areas of mainframe technology, both hardware and software/OS points
of view.
In addition to the main Hercules-390 forum, other more specialized Hercules forums exist to provide more
focused support for a variety of popular IBM mainframe operating systems, such as DOS, VM, and MVS
(see sections below).
Note: the use of Yahoo! as host for the Hercules-390 and related forums should in no way be interpreted
as an endorsement of the Yahoo! service.
http://tech.groups.yahoo.com/group/hercules-390
25.5 H390-DOSVS
http://tech.groups.yahoo.com/group/h390-dosvs
25.6 H390-MVS
This forum is for Hercules-390 users whom are trying to run MVS.
http://tech.groups.yahoo.com/group/h390-mvs
This forum provides support for Volker Bandke’s "MVS Tur(n)key System.
http://tech.groups.yahoo.com/group/turnkey-mvs
25.8 H390-VM
This forum is for Hercules-390 users that are trying to run VM/370, VM/SP, &
VM/ESA.
http://tech.groups.yahoo.com/group/h390-vm
25.9 Herc-4Pack
http://tech.groups.yahoo.com/group/herc-4pack
http://tech.groups.yahoo.com/group/hercules-390-announce
25.11 Hercules-Advocacy
http://tech.groups.yahoo.com/group/hercules-advocacy
25.12 Hercules-S370ASM
Forum discussing the use of S/370 assembler with the Hercules emulator.
http://tech.groups.yahoo.com/group/hercules-s370asm
If anyone feels they have been unfairly omitted from either of these lists, please inform us as described in
1.7 (“Readers Comments”).
The following picture shows Roger Bowler, the original author of Hercules.
“I do miss my mainframe a lot, and playing with Herc sure brings back memories. Just seeing the IBM
message prefixes, and responding to console messages again was a wonderful nit of nostalgia.”
Bob Brown
“I do have installed your absolutely fantastic /390 emulator. You won’t believe what I felt I saw the prompt.
Congratulations, this is a terrific software. I really have not had such a fascinating and interesting time on
my PC lately.”
IBM Large Systems Specialist
“Such simulators have been available for a long time. One of the most complete (up to modern 64-bit
z/Architecture) is Hercules.”
Michael Hack, IBM Thomas J. Watson Research Center
“An apparently excellent emulator, that allows those open source developers with an ‘itch to scratch’ to
come to the S/390 table and contribute.”
Mike MacIsaac, IBM
“BTW grab a copy of Hercules and you can test it at home. It’s a very good S/390 and zSeries (S/390
64bit) emulator.”
Alan Cox
“It works even better, than I imagined. Hercules is a fine piece of software.”
Dave Sienkiewicz
“Aside from the electric trains my parents got me in 1953, this is the best toy I’ve ever been given, bar
none.”
Jeffrey Broido
“For anyone thinking running Hercules is toomuch trouble or too hard or whatever, I came home from
th
work one day and my 13 year old 8 grade son had MVS running under VM under Hercules on Linux. He
had gotten all the information about how to do this from the internet. When he complained about MVS
console configuration and figuring out how to get it to work with VM, I knew he had felt all the pain he ever
needed to feel about mainframes.”
Scott Ledbetter, StorageTek
“I am running a fully graphical Centos z/Linux environment on my desktop. The Hercules emulator is an
amazing feat of engineering. I just wanted to send my compliments to the team for an excellent job!
Thanks much for making this product part of the open-source community!”
Roby Gamboa
“I have DOS and DOS/VS running on Hercules with some demo applications, both batch and on-line. It
does bring back some good memories. My compliments go to the Hercules team. Thank you”.
Bill Carlborg
“ This is stunning piece of work. To say that I am blown away is an understatement. I have a mainframe
on my notebook!!!!!! P.S. Now if I can just remember my JCL”
Roger Tunnicliffe
Accordingly, an open-source license must guarantee that source be readily available, but may require
that it be distributed as pristine base sources plus patches. In this way, "unofficial" changes can be made
available but readily distinguished from the base source.
Some countries, including the United States, have export restrictions for certain types of software. An
OSD-conformant license may warn licensees of applicable restrictions and remind them that they are
obliged to obey the law; however, it may not incorporate such restrictions itself.
Yes, the GPL is conformant with this requirement. Software linked with GPLed libraries only inherits the
GPL if it forms a single work, not any software with which they are merely distributed.
29.2 Introduction
The intent of this license is to establish freedom to share and change the software regulated by this
license under the open source model.
This license applies to any software containing a notice placed by the copyright holder saying that it may
be distributed under the terms of the Q Public License version 1.0. Such software is herein referred to as
the Software. This license covers modification and distribution of the Software, use of third-party appli-
cation programs based on the Software, and development of free software which uses the Software.
2. You may copy and distribute the Software in unmodified form provided that the entire package, inclu-
ding - but not restricted to - copyright, trademark notices and disclaimers, as released by the initial deve-
loper of the Software, is distributed.
3. You may make modifications to the Software and distribute your modifications, in a form that is sepa-
rate from the Software, such as patches. The following restrictions apply to modifications:
a. Modifications must not alter or remove any copyright notices in the Software.
b. When modifications to the Software are released under this license, a non-exclusive royalty-
free right is granted to the initial developer of the Software to distribute your modification in future
versions of the Software provided such versions remain available under these terms in addition to
any other license(s) of the initial developer.
4. You may distribute machine-executable forms of the Software or machine-executable forms of modified
versions of the Software, provided that you meet these restrictions:
a. You must include this license document in the distribution.
b. You must ensure that all recipients of the machine-executable forms are also able to receive
the complete machine-readable source code to the distributed Software, including all modify-
cations, without any charge beyond the costs of data transfer, and place prominent notices in the
distribution explaining this.
c. You must ensure that all modifications included in the machine-executable forms are available
under the terms of this license.
5. You may use the original or modified versions of the Software to compile, link and run application
programs legally developed by you or by others.
b. You must explicitly license all recipients of your items to use and re-distribute original and
modified versions of the items in both machine-executable and source code forms. The recipients
must be able to do so without any charges whatsoever, and they must be able to re-distribute to
anyone they choose.
c. If the items are not available to the general public, and the initial developer of the Software
requests a copy of the items, then you must supply one.
29.5 No Warranty
The Software and this license document are provided AS IS with no warranty of any kind, including the
warranty of design, merchantability and fitness for a particular purpose.
http://www.hercules-390.eu
http://www.smrcc.org.uk/members/g4ugm/snapshots/
http://hercdoc.glanzmann.org
http://www.bsp-gmbh.com/turnkey/index.html
http://www.softdevlabs.com/Hercules/hercgui-index.html
http://www.softdevlabs.com/Hercules/CTCI-WIN-index.html
http://www.mvsdasd.org/hercstudio
http://kde-apps.org/content/show.php/Hebe?content=126738
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/
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
• PCRE
http://www.pcre.org
http://www.softdevlabs.com/Hercules/PCRE-6.4.1-bin-lib-inc-vc2008-x86-x64.zip
• Regina REXX
http://regina-rexx.sourceforge.net/
http://www.oorexx.org/
From left to right, standing: Richard Higson, Jan Jaeger, Greg Smith, Paul Leisy
From left to right, sitting: Willem Konynenberg, Jay Maynard, Matt Zimmerman, Fish
Figure 49: Dave Wade, Jay Maynard, Volker Bandke, Bernard van der Helm, Roger Bowler
From left to right: Paul Gorlinsky, Greg Smith, Fish, Tom Lehmann, Kevin Leonard, Kimberly McLaughlin,
Bill Miller, Ivan Warren, Enrico Sorichetti, Roger Bowler, Peter Glanzmann, Jay Maynard, Mark Gaubatz,
Carina Oliveri. Jan Jaeger is missing on this photo.
General Information
HEGI040000-00
Version 4 Release 00
Hercules Emulator
Page 176