This page describes the configuration file for the Hercules S/370, ESA/390, and z/Architecture emulator.
The configuration file hercules.cnf contains the processor and device layout. It is roughly equivalent to the IOCDS on a real System/390. The configuration file is an ASCII text file.
#################################################### # Hercules emulator configuration file # #################################################### # # System parameters # ARCHMODE ESA/390 OSTAILOR OS/390 LOADPARM 0120.... CPUSERIAL 000611 CPUMODEL 3090 CPUVERID FD MAINSIZE 64 XPNDSIZE 0 NUMCPU 1 NUMVEC 1 SYSEPOCH 1900 TZOFFSET -0500 ##HTTPROOT /usr/local/share/hercules/ HTTPPORT 8081 NOAUTH SHRDPORT 3990 CNSLPORT 3270 PANRATE FAST CODEPAGE default TODPRIO -20 HERCPRIO 0 DEVPRIO 8 CPUPRIO 15 DIAG8CMD disable # # Device definitions # 000A 1442 adrdmprs.rdr 000C 3505 jcl.txt ascii trunc 000D 3525 pch00d.txt ascii 000E 1403 prt00e.txt 001F 3270 0200.4 3270 0140 3370 dosres.140 0141 3370 syswk1.141 0300 3370 sysres.300 0120 3380 mvsv5r.120 0121 3380 mvsv5d.121 0122 3380 mvswk1.122 0123 3380 192.168.1.100 0400 3088 CTCT 30880 192.168.100.2 30880 2048 0401 3088 CTCT 30881 192.168.100.2 30881 2048 0420 3088 CTCI 192.168.200.1 192.168.200.2 0440 LCS -n /dev/net/tun 192.168.200.2 0580 3420 ickdsf.ipl 0581 3420 /dev/st0 0582 3420 /cdrom/tapes/uaa196.tdf 0583-0587 3420 * maxsizeM=170 eotmargin=131072
Blank lines, and lines beginning with a pound sign ('#' - "hash" to Europeans) or an asterisk, are treated as comments.
System parameters may appear in any order but they must precede all device records. Each system parameter must be on a separate line. The following system parameters may be specified:
CPUSERIAL xxxxxx
CPUMODEL xxxx
CPUVERID xx
MAINSIZE nnnn
nnnn
is a decimal number
in the range 2 to 1024
XPNDSIZE nnnn
nnnn
is a decimal number
in the range 0 to 1024
HTTPPORT nnnn [AUTH/NOAUTH] [userid password]
HTTPROOT directory
SHRDPORT nnnn
DIAG8CMD disable/enable
CNSLPORT nnnn
NUMCPU nn
MAX_CPU_ENGINES
in the file config.h has a value of more than 1.
Note: current versions of Hercules already have this value
set to 2 by default, so all you need to do is specify
NUMCPU 2
in your configuration file. If you wish to set a different value
for MAX_CPU_ENGINES, use the
--enable-multi-cpu=NUMBER
option when you do your ./configure before doing your
make.
Multiprocessor emulation works best
if your host system actually has more than one physical CPU, but you can
still emulate multiple CPUs nervertheless even on a uniprocessor system
(and you might even achieve a small performance benefit when you do).
There is little point, however, in specifying NUMCPU greater
than 1 unless your guest operating system (running under Hercules) is
actually able to support multiple CPUs (and if you do not actually need
multiprocessor emulation, then setting MAX_CPU_ENGINES to 1 at
compile time might even produce a slight performance advantage too).
NUMVEC nn
HERCPRIO nn
CPUPRIO nn
DEVPRIO nn
TODPRIO nn
LOADPARM xxxxxxxx
SYSEPOCH yyyy
SYSEPOCH 1988
is recommended.
This makes the year 2000 appear to be 1972.
TZOFFSET ±hhmm
-0500
for US Eastern Standard
Time, -0800
for US Pacific Standard Time).
For timezones east of Greenwich, specify a positive value
(example: +0100
for Central European Time,
+0930
for South Australian Time).
TODDRAG nn
OSTAILOR OS/390 | VM | VSE | LINUX
PANRATE SLOW | FAST | nn
ARCHMODE S/370 | ESA/390 | ESAME
S/370
for OS/360, VM/370, and MVS 3.8.
Use ESA/390
for MVS/XA, MVS/ESA, OS/390, VM/ESA, VSE/ESA,
Linux/390, and ZZSA.
Use ESAME
for z/OS and zLinux.
When ESAME is specified, the machine will always IPL in ESA/390 mode,
but is capable of being switched into z/Architecture mode after IPL.
This is handled automatically by all z/Architecture operating systems.
DEVTMAX -1 | 0 | 1-n
Specify -1
to cause 'one time only' temporary threads to be
created to service each I/O request to a device. Once the I/O request is
complete, the thread exits. Subsequent I/O to the same device will cause
another worker thread to be created again.
Specify 0
to cause an unlimited number of 'semi-permanent'
threads to be created on an 'as-needed' basis. With this option, a thread
is created to service an I/O request for a device if one doesn't already
exist, but once the I/O is complete, the thread enters an idle state waiting
for new work. If a new I/O request for the device arrives before the timeout
period expires, the existing thread will be reused. The timeout value is
currently hard coded at 5 minutes. Note that this option can cause one thread
(or possibly more) to be created for each device defined in your
configuration. Specifying 0
means there is no limit to the
number of threads that can be created.
Specify a value from 1
to n
to set an upper limit
to the number of threads that can be created to service any I/O request to
any device. Like the 0
option, each thread, once done servicing
an I/O request, enters an idle state. If a new request arrives before the
timeout period expires, the thread is reused. If all threads are busy when
a new I/O request arrives however, a new thread is created only if the
specified maximum has not yet been reached. If the specified maximum number
of threads has already been reached, then the I/O request is placed in a queue
and will be serviced by the first available thread (i.e. by whichever thread
becomes idle first). This option was created to address a threading issue
(possibly related to the cygwin Pthreads implementation) on Windows systems.
The default for Windows is 8
. The default for all other systems
is 0
.
PGMPRDOS RESTRICTED | LICENSED
RESTRICTED
to
make Hercules emulate an IFL (Integrated Facility for Linux) CPU. With
this specified, licensed ESA or z/Architecture OSes will refuse to
start. OS/390 and z/OS will enter an A7A wait state, with reason code 7,
at IPL time. Specify LICENSED
to allow these operating
systems to run normally. This parameter has no effect on Linux/390,
Linux for z/Series, or any 370-mode OS.
NOTE: It is YOUR responsibility to comply with the terms of your license for the software you intend to run on Hercules. If you specify LICENSED and run a licensed operating system in violation of that license, then don't come after the Hercules developers when the vendor sends his lawyers after you.
RESTRICTED
is the default. Specifying
LICENSED
will produce a message at Hercules startup to
remind you of your responsibility to comply with software license terms.
IODELAY usec
dasd.c
device driver. The problem is more apt to happen under Hercules than
on a real machine because we may present an I/O interrupt sooner than a
real machine. This problem is being pursued with IBM linux. Meanwhile,
if OSTAILOR LINUX
is specified, then this value defaults to
800 otherwise the value defaults to 0.
CODEPAGE codepage
ECPSVM YES | NO | LEVEL nn
LDMOD module list
MODPATH path
A comment preceded by a pound sign may be appended to any system parameter statement.
Note: Under Linux, a process is a thread and thread priority information applies instead.
For Windows, the following conversions are used for translating Unix
process priorities to Windows process priority classes:
Unix Priority | Windows Priority Class | ||||
---|---|---|---|---|---|
-20 | to | -16 | Realtime | ||
-15 | to | -9 | High | ||
-8 | to | -1 | Above Normal | ||
0 | to | 7 | Normal | ||
8 | to | 15 | Below Normal | ||
16 | to | 20 | Low |
On a *ix (Linux/Unix) host, Hercules needs to be a setuid root
program to allow it to reset its dispatching priority to a high
(negative) value
(i.e., chown root.root hercules; chmod +s hercules
).
For Windows, the following conversions are used for translating Linux/Unix thread priorities to Windows thread priorities:
Unix Priority | Windows Priority | ||||
---|---|---|---|---|---|
-20 | to | -16 | Time Critical | ||
-15 | to | -9 | Highest | ||
-8 | to | -1 | Above Normal | ||
0 | to | 7 | Normal | ||
8 | to | 15 | Below Normal | ||
16 | to | 19 | Lowest | ||
20 | Idle |
The remaining statements in the configuration file are device records. There must be one device record for each I/O device or group of identical I/O devices. The format of the device record is:
devnums devtype [arguments]
where:
devnums
devnum
devtype
Device type | Description | Emulated by |
---|---|---|
3270, 3287 | Local non-SNA 3270 display or printer | TN3270 client connection |
1052, 3215 | Console printer-keyboards | Telnet client connection |
1442, 2501, 3505 | Card readers | Disk file(s) (ASCII or EBCDIC) |
3525 | Card punch | Disk file (ASCII or EBCDIC) |
1403, 3211 | Line printers | Disk file (ASCII) |
3410, 3420, 3480 3490, 9347, 8809 3422, 3430 |
Tape drives | Disk file, CDROM, or SCSI tape |
3088 | Channel-to-channel adapters | TCP socket, TUN/TAP Driver |
3310, 3370, 9332 9335, 9336, 0671 |
FBA direct access storage devices | Disk file |
2311, 2314, 3330 3340, 3350, 3375 3380, 3390, 9345 |
CKD direct access storage devices | Disk file |
2703 | Communication Line | TCP Socket |
arguments
If neither EBCDIC nor ASCII is specified, then the device handler
attempts to detect the format of the card image file when the device
is first accessed.
Auto-detection is not supported for socket devices, and the default
is ASCII if sockdev is specified.
noprompt
, if specified, will remove
the message at the console prompting for input.
sockdev
port
or host:port
or sockpath/sockname
. The device then accepts
remote connections on the given TCP/IP port or Unix Domain
Socket, and reads data from the socket instead of from a device
file. This allows automatic remote submission of card reader
data. See the Hercules Socket Reader
page for more details.
eof
intrq
option.
intrq
eof
option.
multifile
ebcdic
ascii
trunc
autopad
ascii
ascii
argument is not specified, the
file is written as fixed length 80-byte EBCDIC records with
no line-end delimiters.
crlf
crlf
argument is not specified, then
line-feeds only are written at the end of each line.
MAXSIZE
|MAXSIZEK
|MAXSIZEM
=n
EOTMARGIN
=n
The following are the emulation types currently supported:
(Note: The CTCI protocol is only for the Linux version of
Hercules. For Windows, use the below CTCI protocol instead).
A single device should be declared for all LCS device numbers. The LCS
emulator will create all the additional devices necessary for LCS operations.
Also, the 1st declared device should be an even numbered device.
The configuration statement for LCS is as follows:
NOTE :
NOTE :
guestip
hostip
-n name
or --dev
name
-d
or --debug
Note : CTCT currently only supports IP traffic, so it cannot be used to
transport NJE, SNA, PVM, etc.. payload. This may change in the future.
lport
rhost
rport
bufsize
Rather than a point-to-point link, this emulation creates a
virtual ethernet adapter through which the guest operating system
running in the Hercules machine can communicate. As such, this
mode is not limited to TCP/IP traffic, but in fact will handle
any ethernet frame.
There are no required parameters for the LCS emulation, however
there are several options that can be specified on the config
statement:
On the MAC OS X Platform, the long option format (--xxx) is not supported. Only the short option format (-x : One dash, one letter) should be used.
-n devname or --dev devname
-o filename or --oat filename
-m MAC Address or --mac MAC address
guestip
*********************************************************
* Dev Mode Port Entry specific information *
*********************************************************
0400 IP 00 PRI 172.021.003.032
0402 IP 00 SEC 172.021.003.033
0404 IP 00 NO 172.021.003.038
0406 IP 01 NO 172.021.002.016
040E SNA 00
HWADD 00 02:00:FE:DF:00:42
HWADD 01 02:00:FE:DF:00:43
ROUTE 00 172.021.003.032 255.255.255.224
Dev
Mode
Port
For IP modes, the entry specific information is as follows:
PRI|SEC|NO
nnn.nnn.nnn.nnn
Note: SNA is currently NOT implemented.
Additionally, two other statements can be included in the address translation file. The HWADD and ROUTE statements.
Use the HWADD to specify a hardware (MAC) address for a virtual adapter. The first parameter after HWADD specifies with relative adapter for which the address is applied.
The ROUTE statement is included for convenience. This allows the hercifc program to create a network route for this specified virtual adapter. Please note that it is not necessary to include point-to-point routes for each IP address in the table. This is done automatically by the emulation module.
Up to 4 virtual (relative) adapters 00-03 are currently supported.
If no Address Translation file is specified, the emulation module will create the following:
The file consists of fixed length 512-byte records,
each of which represents one physical block of the emulated disk.
To allow access to a minidisk within a full-pack FBA DASD image
file, two additional arguments may be specified after the file
name:
If you specify an INET address the format is:
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 2GB (for example, the 3390 model 3)
can be supported by spreading the data across more than one file.
Each file contains a whole number of cylinders. The first file
(which contains cylinders 0-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 character of
the file name by the characters 2, 3, etc.
When CKD DASD images are spread across multiple files, you must
specify only the first file name (the file with suffix _1) in the
configuration statement!
If your operating system supports large file sizes or
64 bit offsets then volumes larger than 2G can be kept
in a single file.
Alternatively, the argument may specify the name of a file containing
a compressed CKD DASD image. The CKD driver will automatically detect
whether the file contains a regular CKD image or a compressed CKD
image. Refer to the CCKD page for details
on how to create and use compressed CKD DASD images.
If you specify an INET address the format is:
origin
numblks
ip-name-or-addr:port:devnum
The communication is emulated over a TCP connection. All bytes are
transfered as-is (except for doubling DLE in transparent mode) just
like it would over a real BSC link. Emulated EIA (DCD, DTR, CTS,
etc..) or X.21/V.11 leads (C, T, etc..) are treated differently depending
on the DIAL option selected.
ip-name-or-addr:port:devnum
DIAL=IN|OUT|INOUT|NO
lhost=hostname|ip address|*
lport=service name|port number
rhost=hostname|ip address
rport=service name|port number
rto=0|-1|nnn|3000
pto=0|-1|nnn|3000
eto=0|-1|nnn|10000
A comment preceded by a pound sign may be appended to any device definition statement.
If you have a question about Hercules, see the Hercules Frequently-Asked Questions page.
Last updated 30 November 2003