Search

Friday, January 10, 2020

MVS 3.8 Operating System on IBM 3033 Mainframe: Virtualization on Linux Using Hercules and MVS 3.8J TK4- distribution

Supratim Sanyal's Blog: IBM MVS 3.8j Tur(n)key 4- ("TK4-") Operatimg System OS/VS2 MVS 3.8j under Hercules System/370, ESA/390, z/Architecture Emulator
IBM MVS 3.8j Tur(n)key 4- ("TK4-")
Knowing nothing about IBM mainframes, and never having had the opportunity to use one, I embarked on deploying an emulated IBM-3033 mainframe running their MVS 3.8 operating system using the Hercules emulator on Linux (OpenSUSE Tumbleweed) under guidance of moshix's  "IBM’s MVS 3.8 on Linux for newcomers" on YouTube. Moshix deserves all credit for everything in this post, I just followed his instructions. Here is the video:



Installation of IBM 3033 Mainframe / MVS 3.8


IBM 3033 Mainframe
IBM 3033 Mainframe
The "MVS 3.8j Tur(n)key 4- System" website has all the needed material. In addition, a IBM 3270 terminal emulator being mandatory, I simply installed the x3270 emulator from the OpenSUSE repository:

$ sudo zypper install x3270
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following NEW package is going to be installed:
  x3270

1 new package to install.
Overall download size: 1.4 MiB. Already cached: 0 B. After the operation, additional 7.4 MiB will be used.
Continue? [y/n/v/...? shows all options] (y): 
Retrieving package x3270-3.5-3.1.x86_64                                          (1/1),   1.4 MiB (  7.4 MiB unpacked)
Retrieving: x3270-3.5-3.1.x86_64.rpm .............................................................[done (281.5 KiB/s)]
Checking for file conflicts: ...................................................................................[done]
(1/1) Installing: x3270-3.5-3.1.x86_64 .........................................................................[done]
Executing %posttrans scripts ...................................................................................[done]


Installation of the he MVS 3.8j Tur(n)key 4- System distribution basically consists of decompressing the current, cbt and source tarballs in turn allowing the cbt and source tarballs to overwrite any existing files.

Since I already have a Hercules IBM S/390 virtual machine running ubuntu Linux that uses TCP port 3270 for TSO User Sessions (TSO stands for "Time Sharing Option" - IBM mainframe jargon for terminal sessions), for this new MVS 3.8J virtual machine I modified conf/tk4-.conf file to define "CNSLPORT ${CNSLPORT:=3271}" instead of "CNSLPORT ${CNSLPORT:=3270}". Here is the one-line difference between the modified and original:

$ diff tk4-.cnf tk4-.cnf.orig 
14,15c14
< ###CNSLPORT ${CNSLPORT:=3270}
< CNSLPORT ${CNSLPORT:=3271}
---
> CNSLPORT ${CNSLPORT:=3270}

I tweaked the launcher shell script "mvs" to nice the MVS virtual machine down:

$ diff mvs mvs.orig 
14,15d13
51c49
< nice -n 19 ionice -c 3 $force_arch hercules $DAEMON -f conf/tk4-.cnf >log/3033.log
---
> $force_arch hercules $DAEMON -f conf/tk4-.cnf >log/3033.log

and wrapped my usual "run" shell script around the modified launcher script "mvs".  Here is the complete run-mvs-3.8-in-screen.sh:

#!/bin/sh
#
# Hercules/IBM 3033 will have TCP port 3271 open if it is running
cd /disk2/home/localuser/hercules-mvs-3.8/run/
timeout 5 bash -c 'cat < /dev/null > /dev/tcp/localhost/3271'
if [ "$?" -ne 0 ]; then
  echo "$0 - No duplicate instance found, good to launch"
  logger "$0 - No duplicate instance found, good to launch"
  sync
else
        logger "$0 - Error hercules ibm3033 mvs is already running, check screen -r ibm3033"
        echo "$0 - Error hercules ibm3033 mvs is already running, check screen -r ibm3033"
        echo "screens:"
        /usr/bin/screen -ls
        exit 0
fi

echo Connect IBM3270 Terminal Emulator to TCP Port 3271 after bootup
echo e.g run x3270 X11 application or text-mode \"c3270 localhost:3271\"
#read -p "Press any key to continue..."
sleep 10


logger "$0 - starting hercules ibm3033 in screen ibm3033"
screen -S ibm3033 -m -d nice -n 10 ./mvs
sleep 5
logger "$0 - `screen -ls`"
echo "$0 - `screen -ls`"

sync;sync;sync
exit 0

Booting up the MVS system is then as simple as running the run-mvs-3.8-in-screen.sh script. Here is what Hercules emulator looks like:

IBM 3033 Mainframe running MVS 3.8 operating system under Hercules emulator on Linux OpenSUSE Tumbleweed


Pressing ESC in Hercules toggles a CPU and hardware oriented information screen:

IBM 3033 Mainframe running MVS 3.8 operating system under Hercules emulator on Linux OpenSUSE Tumbleweed - IBM Mainframe CPU and Hardware Details


Connecting to the MVS mainframe from a terminal is accomplished by launching the x3270 application (or in the absence of a X11 graphical windowing environment,  c3270 text-mode equivalent) and connecting to localhost:3271.

Supratim Sanyal's Blog: MVS 3.8 / 3.8J Utilities Commands Help on IBM mainframe
MVS 3.8 Utilities Help Screen

Language Compilers for IBM 3033 Mainframe / MVS 3.8


Sieve of Eratosthenes COBOL source on IBM Mainframe MVS 3.8J TK4- Operating System
Sieve of Eratosthenes COBOL source on IBM Mainframe MVS 3.8J TK4- Operating System

Following instructions in Moshix's tutorial, I could successfully edit and submit the Sieve of Eratosthenes prime-number generator programmed in COBOL to the MVS 3.8 batch execution  facility. The COBOL program is one of the included ones in the TK4- distribution. Here is the line printer output generated by Hercules:



Networking with IBM 3033 Mainframe / MVS 3.8

Well, I have not progressed far enough into the world of IBM Mainframes to attempt Networking yet. When I get to it I will write more about networking in a separate post.

No comments:

Post a Comment

"SEO" link builders: move on, your spam link will not get posted.

Recommended Products from Amazon