
KNOW-HOW Hercules Mainframe Emulator BIGHercules mainframe BOXES emulator Kirsty Pargeter, Fotolia Pargeter, Kirsty Many enterprises still rely heavily on mainframes, which makes it all the more difficult to get your hands on one and install Linux on it. The Hercules emulator gives you a full-fledged alternative. BY BERNHARD BABLOK ainframes commonly are re- tions, making it unsuitable for the pur- important to configure the host system garded as being reliable, but poses of this article. correctly. First, you need to modify the Malso big, complicated, pricey, In a directory of your choice (e.g., privileges for the /usr/local/bin/hercifc and outmoded in today’s IT landscapes. /usr/local/src), unpack the sources, script, which configures the Tun/Tap Here, the Hercules mainframe editor, change to the /usr/local/src/hercules-3.05 network device when Hercules starts up. which emulates the CPU architecture, directory, and enter configure as shown Just as for any direct device access, you can help. Even if Linux is running in a in Listing 1. After doing so, don’t forget need root privileges for this. The --en- production environment on a main- to check config.log, paying particular at- able-setuid-hercifc configure option (see frame, Hercules still can provide a useful tention to whether Zlib support is avail- Listing 1, line 9) sets the SUID bit, but service for testing and development. able. If the zlib-devel package is not in- the installation script sets group owner- In this article, I will describe how to stalled on SUSE, you will still be able to ship for the file to root, making it impos- set up and configure Hercules and its build and use Hercules, but you will not sible to execute the script as a non-privi- virtual hardware, and then I will focus be able to use the typical Zlib com- leged user. The following lines will set on installing zLinux on Hercules. Finally, pressed virtual hard disks. the permissions correctly: I’ll take a quick look at z/OS – the native After completing the configuration mainframe operating system – and its phase, follow the normal make and su -c # chgrp users U freely available predecessor MVS. "make install" procedure. Now Hercules /usr/local/bin/hercifc is installed, but some manual finishing # chmod 4750 U Download and Installation work is necessary. The HTML-formatted /usr/local/bin/hercifc Hercules 3.04 does not support current documentation is available in /usr/local/ zLinux variants, which is why you share/hercules, with links to additional The following sections only apply to should download the current source resources on the Internet; if you run into openSUSE systems; some details will code for version 3.05 [1]. The RPM, also difficulty, try the mailing list. vary for other operating systems. For the available from the homepage, will install If you will be using TCP/ IP network- network connection, Hercules uses the but does not support network connec- ing with a Hercules guest system, it is Tun/ Tap device; on a normal system, the 54 ISSUE 90 MAY 2008 054-059_hercules.indd 54 12.03.2008 11:22:10 Uhr Hercules Mainframe Emulator KNOW-HOW At system launch time, /etc/ Hercules supports emulated printers, init.d/boot.udev copies a num- there are no Linux drivers for the old, ber of devices from /lib/udev/ line-oriented 1403 printer (Figure 1). devices to /dev, so you will However, this is not a major drawback; need to delete the Tun device you can print over the network to the in this directory or modify its host’s CUPS server or to any other print permissions: server available on the network. The virtual hardware is defined in a chgrp users U configuration file (Listing 2), which is /lib/udev/devices/net/tun passed in to the emulator with the -f op- chmod 660 U tion when it’s launched. Hercules does /lib/udev/devices/net/tun not impose any restrictions with respect to the name and directory structure. De- Network Preparation pending on your personal preferences, The Tun/ Tap device supports a you can store all your files in a single point-to-point connection be- directory or organize them in subdirecto- tween the host and the guest, ries by file type. which other virtualization so- Virtual hard disks are normal files, as Figure 1: A throwback to the good old days: an IBM lutions call host-only network- with any other emulator. In IBM speak, 1403 line printer. ing. If you want to grant the hard disks are referred to as DASDs (for guest system access to the direct-access storage devices). To create device is owned by root:root and has per- local network – or even the Internet – hard disks for your zLinux installation, missions of 0600. Again, this rules out you also will need to set up NAT. To do enter: access by normal users. However, chang- so, first enable IP forwarding, either per- ing the permissions manually will not do manently in /etc/sysconfig/sysctl (IP_ dasdinit -z -lfs U you much good because the original sta- FORWARD=yes) or manually: dasd/sys1.dasd 3390-3 SYS1 tus is restored when you reboot. dasdinit -z -lfs U Udev is used for device management echo "1" > U dasd/sys2.dasd 3390-3 SYS2 on today’s systems, which is why you /proc/sys/net/ipv4/ip_forward will need to modify the corresponding The -z option configures Zlib compres- Udev rule. On an openSUSE system, Then use iptables to define two rules: sion. Alternatively, you could select -bz2 the /etc/udev/rules.d/50-udev-default. for Bzip2 compression; note that the rules file controls this, and you must iptables -t nat -A POSTROUTING U method is slower, and thus means per- add: -o eth0 -j MASQUERADE formance hits without giving you major iptables -A FORWARD -i U disk space savings. The -lfs option refers KERNEL=="tun", GROUP="users", U tun0 -j ACCEPT NAME="net/%k",MODE="0660" This completes To give /dev/net/tun the right permis- preparation of the sions, type rm /dev/net/tun and mod- host system. Next probe tun. If the device still has incorrect comes creating and permissions after a reboot, don’t worry. configuring the virtual hardware. Listing 1: Building Hercules: Configure Arguments Virtual 01 #!/bin/bash Hardware 02 Hercules supports a whole bunch of vir- 03 PREFIX=/usr/local tual hardware com- 04 ponents, but you 05 ./configure --prefix=$PREFIX \ just need some hard 06 --enable-cckd-bzip2 disks and a network \ connection for 07 zLinux. Because --enable-optimization=yes \ this is a high-end 08 server system, --disable-external-gui \ video, audio, and 09 USB support are ir- Figure 2: The Hercules console showing the supported features on --enable-setuid-hercifc relevant. Although startup. MAY 2008 ISSUE 90 55 054-059_hercules.indd 55 12.03.2008 11:22:14 Uhr KNOW-HOW Hercules Mainframe Emulator Listing 2: Hercules Configuration for CentOS 4.5 01 # 17 TZOFFSET +0000 02 # Configuration file for Hercules & CentOS 4.5 18 OSTAILOR LINUX # OS tailoring s390 19 PANRATE SLOW # Panel refresh rate 03 # 20 ARCHMODE ESAME # Architecture mode S/370, 04 ESA/390 or ESAME 05 MODPATH ${MODPATH_HERCULES:=/usr/local/lib/ 21 PGMPRDOS RESTRICTED hercules} 22 06 23 07 CPUSERIAL 002623 24 # Device list 08 CPUMODEL 2096 25 # --- ---- -------------------- 09 MAINSIZE 780 26 10 XPNDSIZE 0 # Expanded storage size in 27 # DASD megabytes 28 11 CNSLPORT 3270 # TCP port number to which 29 0A01 3390 dasd/sys1.dasd consoles connect 30 0A02 3390 dasd/sys2.dasd 12 HTTPROOT ${HTTPROOT_HERCULES:=/usr/local/share/ hercules/} 31 13 HTTPPORT 9091 # HTTP server 32 # Channel to channel: CTCI ip-linux-guest ip-linux-host 14 NUMCPU 1 # Number of CPUs 33 15 NUMVEC 1 # Vector facilities emulated 34 0cc0.2 3088 CTCI 192.168.2.2 192.168.2.1 16 SYSEPOCH 1900 to large file support; that is, dasdinit tion gives you a list of available types ing the device addresses for Linux to will not split up the hard disk into 2GB and their respective sizes [2]. reference the disks. chunks. Depending on your DASD size, The last parameter for dasdinit, the you might want to omit this option so VOLSER name (the disk label), really is Network Interface you can store files on DVD media. not necessary for Linux, but the installa- Hercules emulates various types of net- The file names (dasd/sys?.dasd) are tion writes the label anyway. As a final work connections. The easiest type to arbitrary. The hard disk type (3390-3) step, the administrator needs to add the configure is the channel-to-channel defines the size, which is about 2.7GB in disks to the Hercules configuration file (CTC) connection. To configure two my example. The Hercules documenta- (Listing 2, lines 29-30), thereby assign- type-3088 CTC devices at the addresses 0cc0 and 0cc1, you just need to Listing 3: Verifying the Network Configuration add one line to the configuration 01 [root@sirius:~] # route -n file (Listing 2, line 34), and assign an address of 192.168.2.2 to the 02 Kernel IP routing table guest and 192.168.2.1 to the host. 03 Destination Gateway Genmask Flags Metric Ref Use Iface The HTML documentation explains 04 192.168.2.2 0.0.0.0 255.255.255.255 UH 0 0 0 tun0 the syntax for the device addresses 05 ... in particular. 06 127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo To launch Hercules, type the 07 [root@sirius:~] # ifconfig command: 08 eth0 ..
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages6 Page
-
File Size-