IPL A80 and Away...
This is not an overview of the history of IBM mainframe systems. This is not a walk-through of installing Hercules and getting a copy of z/OS to run either. Anyone who wishes to emulate a mainframe running z/OS can follow one of the guides that are available on the web. I wanted to do a write-up of the things I learnt that were less (or possibly not) obvious to me from the resources I turned to when I started setting up my emulated mainframe system and finding my way around it.
First off, what are those files from which Hercules loads the operating system? DASD (direct-access storage device) seems to be IBM's own diction for a number of different storage devices. CKD (count key data) refers to the way in which data is organized on DASDs (the details of which are not really important for now). The Hercules emulator introduced the CCKD (compressed CKD) format. CCKD files are essentially images of DAS devices compressed with zlib or bzip2. These contain the z/OS that would be loaded from physical devices by the physical mainframe.
Something that differs a bit from more commonplace emulation (of, say, a video game console) is that apart from the actual z/Architecture machine you will be emulating a terminal that connects to it, and this is where most interaction between the user and the emulated system will happen. For consider the situation in 3-d space—there is the mainframe which is running headless, and at any time, a number of terminals may be engaging in a session with it. The terminal we are looking at is in the IBM 3270 class, for which a Curses-based (c3270) and an X11-based (x3270) emulator exist.
After 3270-ing into the mainframe, we want to boot z/OS. This is triggered by issuing an initial program load (IPL) at the Hercules prompt. The parameter to the ipl command is a control unit address which, according to IBM's Glossary of z/OS terms and abbreviations, comprises of '[t]he high order bits of the storage control address, used to identify the storage control to the host system.' So how do we know what unit address to use? The conf-file used with Hercules assigns unit addresses to CCKD images on the host file system. The IPL needs to be using the first system residence (SYSRES) volume, which basically is the system's boot disk. Hence, if according to the conf-file that volume is located at A80, the command entered to boot z/OS would be:
Thence the rumbling starts. The terminal window displays messages without end, and after a while, it should be possible to open a second terminal session to finally get to a login prompt. Having two sessions run in parallel is necessary, because the first one seems to be reserved for displaying system messages. What we want to do now is to get on the TSO. TSO stands for time-sharing option and is something like the mainframe's shell. If the ISPF—the Interactive System Productivity Facility, a menu of z/OS functionality—is not started automatically after loggin into the TSO, it may be started by issuing 'ispf'.
After that, you are on. What I have always wanted to do was write some COBOL and compile and execute it, especially considering COBOL-on-mainframes is still what runs a significant portion of the world's financial information systems. Sounds simple enough, one would think, but on a system as alien as z/OS even such straightforward an endeavour might set you back days, if you are figuring out things on your own. Luckily for me, Marianne Bellotti is spoonfeeding the entire process from allocating a data set with all the right obscure parameters—the equivalent of creating a new text file in which to put the COBOL code—up to compiling, linking and finally running the lame old Hello, world! program.
It might just be that I am put off by the felt clunkiness of working with the TSO, but for now, my curiosity regarding the mainframe seems to have been curbed. One area that I would still like to explore though, so far as time and my main project allow it, is finding and interfacing with mainframes that are routable on the internet. As other people have reported before, and as is the case with countless devices around the world, mainframes are sometimes obliviously left publicly routable. Needless to say that there lies a potential source of hours of fun and exploration.