Hello, dear Khabarchans!
Almost a week ago, I wrote
my first post about VM / 370. The first comment to him was a
perfectly fair remark :
Fun, of course, but the "canvas" consists mainly of the findings of commands. To be honest, it is much more interesting to read not only about the installation of the system itself, but also about its “guts”, like, what, and why.
Investigate the source code of VM / 370, for example.
Yes, indeed, the installation tutorial, to put it mildly, an outdated OS, is interesting only in general cognitive terms as a demonstration of its capabilities. But the description of the principles of working with quotes from source is another matter. Moreover, the source code is available. The only problem is that such a description is a serious matter.
VM / 370 operating principles are described in
this three-volume edition . The source code itself is relatively small, “only” two hundred thousand lines in assembler — CP and about the same number — CMS. But the work is still to be capital.
In this article, I don’t set myself the task of even starting a cycle on VM / 370 internals. I’ll just explain how I extracted the VM / 370 source code in a readable format. In the process of extracting, I learned something interesting about working with VM / 370.
Unpacking the tape in the CMS
The volume of the tape source is about thirty megabytes. Being absolutely sure that the files are stored on tape in uncompressed form, I simply divided this volume by the capacity of the cylinder 3330 and calculated that I would need 130 cylinders to save all the sources. Then it certainly turned out to be wrong (apparently, some kind of compression does occur, the size of the printouts is about 40 megabytes), but fortunately the tape consisted of several volumes, and I just printed them one by one.
So, add to the directory, in the description of the user MAINT, the line:
MDISK 192 3330 200 130 CPR6L0 WR READ * SOURCES
Note: I did the whole process under the user maint. Generally speaking, this is a malicious violation of the “do not work under the root” rule and cannot be done this way.
Let's start VM, we will log in as MAINT, we will launch CMS. We introduce punch cards with the catalog description and update it with the “DIRECT MYVM” command. Log in (for account changes to take effect). We connect the disk 192 (using the “access 192 b” command) and the source tape. Load the first archive volume (CP source) with the command “VMFPLC2 LOAD * * B”.
Printout
For a long time I could not find a way to print several files with one command. The fact is that the PRINT and PUNCH commands swear at asterisks in the file name. And I did not want to print five hundred pieces of files manually. In the end, I decided that it would be easiest to write a printout program in assembler, but rummaging through the assembler manuals found an easier way.
The LISTFILE command (an analogue of DIR / ls) has an option (EXEC. If you run LISTFILE with this option, LISTFILE will create a file (EXEC files are analogous to bat / sh), with lines like & 1 & 2. & 1 & 2 are the script parameters.
Now attention! When you run the CMS PUNCH command, in each line of the CMS EXEC file, instead of & 1, PUNCH will be substituted and then the line will be executed. In my opinion, this is the best solution for IBM’s user interface engineers (albeit unnecessary on Linux with awk).
I experimented with various printouts and decided that PUNCH is better than PRINT.
Note: Hercules punch card output is set to EBCDIC format. To get a readable code, you need to reconfigure it to ASCII with the command "ATTACH D ./sources/DMK.txt ascii".
So, create a list of files:
L * * B (EXEC
And we derive them:
CMS PUNCH ... .
Already when it was all over, I realized that it made sense to add the first line & CONTROL OFF (analog echo off) to the CMS EXEC. Yes, I didn't catch VM / 370, but even elementary MS-DOS.
')
File sharing
As a result of previous manipulations, I received a DMK.txt file with the sources glued together. Now they need to be separated. To do this, I applied this awk script:
/^MAINT MAINT MAINT MMMM AAAA IIII NNNN TTTT$/ {next} /^USERID/ {next} $1==":READ"{ MYFILE="./DMK/"$2 "_" $3 next } { print $0 > MYFILE }
I apologize for the g-code, it was written on the knee and not for the purpose of readability / efficiency.
Now, in the same way, you can display the source code of CMS (conditional DMS code), RSCS (conditional DMT code, name Remote Spooling Communication Subsystem confuses a little, but this is in some sense an analogue of fido) and IPCS (conditional DMM code, system tests).
Links