LoginSignup
54
50

More than 5 years have passed since last update.

メインフレームOSをCent OS下で動かす

Last updated at Posted at 2016-05-15

wikipediaでメインフレームを調べていたら、パソコンでメインフレームのOSが動かせることを知りました。

メインフレームOSの「wikipedia:OS/360」が2000年以降、パブリックドメインとなっていて、wikipedia:Hercules (emulator)というエミュレータ上で、このOSを動かすことができるとのこと。

ググると、「メインフレーム・コンピュータ」で遊ぼうWindowsでメインフレーム(MVS)を動かす等があり、Windowsで動かせるなら、Linuxでも動かしたいと思いまして、以下のその覚書。

ざっくり仕様

VirtualBox下のCentOSで試す。
Herculesエミュレータはrootで動かしたくないので、それ用のユーザでやる。
メインフレームOSは、キャラクターベースのユーザインターフェース中心なので、TeraTermからsshでCentOSにログインし、そこで3270端末エミュレータを起動してメインフレームOSにログオンする。
メインフレームOSの起動、HelloWorld、OSの停止までをやる。

目次

  1. 環境前提
  2. 事前準備
    2.1. Herculesエミュレータを動かすLinuxユーザの作成
    2.2. Herculesエミュレータのコンパイル&インストール(所要時間:50分)
  3. メインフレームクライアント環境構築(今回一番はまった所)
    3.1. 3270端末エミュレータのインストール
    3.2. TeraTermのキーボード設定ファイルの作成
    3.3. 3270端末エミュレータのキーボードカスタマイズ
  4. メインフレームOSのインストール
  5. メインフレームOSの起動
  6. メインフレームOSの停止

1. 環境前提

VirtualBox下のCentOSで試しています。

$ uname -a
Linux localhost.localdomain 2.6.32-573.26.1.el6.i686 #1 SMP Tue May 3 21:55:43 UTC 2016 i686 i686 i386 GNU/Linux
$ lsb_release -a
LSB Version:    :base-4.0-ia32:base-4.0-noarch:core-4.0-ia32:core-4.0-noarch
Distributor ID: CentOS
Description:    CentOS release 6.7 (Final)
Release:        6.7
Codename:       Final

2. 事前準備

2.1. Herculesエミュレータを動かすLinuxユーザの作成

$ sudo useradd hercules
$ sudo passwd hercules

2.2. Herculesエミュレータのコンパイル&インストール(所要時間:50分)

「Hercules」のホームページ。The Hercules System/370, ESA/390, and z/Architecture Emulator
Hercules Version 3: Installation and Operationに従ってエミュレータをインストールします。

2.2.1. Herculesエミュレータのソースを入手

$ mkdir Downloads
$ cd Downloads
$ wget http://downloads.hercules-390.eu/hercules-3.12.tar.gz
$ tar xvfz hercules-3.12.tar.gz
$ cd hercules-3.12

2.2.2. 依存パッケージのチェックと依存パッケージのインストール

※ perlがインストールされていないと、そもそも次の依存パッケージのチェックスクリプト自体が失敗しますので、その時は、perlからインストールしてください。

$ ./util/bldlvlck

私の環境ではautoconf automake gccのインストールが必要となりました。
この依存パッケージチェックでは漏れがいくつかあるため、追加でインストールします。

2.2.3. c++のインストールが必要。

この後に実行する「./configure」で、次のエラーが出る時があります。

configure: error: C++ preprocessor "/lib/cpp" fails sanity check

なので、C++も合わせてインストールします。

2.2.4. zlibのインストールが必要

Herculesコンパイル・リンク&インストール後のIPL起動で下記エラーがでる時があります。

Command ==> ipl 148
HHCCD124E 0148 file[0] invalid trk hdr trk 0: zlib compression unsupported

これは、コンパイル・リンクするときに、zlibがstaticにリンクされていないための模様。
なので、インストールしておく。参考URLは次の通り。
VM370sixpack-1.1 and Linux
Thread: Emulating z/OS Hercules, under ubuntu ISSUE zlib.

2.2.5. 最終的にインストールした追加パッケージ

$ su [sudoが実行できるユーザID]
$ sudo yum -y install autoconf
$ sudo yum -y install automake
$ sudo yum -y install gcc
$ sudo yum -y install gcc-c++
$ sudo yum -y install bzip2-devel
$ sudo yum -y install zlib-devel

2.2.6. configure, make, make install

「/usr/local/hercules/3.12 」にインストールしたいので、prefixを指定してconfigure。

$ ./configure --prefix=/usr/local/hercules/3.12
$ make
$ su [sudoが実行できるユーザID]
$ sudo make install
$ sudo chown -R hercules:hercules /usr/local/hercules

2.2.7. 簡単な動作確認

bashプロンプトからherculesコマンドを叩いて簡単な動作確認をします。

[hercules@localhost hercules-3.12]$ /usr/local/hercules/3.12/bin/hercules
Hercules Version 3.12
(c)Copyright 1999-2015 by Roger Bowler, Jan Jaeger, and others
Built on May 15 2016 at 11:16:52
Build information:
  Modes: S/370 ESA/390 z/Arch
  Max CPU Engines: 8
  Using setresuid() for setting privileges
  Dynamic loading support
  Using shared libraries
  HTTP Server support
  Regular Expressions support
  Automatic Operator support
  Machine dependent assists: cmpxchg1 cmpxchg4 cmpxchg8 fetch_dw store_dw multi_byte
Running on localhost.localdoma Linux-2.6.32-573.26.1.el6.#1 SMP Tue May 3 21:55:43 UTC 2016 i686 UP
HHCHD018I Loadable module directory is /usr/local/hercules/3.12/lib/hercules
Crypto module loaded (c) Copyright Bernard van der Helm, 2003-2010
  Active: Message Security Assist
          Message Security Assist Extension 1
          Message Security Assist Extension 2
          Message Security Assist Extension 3
          Message Security Assist Extension 4
HHCHT001I HTTP listener thread started: tid=B74FFB70, pid=11126
HHCHT013I Using HTTPROOT directory "/usr/local/hercules/3.12/share/hercules/"
HHCCF065I Hercules: tid=B77186D0, pid=11126, pgid=11126, priority=0
HHCHT006I Waiting for HTTP requests on port 8081
HHCTE001I Console connection thread started: tid=B71FFB70, pid=11126
HHCTE003I Waiting for console connection on port 3270
HHCTT002I Timer thread started: tid=B2FFAB70, pid=11126, priority=0
HHCCP002I CPU0000 thread started: tid=B30FBB70, pid=11126, priority=15
HHCCP003I CPU0000 architecture mode ESA/390
HHCPN001I Control panel thread started: tid=B77186D0, pid=11126

  Max CPU Engines: 8                                                           +
  Using setresuid() for setting privileges
  Dynamic loading support
  Using shared libraries
  HTTP Server support
  Regular Expressions support
  Automatic Operator support
  Machine dependent assists: cmpxchg1 cmpxchg4 cmpxchg8 fetch_dw store_dw multi_
Running on localhost.localdoma Linux-2.6.32-573.26.1.el6.#1 SMP Tue May 3 21:55:
HHCHD018I Loadable module directory is /usr/local/hercules/3.12/lib/hercules
Crypto module loaded (c) Copyright Bernard van der Helm, 2003-2010
  Active: Message Security Assist
          Message Security Assist Extension 1
          Message Security Assist Extension 2
          Message Security Assist Extension 3
          Message Security Assist Extension 4
HHCHT001I HTTP listener thread started: tid=B74FFB70, pid=11126
HHCHT013I Using HTTPROOT directory "/usr/local/hercules/3.12/share/hercules/"
HHCCF065I Hercules: tid=B77186D0, pid=11126, pgid=11126, priority=0
HHCHT006I Waiting for HTTP requests on port 8081
HHCTE001I Console connection thread started: tid=B71FFB70, pid=11126
HHCTE003I Waiting for console connection on port 3270
HHCTT002I Timer thread started: tid=B2FFAB70, pid=11126, priority=0
HHCCP002I CPU0000 thread started: tid=B30FBB70, pid=11126, priority=15
HHCCP003I CPU0000 architecture mode ESA/390
HHCPN001I Control panel thread started: tid=B77186D0, pid=11126
HHCAO001I Hercules Automatic Operator thread started;
          tid=B2C68B70, pri=0, pid=11126
Command ==>
CPU0000 PSW=0000000000000000 24M.......                              instcount=0

Herculesエミュレータ画面のコマンドプロンプトに「quit」と入力し、「Enter」を入力すると、bashプロンプトに戻ります。

Command ==> quit
HHCIN900I Begin Hercules shutdown
HHCIN901I Releasing configuration
HHCAO002I Hercules Automatic Operator thread ended
HHCTT003I Timer thread ended
HHCCP008I CPU0000 thread ended: tid=B30FBB70, pid=11126
HHCCF047I Subchannel 0:0000 detached
HHCCF047I Subchannel 0:0001 detached
HHCCF047I Subchannel 0:0002 detached
HHCCF047I Subchannel 0:0003 detached
HHCCF047I Subchannel 0:0004 detached
HHCIN902I Configuration release complete
HHCIN903I Calling termination routines
HHCHD900I Begin shutdown sequence
HHCHD901I Calling panel_cleanup
HHCTE004I Console connection thread terminated
HHCHD902I logger_term complete
HHCHD909I Shutdown sequence complete
HHCIN904I All termination routines complete
HHCIN909I Hercules shutdown complete
HHCIN099I Hercules terminated
HHCHD900I Begin shutdown sequence
HHCHD909I Shutdown sequence complete

3. メインフレームクライアント環境構築(今回一番はまった所)

今回一番はまった所が、メインフレームクライアント環境の構築です。

私が決めた仕様では、「TeraTermからsshでCentOSにログインし、そこで3270端末エミュレータを起動してメインフレームOSにログオンする」としました。

まず初めにはまったのは、ファンクションキーです。3270端末エミュレータでは、ファンクションキーを使います。
TeraTermをインストールした直後のキーボード設定ファイルでは、ファンクションキーのキーシーケンスをサーバに送出しません。
なので、TeraTermのキーボード設定ファイルでファンクションキーを使えるようにします。

次にはまったのは、TeraTermと3270端末エミュレータのキーマッピングの関係です。
TeraTermはvt220端末のキーシーケンスをサーバに送ります(キーボード設定ファイル)。
一方でメインフレームOSは3270端末のキーシーケンスです(wikipedia:IBM 3270)。

3270端末エミュレータとLinux系で使える端末エミュレータ(xtermやvt100、vt220)のキーマッピングが異なるので、キーマップの設定が必要になります。この後に紹介する3270端末エミュレータでは、「X Window System」環境下で「xterm」を起動して、そこから3270端末エミュレータを起動する分には、特別な設定をせずともファンクションキーが使えます。

しかし、TeraTermはvt220のキーシーケンスをサーバに送りますので、101/106キーボードの「Home」はvt220では、ncursesでいうところのkeynameでは、「Find」になります。「End」キーは「Select」です。
この違いが解っていないと後々のキーマッピングがうまくできません。

3.1. 3270端末エミュレータのインストール

$ sudo yum -y install x3270-text

3.2. TeraTermのキーボード設定ファイルの作成

テンキーパッドは全てOFFにします。OFFにしても使えます。

[VT numeric keypad]
Num0=off
Num1=off
Num2=off
Num3=off
Num4=off
Num5=off
Num6=off
Num7=off
Num8=off
Num9=off
NumPlus=off
NumPeriod=off
NumEnter=off
NumSlash=off
NumAsterisk=off
NumMinus=off

; X function keysを全てOFFにします。
[X function keys]
XF1=off
XF2=off
XF3=off
XF4=off
XF5=off
; F1からF5までのエスケープシーケンスを定義します。
[User keys]
; F1
User1=59,0,$1BOP
; F2
User2=60,0,$1BOQ
; F3
User3=61,0,$1BOR
; F4
User4=62,0,$1BOS
; F5
User5=63,0,$1BOT

3.3. 3270端末エミュレータのキーボードカスタマイズ

ncursesのkeynameコロンc3270のActionをカスタマイズファイルとして記述します。
ncursesのkeynameは、TeraTermがvt220キーシーケンスを送るので、vt220のkeynameで記述します。

3.3.1. 3270端末エミュレータのキーボードカスタマイズ仕様

「PgUp」キー(ncursesでは、PPAGE)には、3270端末エミュレータのPA(2)キーを割り当てます。
「PgDn」キー(ncursesでは、NPAGE) には、3270端末エミュレータのPA(1)キーを割り当てます。
「Home」キー(ncursesでは、FIND)には、3270端末エミュレータのHomeキーを割り当てます。
「End」キー(ncursesでは、SELECT)には、3270端末エミュレータのHomeキーを割り当てます。
「Home」キー(ncursesでは、FIND)には、3270端末エミュレータのHomeキーを割り当てます。

3.3.2. 3270端末エミュレータのキーボードカスタマイズファイルの作成

[hercules@localhost ~]$ pwd
/home/hercules
[hercules@localhost ~]$ vi c3270.keymap
<Key>PPAGE: PA(2)
<Key>NPAGE: PA(1)
<Key>FIND: Home
<Key>SELECT: EraseEOF

3.3.3. 「.bashrc」にTERM環境変数としてvt220を設定します。

特に設定していなければ、TeraTermでログインした後、TERM環境変数は次のようになっています。

$ printenv TERM
xterm

vt220キーシーケンスで操作することになるので、デフォルトでterminfoデータベースにインストールされているvt220を環境変数に変えます。

[hercules@localhost ~]$ pwd
/home/hercules
[hercules@localhost ~]$ vi .bashrc
export TERM=vt220

4. メインフレームOSのインストール

4.1. インストールメディアのダウンロード

MVS/380のフリーOS(turnkey-mvs-3 )をダウンロード。488MBあり、ダウンロードするのに10分くらいかかります。

$ wget http://www.ibiblio.org/jmaynard/turnkey-mvs-3.zip

このZIPファイルに「turnkey-mvs-3.iso」が圧縮されて格納されています。
このISOファイルを、例えば、E:ドライブにマウントすると「E:/cygwin/netcat.exe」がスパイウェアであるとして、ウィルスチェックに引っかかります。VirusTotalで試すとそこそこ引っかかります。

「netcat」が何のためにあるかですが、次のURLにある通り、Heraculesが監視しているソケットにデータ(例えばJCL)を流し込むのに使っています。
Submitting jobs via a socket reader
ですが、「netcat」はバックドアにも使われるコマンド(オンラインソフトを使え! 「第12回 Netcat」)
なので、インストールしないことにします。

「netcat」を使わなくても、Submitting jobs via a socket readerにもあるとおり、perlでソケットにデータを流し込むことができるので。

例えばWindows上で「turnkey-mvs-3.iso」をマウントして、「cygwin」ディレクトリと「linux」ディレクトリ以外のファイル群をzipファイルに固めます。例えば「tkmvs3.zip」。これをCentOSにFTPして、そこからインストールしていきます。

4.2. セットアップコマンドの起動

[hercules@localhost tkmvs3]$ pwd
/home/hercules/tkmvs3
[hercules@localhost tkmvs3]$ unzip tkmvs3.zip
 省略
 inflating: xmi/smp4.xmi
 inflating: xmi/sys1asmp.xmi
[hercules@localhost tkmvs3]$ chmod u+x ./setup
[hercules@localhost tkmvs3]$ ./setup

4.3. 標準セットアップを選択します。


  MVS 3.8J System Installation/Generation:


  1. Install MVS Tur(n)key system - standard setup                   Debug: off
  2. Install MVS Tur(n)key system - simple setup                      ANSI: on
  3. Install MVS Starter system and SYSGEN files
  x. Exit

Your choice ===> 1

4.4. メインフレームOSインストール先ディレクトリを指定します。

herculesエミュレータとは別のディレクトリにインストールできますので、このセットアップスクリプトのデフォルトのままとします。

  Target directory definition:


Please enter the target directory, or press enter for default (mvs38j)

The directory can be given as an absolute path, i.e. with a / characterat the beginning, or relative to

/home/hercules

With other words, the default installation directory is

/home/hercules/mvs38j

Please do NOT use spaces/blanks in the directory name!

===>

4.5. DASDをどこから利用するか指定します。

DASD:Direct access storage deviceの略。
「3」の「shadow files」を使うことにしていますが、Herculesエミュレータでは「shadow file」 を利用すると、1つのDASDに複数の物理ファイルを持つことができますので、それを考慮しています。

  Tur(n)key DASD location definition:


   1.   Use DASD images from CD-ROM
        (Somewhat slower, requires up to 60 MB disk space)

   2.   Copy DASD images to local hard disk (default)
        (faster, but requires up to 500 MB disk space)

   3.   Copy DASD images to local hard disk and use shadow files
        (Same as above.  Shadow files allow easier fallback)


Your choice  ===> 3

4.6. どのDASDをインストールするか選択します。

MVSのソースもとりあえずインストールします。

  Tur(n)key DASD image selection:


Do you want to copy the MVS Source volumes from the CDROM
This will take about 143 MB disk space

===> [ N ] Y


Do you want to copy the SMP volumes from the CDROM
This will take about 42 MB disk space

===> [ Y ]


Do you want to copy the CBT volumes from the CDROM
This will take about  175 MB disk space

===> [ Y ]


Do you want to copy the Starter System volumes from the CDROM
This will take about 11 MB disk space
The starter system can be used as an emergency recovery system

===> [ Y ]

4.7. 3270端末エミュレータのポートを指定します。

3270端末エミュレータ、telnet接続時のポートを指定します。



  Console Port (CNSLPORT) Definition:


Please enter the portnumber that Hercules should listen at
for incoming telnet and/or tn3270 connections for its builtin telnet server

===> [ 3270 ]

4.8. ソケットデバイスのポートを指定します。

HerculesエミュレータにCentOSユーザからJCLを流し込んでSUBMITする時に使うソケットデバイスが監視するポート番号を指定します。

  Socket Reader Device Port Definition:


Please enter the portnumber that Hercules should listen at
for incoming data for the socket device card reader

===> [ 3505 ]

4.9. HerculesエミュレータのHTTPサーバポートを指定します。

HercleエミュレータのコンソールとしてHTTPサーバを持っていて、そのポートを指定します。
例えば、http://localhost:8081にアクセスすると、Hercleエミュレータのコンソールが表示されます。
ここから、エミュレータのスタートやストップができます。

  Web server port (HTTPPORT) Definition:


Please enter the portnumber that Hercules should listen at
for incoming http requests to its builtin web server

===> [ 8081 ]

4.10. ホスト名を指定します。

  Hostname installation definition:


Your machine's name is localhost.localdomain. Select the name you want to use when connecting to the Hercules machine from the network

1. localhost.localdomain (default)
2. localhost

===> [ 1 ]

4.11. ここまでに指定したインストールオプションを確認します。

  Installation options:


CPU Type is: i686
Source path: /home/hercules/tkmvs3
Target path: /home/hercules/mvs38j
Type of installation: turnkey (standard setup, prompt-mode)
Location of Tur(n)key DASD images: HDSHADOW
Telnet console port: 3270
Web server port: 8081
Socket device port: 3505
Host name for connections: localhost.localdomain
DASD space - required: 422 MB, available: (at least) 4312 MB


Continue with Installation ?

===> [ Y ]

4.12. インストール中...

Building ./log directory
  Installing Tur(n)key MVS 3.8J files:


Building ./conf directory
Building ./standalone directory
Building ./jcl directory
省略
Building ./shadow directory
Building ./prt directory
Building ./pch directory
Building ./tapes directory

Press the ENTER key to continue

4.13. 3270マスターコンソールをいくつにするか指定します。

一つで充分ですよ。

  Tur(n)key 3270 Master Console setup:


   How many 3277 master consoles do you want for the Tur(n)key system?
   The value must be greater or equal 0
                    and less or equal 2
   Just press the ENTER key for the default

===> [ 2 ] 1

4.14. 3215マスターコンソールをいくつにするか指定します。

一つで充分ですよ。

  Tur(n)key 3215 Master Console setup:


   How many 3215 master consoles do you want for the Tur(n)key system?
   The value must be greater or equal 0
                    and less or equal 2
   Just press the ENTER key for the default

===> [ 1 ]

4.15. 3270端末エミュレータをいくつにするか指定します。

マスターコンソール以外の3270端末エミュレータをいくつ接続するか指定します。
MAXの32個指定します。

  Tur(n)key 3270 Terminal sessions setup:


   How many 3270 Terminal Sessions do you want for the Tur(n)key system?
   The value must be greater or equal 1
                    and less or equal 32
   Just press the ENTER key for the default

===> [ 3 ] 32

4.16. ソケットリーダーデバイスをセットアップします。

HerculesエミュレータにCentOSユーザからJCLを流し込んでSUBMITする時に使うソケットデバイスをセットアップします。

  Tur(n)key Socket Reader Device setup:


   Do you want to utilize the Socket reader device?
   Just press the ENTER key for the default

===> [ Y ]

4.17. ここまでのセットアップオプションを確認します。

  Terminal Setup Options:


   Name of configuration file: conf/turnkey_mvs.conf
   Number of 3277 Master Consoles: 1
   Number of 3215 Master Consoles: 1
   Number of 3270 Terminal Sessions: 32
   Socket device will be used on reader 000C

Press the ENTER key to continue

4.18. マスターカタログのパスワードを指定します。

「SECRET」を入力し、「Enter」を入力します。

+=============================================================================+
|                                                                             |
|                        Important Message                                    |
|                        =================                                    |
|                                                                             |
| The master catalog is password protected.  The password is                  |
|                                                                             |
|                                   SECRET                                    |
|                                                                             |
| You can change the password any time by running the job MVS0390             |
| from either the JCL subdirectory or from dataset SYS1.SETUP.CNTL(MVS0390)   |
|                                                                             |
+=============================================================================+

Please enter the catalog password now ===> SECRET

4.19. MVS/380のインストールが終わりました。

+=============================================================================+
|                                                                             |
|                   Installation is now complete                              |
|                   ============================                              |
|                                                                             |
|                                                                             |
|  You can now change to the installation directory and start MVS 3.8         |
|  by entering                                                                |
|                                                                             |
|          startmvs                                                           |
|                                                                             |
|  If you use a graphical interface to Linux, like KDE or Gnome,              |
|  you can start hercules and the required terminal sessions using            |
|                                                                             |
|          xstartmvs                                                          |
|                                                                             |
|  or                                                                         |
|                                                                             |
|          kstartmvs                                                          |
|                                                                             |
|  instead                                                                    |
|                                                                             |
|                                                                             |
|                     Enjoy your private mainframe                            |
|                                                                             |
+=============================================================================+

Press the ENTER key to continue

4.20. MVS/380起動スクリプトをカスタマイズします。

[hercules@localhost ~]$ pwd
/home/hercules
[hercules@localhost ~]$ cp -p ./mvs38j/startmvs ./
[hercules@localhost ~]$ vi startmvs
#!/bin/bash
clear
echo "Do not IPL until you have started all the clients"
echo "needed to successfully start MVS:"
echo "  a)  A standard telnet client to this host on port 3270"
echo "  b)  Two tn3270 clients to this host on port 3270 as consoles"
echo "  c)  Additional tn3270 clients as TSO terminals"
echo "  "
echo "  press the ENTER key to continue hercules startup"
read dummy
/usr/local/hercules/3.12/bin/hercules -f ./mvs38j/conf/turnkey_mvs.conf

5. メインフレームOSの起動

HOW TO .... documentに従って、MVS/380Jを起動します。

5.1. MVS/380Jを起動

IPL する前に3270端末エミュレータで接続すること。

[hercules@localhost ~]$ ./startmvs
Do not IPL until you have started all the clients
needed to successfully start MVS:
  a)  A standard telnet client to this host on port 3270
  b)  Two tn3270 clients to this host on port 3270 as consoles
  c)  Additional tn3270 clients as TSO terminals

  press the ENTER key to continue hercules startup

「Enter」キーを入力するとHerculeエミュレータ画面が起動します。

HHCTT002I Timer thread started: tid=B5EF9B70, pid=15690, priority=0
HHCCP002I CPU0000 thread started: tid=B5FFAB70, pid=15690, priority=15
HHCCP003I CPU0000 architecture mode S/370
HHCPN001I Control panel thread started: tid=B777D6D0, pid=15690
HHCAO001I Hercules Automatic Operator thread started;
          tid=B5B67B70, pri=0, pid=15690
HHCTE009I Client 127.0.0.1 connected to 3270 device 0:0010
Command ==>
CPU0000 PSW=0000000000000000 24M.......                              instcount=0

5.2. マスタコンソール3270端末エミュレータを起動

もう一つTeraTermからsshで接続します。ここで、つぎのコマンドで接続します。

[hercules@localhost ~]$ c3270 -charset us-intl -model 3278-2 -keymap c3270.keymap localhost:3270

すると、次のような画面になります。

 Hercules Version  : 3.12
 Host name         : localhost.localdoma
 Host OS           : Linux-2.6.32-573.26.1.el6 #1 SMP Tue May 3 21:55:43 UTC 201
 Host Architecture : i686
 Processors        : UP
 Chanl Subsys      : 0
 Device number     : 0010
 Subchannel        : 0027

            HHH          HHH   The S/370, ESA/390 and z/Architecture
            HHH          HHH                 Emulator
            HHH          HHH
            HHH          HHH  EEEE RRR   CCC U  U L    EEEE  SSS
            HHHHHHHHHHHHHHHH  E    R  R C    U  U L    E    S
            HHHHHHHHHHHHHHHH  EEE  RRR  C    U  U L    EEE   SS
            HHHHHHHHHHHHHHHH  E    R R  C    U  U L    E       S
            HHH          HHH  EEEE R  R  CCC  UU  LLLL EEEE SSS
            HHH          HHH
            HHH          HHH
            HHH          HHH     My PC thinks it's a MAINFRAME

            Copyright (C) 1999-2010 Roger Bowler, Jan Jaeger, and others

5.3. 一般ユーザのVTAM3270端末エミュレータを起動。

もう一つTeraTermからsshで接続し、次のコマンドを入力すると、[5.2. マスタコンソール3270端末エミュレータを起動]と同じ様な画面が表示されます。

[hercules@localhost ~]$ c3270 -charset us-intl -model 3279-2-keymap c3270.keymap localhost:3270

5.4. IPLを起動します。

Herculesエミュレータ画面のコマンドラインで「IPL 148」と入力し「Enter」キーを入力します。

Command ==> IPL 148

すると、次のような画面になります。

IPL 148
Command ==>
CPU0000 PSW=070E000000000000 24..W.....                        instcount=810,865

ここで、「5.2.」で起動したマスタコンソールを開いてみます。

  | IEA101A SPECIFY SYSTEM PARAMETERS FOR RELEASE 03.8 .VS2

と表示が変わっています。

5.5. Create LPAを指示します。

22行3桁目でカーソルが点滅していますので、ここで、「R 00,CLPA」と入力し、「Enter」キーを入力します。

  R 00,CLPA

次のようなエラーメッセージが表示されます。これは初回起動であるためで、チェックポイントが初期化されていないからです。
「R 00,Y」と入力し、「Enter」キーを入力します。
ちなみに、「00」は、行の先頭の「*00」の行に対応していて、システムからの「00」の要求に対して、「Y」と応答していることになります。

      IEE360I SMF NOW RECORDING ON SYS1.MANX ON MVSRES TIME=10.35.14
     *IEA000A 009,INT REQ,09,0200,4000,,,*MASTER*
      IGF992I  MIH INIT COMPLETE, PRI=000300, SEC=000015
      IEF677I WARNING MESSAGE(S) FOR JOB JES2     ISSUED
     *00 $HASP479 UNABLE TO OBTAIN CKPT DATA SET LOCK - IO ERROR           -
     * REPLY Y OR N TO CONTINUE
  R 00,Y
    - R 00 SUPPRESSED
      IEE600I REPLY TO 00 IS;SUPPRESSED
    - $HASP434 WARM START DENIED -- INVALID CHECKPOINT RECORD
    - $HASP428 CORRECT THE ABOVE PROBLEMS AND RESTART JES2
    - $HASP489 INITIALIZATION MAY NOT HAVE RELEASED CKPT DATA SET LOCK
    - $HASP085 JES2 TERMINATION COMPLETE

となり、JES2(Job Entry Subsystem 2)を起動できるようになります。

5.6. JES2を起動します。

Job Entry Subsystem 2/3は、IBMのメインフレーム用オペレーティングシステムの MVS系(OS/360、MVS、OS/390、z/OS)が使用する、ジョブの受け取り、スケジューリング、処理結果の出力を行うサブシステムです。これが動いていないと、始まらないので、「S JES2」と入力し、「Enter」キーを入力します。

  S JES2

すると、JES2起動オプションを要求してきます。

   - S JES2
      IEF677I WARNING MESSAGE(S) FOR JOB JES2     ISSUED
     *01 $HASP426 SPECIFY OPTIONS - HASP-II, VERSION JES2 4.1

「R 01,FORMAT,NOREQ」と入力し、「Enter」キーを入力します。この例では要求番号は「*01」。

  R 01,FORMAT,NOREQ

すると、チェックポイント要求がありますので、

    - R 01 SUPPRESSED
      IEE600I REPLY TO 01 IS;SUPPRESSED
     *02 $HASP479 UNABLE TO OBTAIN CKPT DATA SET LOCK - IO ERROR           -
     * REPLY Y OR N TO CONTINUE

「R 02,Y」と入力し、「Enter」キーを入力します。次回JES2を動かすときには要求されません。

  R 02,Y

画面スクロールが自動的に行われていないので、ファンクションキーのF11を押して、自動的にスクロールするようにします。
すると、チェックポイント要求がありますので、

  00- R 02 SUPPRESSED
      IEE600I REPLY TO 02 IS;SUPPRESSED
     *03 $HASP436 REPLY Y OR N TO CONFIRM CHECKPOINT RECORD CHANGE

「R 03,Y」と入力し、「Enter」キーを入力します。次回JES2を動かすときには要求されません。

  R 03,Y

ちょっと時間がかかりまして、次のメッセージになったら、JES2も起動しています。

    - STC   25  BSPSP93I - PFK definitions will be updated in memory
    - STC   25  BSPSP22I - Dataset processed: SYS1.PARMLIB
    - STC   25  BSPSP23I - on volume MVSRES
    - STC   25  BSPSP21I - Member being processed: SETPFK01
    - STC   25  +BSPSP98I - Member processed, LASTCC=0000
    - STC   25  +BSPSP21I - Member being processed: SETPFK02
    - STC   25  +BSPSP98I - Member processed, LASTCC=0000
    - STC   25  +BSPSP99I - End of processing, MAXRC=0000
    - STC   25  IEF404I BSPSETPF - ENDED - TIME=12.17.56
    - STC   25  $HASP395 BSPSETPF ENDED

5.7. 一般ユーザのVTAM3270端末エミュレータ側でTSOにログオンします。

「5.3.」で起動した一般ユーザのVTAM3270端末エミュレータ側を見ますと、次のような画面になっていますので、

           Welcome to MVS3.8J, running under the Hercules emulator



 TTTTTTTT   UU    UU   RRRRRRR    NN     NN   KK   KK    EEEEEEEE   YY    YY
    TT      UU    UU   RR    RR   NNN    NN   KK  KK     EE          YY  YY
    TT      UU    UU   RR    RR   NNNN   NN   KK KK      EE          YY YY
    TT      UU    UU   RRRRRRR    NN NN  NN   KKKK       EEEEEEE      YYY
    TT      UU    UU   RRRR       NN  NN NN   KK  KK     EE           YY
    TT      UU    UU   RR  RR     NN   NNNN   KK   KK    EE          YY
    TT      UU    UU   RR   RR    NN    NNN   KK    KK   EE         YY
    TT       UUUUUU    RR    RR   NN     NN   KK     KK  EEEEEEE   YY


                        \      _,,,---,,_                brought to you by
                ZZZzz /,`.-'`'    -.  ;-;;,              Volker Bandke
                      ,4-  ) )-,_. ,\ (  ''-'            vbandke@bsp-gmbh.com
                    '---''(_/--'  `-'\_)




 Logon ===>

ログオンプロンプトに「HERC01」と入力して、「Enter」を入力します。

 Logon ===> HERC01

すると、次のような画面になります。


                |l      _,,,---,,_
          ZZZzz /,:.-':'    -.  ;-;;,
               |,4-  ) )-,_. ,( (  :'-'
              '---''(_/--'  :-')_)

 Fudd's First Law of Opposition: Push something hard enough and
 it will fall over.

 Another bit of wisdom from the fortune cookie jar

 READY

RPFという対話型ユーティリティ画面を立ち上げます。
READYの下の行で「RPF」と入力し、「Enter」を入力します。

 READY
 RPF

すると、次のような画面になります。

------------------------------ RPF MAIN MENU -------------(C)-1979-2002 Skybird
 Option  ===>
                                                             Userid  - HERC02
    0  Defaults    - Alter / Display session defaults        Time    - 12:55:55
    1  View        - Display source data or output listings  System  - BSP1
    2  Edit        - Update / Create a member or dataset
    3  Utility     - Enter UTILITY
    4  Assembler   - Foreground ASSEMBLY and/or LINK
    5  User        - Execute RPF user routine
    6  TSO         - Execute TSO commands
    7  Tutorial    - Display information on using RPF
    8  Test        - Enter TEST mode (Authorized)
    9  Operator    - Enter OPERATOR mode
    X  Exit        - Terminate RPF.

 Hit PF03/15 to terminate RPF.







                                        RPF V1R4M2+(C)-1979-2002 Skybird Systems

ファンクションキーF3を押します。
すると、次のような画面になります。

 USERID=HERC02 ,RPF START:  12:55:55,RPF END:  12:56:33
 READY

これでログオフできますので、READYの下に「LOGOFF」と入力し、「Enter」を入力します。

USERID=HERC02 ,RPF START:  12:55:55,RPF END:  12:56:33
 READY
LOGOFF

すると、ログオンプロンプト画面に戻ります。

 Logon ===>

この状態になったら、Ctrlキー+]キーを入力します(3270端末エミュレータのEscapeアクションです)。
すると、次のような画面になりますので、「c3270>」プロンプトが表示されますので、「exit」と入力して、「Enter」キーを入力します。

Logon ===>






4A                                                                      023/013
Press <Enter> to resume session.
c3270>

すると、bashプロンプトに戻ります。

Press <Enter> to resume session.
c3270> exit
[hercules@localhost ~]$

6. メインフレームOSの停止

HOW TO ... Shutdown MVSに従います。

6.1. マスターコンソールからMVS/380Jを止めます。

用意されているコマンドは次の通りです。

f bsppilot,shutdown
f bsppilot,shutfast
f bsppilot,shutnow

誰もログオンしていない、仕掛中のジョブも無いので、「f bsppilot,shutnow」で終わります。

  00- TSU    3  IEF126I HERC02 - LOGGED OFF - TIME=13.05.46
    - TSU    3  $HASP395 HERC02   ENDED

  IEE152I     ENTER     CANCEL     D C,K
  f bsppilot,shutnow

  IEE163I MODE= RD

すると、TSOが止まり、VTAMが止まり次のような画面になります。

                IST804I  VTAM CLOSE IN PROCESS FOR TSO0001  OPENED BY UNKNOWN
       UNKNOWN
      STC   28  IST400I  TERMINATION IN PROGRESS FOR APPLID TSO0001
      STC   28  IST805I  VTAM CLOSE COMPLETE FOR TSO0001
  00  STC   28  IST105I  APPLTSO  NODE NOW INACTIVE
      STC   28  IST412I  VTAM COMMAND PROCESSING TERMINATED
      STC   28  IST102I  VTAM IS NOW INACTIVE
    - STC   28  IEF404I NET - ENDED - TIME=13.16.14
    - STC   28  $HASP395 NET      ENDED


  IEE152I     ENTER     CANCEL     D C,K


  IEE163I MODE= RD

次に、JES2を止めます。「$PJES2」と入力し、「Enter」を入力します。

  IEE152I ENTER CANCEL D C,K
    $PJES2

  IEE163I MODE= RD

しばらくすると、次のような表示がされますので、これでJES2が止まりました。
bash:
00- $HASP085 JES2 TERMINATION COMPLETE
- IEF404I JES2 - ENDED - TIME=13.22.42

6.2. Herculesエミュレータを止めます。

Herculesエミュレータ画面のコマンドプロンプトに「STOP」と入力し、「Enter」を入力します。

Command ==> STOP
CPU0000 PSW=070E000000000000 24..W.....                    instcount=314,372,520

すると、CPUのカウンタが止まりますので、「QUIT」と入力し、「Enter」を入力します。

Command ==> QUIT
CPU0000 PSW=070E000000000000 24M.W.....                    instcount=314,727,440

すると、bashプロンプトに戻り、これでHerclesエミュレータが止まりました。

HHCIN099I Hercules terminated
HHCHD900I Begin shutdown sequence
HHCHD909I Shutdown sequence complete
[hercules@localhost ~]$

TSOのデフォルトユーザ

http://www.bsp-gmbh.com/turnkey/cookbook/genmvs.html
herc01 - SYSPROG userid, no password
herc02 - SYSPROG userid, password: CUL8TR
herc03 - standard userid, no password
herc04 - standard userid, password: PASS4U

54
50
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
54
50