TSS/360: Getting data out

On a real IBM TSS/360 system, you'd be able to get data in and out of the system using punched cards, the printer or magnetic tapes. On an emulated system you can use these facilities to exchange files with your host operating system.

I've got this working for printer and punched card output but have not been able to do so for input from cards or tape.

Bulk I/O

In order to do this, you will need to enable bulk I/O, which provides facilities in TSS/360 to manage output to I/O devices. Follow the procedure given in the quick tour until you are asked the question BULKIO REQUIRED? and this time answer Y.

Startup will continue, and you will soon be prompted with:

MOUNT CARRIAGE TAPE SAME
MOUNT CHAIN/TRAIN 'PN'
SET DENSITY 6
THEN NR/R

This is a request to the operator to set up the printer with the correct carriage control tape (to control how special print codes are interpreted), chain (the metal chain containing the character set), density (vertical line spacing) and then press the Normal Ready/Ready button. We don't need to do all that on an emulated system, but you do need to signal that the printer is ready by going to the Hercules console and typing i e which sends an interrupt to device 000E, which is the device configured to be the printer.

The system will respond (in the operator console) VERIFY THAT THE FOLLOWING 20-CHARACTER MESSAGE APPEARS ... *** BUFFER LOADED ABOVE If you now go to the file on your host system where the printer places output - which is units/printer.txt in the quick tour - you will see the file contains a test print of the characters of the alphabet followed by BUFFER LOADED ABOVE.

Managing the execution queue

There's one more thing you will need to do to get bulk I/O jobs flowing. Look at your batch execution queue on the operator console by typing exhibit bwq. If you have run the system a few times it may look like this:

exhibit bwq
                  BATCH WORK QUEUE STATUS AT 09:51:52     01/07/27
BSN  USERID   TID TYPE STAT DEV STAID    DSNAME
0329 SYSOPER0 2   LIST A    UR           SYSLOG.G0043V00
0330 SYSOPER0 1   LIST P    UR           SYSLOG.G0044V00
0331 SYSOPER0 1   LIST P    UR           SYSLOG.G0045V00

What is happening here is that each time the system boots it tries to print out the system log, but if bulk I/O was not enabled before, they are all queued up. You have two options here. First, you can put the printer online by going to the Hercules console and typing i e. The operator console will show messages like BSN=0329 COMPLETE as it works its way through the jobs, and if you look at units/printer.txt on your host you can see the contents.

Alternatively, you can remove the jobs from the queue by using the CANCEL command on the operator console. This takes a single batch sequence number at a time, which you can find from the first column of the exhibit bwq output.

cancel 329
TSS370
10:03:19        SYSOPER0 *CZAWY*   BSN=0329 CANCELED ON 020E,

In either case, once exhibit bwq shows empty, you are good to continue.

exhibit bwq
NO ENTRIES OF TYPE REQUESTED FOUND

Printing data sets

To print a file from either the operator or a user account, simply type PRINT and the data set name. This works for sequential and indexed files. It will create a background task and respond with the batch sequence number, for example:

print source.hworld
 PRINT BSN=0335

Use the techniques described above to manage the queue: ie you will need to switch to the Hercules console and type i e to put the printer online. When it is done you will see a message like BSN=0335 COMPLETE on the operator console and if you look at the file units/printer.txt on your host system you will see the output, preceded by a page giving the job details that looks like the below. On a real system, this would allow the operations staff to separate the pages for each job and deliver them to the right person easily.

/images/tss/tss-printer-banner.png TSS/360 print job banner. Source: Rupert Lane. License: CC0.

Punching data sets

Using the card punch you can extract an exact copy of a data set from the emulated system to your host. Use the PUNCH command with the data set name.

punch source.hworld
 PUNCH BSN=0339

On the operator console you will see the following, which is asking you to put blank punched cards in the machine to complete the job (this may take a few seconds to appear).

exhibit bwq
                  BATCH WORK QUEUE STATUS AT 02:53:59     01/20/27
BSN  USERID   TID TYPE STAT DEV STAID    DSNAME
0339 RUPERT** 13  PUN  P    UR           SOURCE.HWORLD
02:54:07        SYSOPER0 *CZAWU*   BSN=0339 STARTED  ON 020D, RUPERT**.SOURCE.HWORLD
02:54:07 ->->-> SYSOPER0 CZCMD   001I  MOUNT FORM CARDS      ON PNCH 020D,NR/R PNCH

To satisfy this, switch to the Hercules console and send an interrupt to the card punch by typing i d. A few seconds later the operator console will say REMOVE OUTPUT FROM PNCH. On the Hercules console, type i d again to acknowledge that, and if you look in the file units/punch.txt on your host system you will see the output:

IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
///// USERID=RUPERT**, BSN=0339, DSNAME=SOURCE.HWORLD
0000100         DO 1 J=1,5
0000200 1       WRITE(6, 2)
0000300 2       FORMAT(' HELLO, WORLD!')
0000400         STOP
0000500         END
///// BSN=0339, COMPLETE, 0000005,RUPERT**.SOURCE.HWORLD

The IIIII and ///// lines are there to separate decks easily in a real system.

Reading cards to a data set (not yet working)

Going the other direction - uploading data from your host machine to TSS/360 using the punched card reader - works differently, as instead of uploading a file you use the card reader to submit a non-conversational batch job. On your host you create a file such as the below, containing a LOGON card, TSS/360 commands to create a file with EDIT and then a LOGOFF card. According to the documentation both the LOGON and LOGOFF cards should start on column 3.

  LOGON RUPERT
EDIT SOURCE.GWORLD
        DO 1 J=1,5
1       WRITE(6, 2)
2       FORMAT(' GOODBYE, WORLD!')
        STOP
        END
_END
  LOGOFF

Then in the Hercules console enter the below, replacing units/reader.txt with the file you want to upload.

devinit c units/reader.txt

The operator console will respond with the below:

04:06:12 ->->-> SYSOPER0 CZCMG   002A RDR  020C. INTERVENTION REQUIRED. NR/R.

which seems to show that the OS sees the incoming card data but cannot process it. I get this error on both Hercules and simh. This could indicate a problem with the card format or with the emulator setup. If you find a solution do let me know.

Questions, corrections, comments

I welcome any questions or comments, and also especially any corrections if I have got something wrong. Please email me at rupert@timereshared.com and I will add it here and update the main text.


TSS/360: User types

As you'd expect from IBM, security was an important part of the design of TSS/360, and rather than the simple super-user/normal user distinction we've seen on other operating systems, they separated users into different classes. In this post we'll look at each class in more detail.

The user hierarchy

/images/tss/tss-user-hierarchy.png TSS User hierarchy. Source: TSS System Managers and Administrators Guide on Bitsavers

At the root of the system is the System Manager, who can create and remove all other accounts on the system. The Operator is responsible for actions needed to keep the machine running, such as system start up and shutdown, and dealing with physical devices like tapes. Both these accounts are set up when the system is first generated.

System Administrators are created by the System Manager and control account creation for a subset of users, such as a department.

Regular users have limited access to system management or operations commands - for example, they can show the batch queue, but only for jobs they submitted. A special bit can be set on a user to mark them as a system programmer, however, which allows them access to system debugging tools.

A final class, not shown on the diagram, is System Monitor users who can collect performance information about the system.

The system on the disks we are using has the following users set up.

Login Password Type
sysmangr ibm System Manager
sysoper0 Always logged in to console Operator
tss ibm User with System Programmer bit set

Creating a new user

You will probably want to set up your own user account rather than using one of the above IDs. As we don't have system administrators set up, we can do this directly by the system manager.

At the user console, logon as sysmangr password ibm

logon sysmangr,ibm
  TASKID=0013 LOGON AT 01:24 ON 01/01/27

Then use the JOIN command to add a new user. At a minimum you need to supply the user name, password, and charge account (here 0).

join userid=rupert,password=secret,charge=0

Additional parameters can be set: PRIV for the user type, here a regular user; AUTH for the system programmer bit, PRIORITY for an indication on how to schedule the user's tasks, from 0 to 9 with 0 being highest priority. See the manual linked below for more details.

Passwords can be 1-8 alphanumeric characters; lower case letters are mapped to upper case. A password of a quoted space PASSWORD=" " means no password will be set.

Once the user is set up, log off (using the technique to clear the logoff error shown in the quick start) and logon again under the new ID.

The other commands specific to the system manager and administrators are REJOIN to adjust parameters for an existing user ID, and QUIT to remove an ID. As far as I can tell there is no way to list the users with defined accounts on the system.

The operator

The operator has a number of commands to show the state of the system. SARD - System Activity and Resource Detail - shows an overview of the system.

sard
                  SYSTEM ACTIVITY AND RESOURCES AT  01/01/27  02:04:32
                                                      REPLYS:     0
USERS - CONV:    2  BACK:    1  REM :    0  RJEA:    2
QUEUES- EXEC:    0  PRNT:    0  PNCH:    0  TAPE:    0  RJE :    0
AVAIL - PTRS:    1  RDRS:    1  PUNS:    1  TAPS:   48  DISK:  150
PAGES - PUB :    18206 TEM :        0 AUXDR :       0   AUXDK : 22426

EXHIBIT UID can be used to show who is logged on and EXHIBIT BWQ shows the batch queue, including any print/punch jobs pending.

exhibit uid
ACTIVE USER STATUS AT 02:03:55     01/01/27
USERID    TID TYPE SYSI
SYSOPER0    1 CONV  209 SYSOPER0    2 BACK    0 RUPERT**   16 CONV  21F
exhibit bwq
NO ENTRIES OF TYPE REQUESTED FOUND

Operators can stop jobs - with FORCE for logged in conversational users and CANCEL for batch jobs.

They can also send messages to users. BCST will send a message to all:

bcst The system will shut down for maintenance in 10 minutes

On a logged in user's terminal, the next time you press Enter you will see the message.

THE SYSTEM WILL SHUT DOWN FOR MAINTENANCE IN 10 MINUTES 01/01/27 02:18 HOURS

A message can be sent to a single user with MSG

msg rupert,your tape is ready

Unfortunately normal users can't send messages back, or to each other. No fun there.

msg sysoper0,will be right there
 CANCELLED: MSG  COMMAND NOT AVAILABLE TO YOUR PRIVILEGE CLASS

The operator is also involved in bulk I/O tasks such as printing and punching; we'll look at that in a later post.

Command summary

This is a summary of the key system manager and operator commands; some which are not useful on emulation, such as RJE handling, have been omitted; see the manuals for details.

System manager or admin

Command Meaning
JOIN Add user to system
REJOIN Change user attributes
QUIT Remove user from system

Operator

Command Meaning
BCST Sends a message to all active conversational users
CANCEL Terminates a batch task
EXHIBIT BWQ Shows the batch queue
EXHIBIT UID Shows currently active users
FLOW Summary of system usage
FORCE Terminate a conversational task
MSG Sends a message to a user
REPLY Reply to system messages
SARD Show information about the system
SHUTDOWN Shut the system down

Further reading

On Bitsavers, see the Time Sharing System Managers and Administrators Guide for details on user management and the Time Sharing System Operators Guide for details on operations tasks.

Questions, corrections, comments

I welcome any questions or comments, and also especially any corrections if I have got something wrong. Please email me at rupert@timereshared.com and I will add it here and update the main text.


TSS/360: Data sets

As we saw in the quick tour, how IBM TSS/360 handles files is quite different from both the operating systems we've seen before and the systems we use today. Let's look at this in more detail.

/images/tss/tss-catalog.png The TSS catalog. Source: TSS System Concepts and Facilities Guide on Bitsavers

Data set names and the catalog

Instead of files, on TSS/360 we think about data sets, which are named collections of related records.

Data sets are collected into catalogs: the top level catalog contains one catalog for each user. Logged in as user TSS, you can see your catalog by typing PC? for print catalog:

pc?
DATA SETS IN CATALOG WITH QUALIFIER TSS*****
TSS*****.EREPOUT,   ACCESS: RO
TSS*****.SYSERP.G0004V00,   ACCESS: RW
TSS*****.GENMAC.G0005V00,   ACCESS: RW
...
TSS*****.SOURCE.HWORLD,   ACCESS: RW

A fully qualified data set name is a series of one or more names (called qualifiers) separated by dots. The first level is the user ID, so for our hello world program SOURCE.HWORLD under the user account TSS the fully qualified data set name would be TSS.SOURCE.HWORLD. You omit the user ID when dealing with your own data sets. Fully qualified data set names can be up to 35 characters long.

Partially qualified data set names represent a group of data sets, which acts somewhat like a directory on Unix. For example, the TSS user has two data set,s SOURCE.HWORLD and SOURCE.SYSGEN, doing PC? SOURCE will expand the partially qualified name and show both data sets.

pc? source
DATA SETS IN CATALOG WITH QUALIFIER TSS*****.SOURCE
TSS*****.SOURCE.SYSGEN,   ACCESS: RW
TSS*****.SOURCE.HWORLD,   ACCESS: RW

There's no concept of wildcards on TSS/360.

Data set types

On operating systems like Unix, files are a collection of bytes and it's up to each program how to interpret them. But TSS/360 has several built-in types.

  • Sequential - an unordered collection of records, for example a list of numbers that are an input to a program.
  • Indexed - an ordered collection of records with a given key for each record. An example here, surprisingly, is a source code data set where each line is referenced by its line number.
  • Region - like indexed, but also splits the data set into a number of different sections referenced by a region name.
  • Partitioned - a group of several data sets from the above types contained in a single data set where each can be accessed separately. Similar to Unix libraries which are collections of object files with a header saying where to find them, but TSS/360 goes beyond this to collect all object code into a partitioned data set rather than it being a separate step.

You can find out what type a data set is with the DSS? command. Here we see SOURCE.HWORLD has the VI organisation, which means indexed.

dss? source.hworld

TSS*****.SOURCE.HWORLD
VOLUME: TSSRES (3330)
ORGANIZATION: VI             PAGES: 1
REFERENCED: 351/26           CHANGED: 350/26
RECORD FORMAT: V             RECORD LENGTH: 132
KEY LENGTH: 7                KEY POSITION: 4

The following codes are used:

Organisation Meaning
VS Sequential
VI Indexed or region
VP Partitioned

Symbolic data definitions

Symbolic data definitions map a logical data set name to a physical data set. For example, programs read input from SYSIN and write to SYSOUT. In interactive use these will be the keyboard and terminal; in batch mode this will be the card input and the printer. It's possible to manipulate these from the command line using the DDEF and RELEASE commands; we'll see an example of doing this when programming with Fortran in a later post.

Creating and editing data sets

As well as being manipulated by programs, you can create and modify your own data sets. EDIT can be used for indexed or region data sets. Plain sequential data sets use a completely different editor called DATA. We'll look at both of these in more detail in a later post.

Renaming, copying and deleting data sets

To rename a data set, use CATALOG with the U (update) and NEWNAME options. For example, to rename FOO to BAR:

catalog foo,u,newname=bar

The CDS command is used to copy data sets, for example to copy SOURCE.ABC to SOURCE.XYZ you would do:

cds source.abc,source.xyz

To remove a data set, use ERASE.

Partitioned data sets

As mentioned above, partitioned data sets are collections of data sets; you can see the contents of a partitioned data set with POD?. Here we see our HWORLD object module in our user library USERLIB.

pod? userlib
SYSPRD
SYSPRO
HWORLD
SYSFCL

Each member of a partitioned data set can be accessed by giving the member's name in parentheses, so USERLIB(HWORLD) points to our object data set.

Partitioned data sets can be constructed using the copy data set CDS command. Say we have two source data sets SOURCE.MOD1 and SOURCE.MOD2 we want to add to a new partitioned data set MYSRC:

cds source.mod1,mysrc(mod1)
cds source.mod2,mysrc(mod2)

Removing members is done by ERASE:

pod? mysrc
MOD1
MOD2

erase mysrc(mod1)
pod? mysrc
MOD2

Generation data groups

As we saw in the quick tour, data sets can be marked as generational to keep older versions around. You use CATALOG to define a data set and the number of versions - here I create a data set BAR with up to 5 versions.

catalog gno=5,gdg=bar

Rather than automatically saving a copy each time you make a change (like VMS), you need to assign it explicitly by taking an existing data set and using CATALOG to rename it as a new generation.

Here I create two versions of bar by editing the data set foo and using catalog to add a new generation by assigning to bar(+1).

edit foo
0000100 This is the first version
0000200 _end
catalog foo,u,,bar(+1)
edit foo
0000100 This is the second version
0000200 _end
catalog foo,u,,bar(+1)

We can then see the current version by accessing BAR(0) and the older version with BAR(-1) with the LINE? command, which types its contents.

line? bar(0)
0000100 THIS IS THE SECOND VERSION
line? bar(-1)
0000100 THIS IS THE FIRST VERSION

If we use, say, ERASE to delete BAR, this is seen as a partially qualified data set name (as there are two versions around) and we are prompted for each version.

erase bar
 ENTER E TO ERASE,R TO RETAIN,A TO ERASE ALL
 BAR.G0000V00
e
 BAR.G0001V00
e

Data set sharing

It's possible to share access to data sets with other users. This is a two step process: first the owner needs to mark the data set as available using PERMIT which takes the data set name, the user list (or *ALL for all users) and a sharing specification which can be RO or RW as expected, or U for unlimited (can erase or change permissions) or R to revoke previous access. Here we make our hello world source available to all users as read only:

permit source.hworld,*all,ro

The user who wants to access this then uses SHARE to create an entry in their catalog that points to the shared data set. If you switch over to the operator console and type

share hw,tss,source.hworld

you can now access it under the name HW. The DSS? command shows this connection:

dss? hw

SYSOPER0.HW
    SHARED ACCESS: RO      OWNER: TSS*****
VOLUME: TSSRES (3330)
ORGANIZATION: VI             PAGES: 1
...

To remove this link to the shared data set, you use DELETE. ERASE would not work as this would try to remove the underlying data set, and we were granted read-only access.

erase hw
 PROCEEDING: HW                                  NOT YOURS TO ERASE.
delete hw

Command summary

Here are the main commands used to manipulate data sets.

Command Meaning
CATALOG Tasks such as renaming or creating generational data sets
CDS Copy a data set
DDEF Define a data set for connection to a program
DDNAME? List DDNAMES for connections to a program
DELETE Remove logical catalog entry, eg a link to a shared data set
DSS? Print full details of data sets
ERASE Remove physical catalog entry for a data set
JOBLIBS Manipulates DDNAMES, eg to adjust which library to use
PC? Print catalog, ie a directory listing
PERMIT Grant access to a data set
POD? Display contents of a partitioned data set
RELEASE Remove previously set up DDEF connection
SHARE Get access to a data set made shareable by PERMIT

Further reading

On Bitsavers, IBM Time Sharing System Concepts and Facilities introduces the concepts behind data sets and IBM Time Sharing System Command System User's Guide describes each command in more detail.

Questions, corrections, comments

I welcome any questions or comments, and also especially any corrections if I have got something wrong. Please email me at rupert@timereshared.com and I will add it here and update the main text.


TSS/360: A quick tour using Hercules

This week I'll show how to get IBM TSS/360 up and running on the Hercules emulator. (Actually you'll be running the TSS/370 variant for the System/370). The code to do this in my Github repo: this is a wrapper around:

  • The Hercules emulator by Roger Bowler, Jan Jaeger and many others. We're using the SDL Hyperion flavour of Hercules, maintained by Fish, and the hercules-helper build system by Bill Lewis, but you can also use Hercules installed via your package manager.
  • The pre-built TSS/360 disk images from Jay Maynard's page.

This runs on a Unix like environment (Linux, BSD, MacOS) with a shell, git, C compilers, make and a telnet client already installed.

The repo contains a brief README which is expanded upon here to explain what is going on and to demonstrate use of TSS/360.

Start by cloning the repo and change into its directory

$ git clone https://github.com/timereshared/ibm-tss-360-hercules-quickstart.git
$ cd ibm-tss-360-hercules-quickstart

Getting Hercules

If you have Hercules version 4 (either Aethra or SDL) already installed on your system, you can skip this step.

Otherwise, type ./build-hercules.sh. If you are on MacOS add one of these two command line arguments depending on the package system you use

     --homebrew
     --macports

This will download hercules-helper, the Hercules source code and associated tools then build the system and install it under hercules/ in this repo. It takes 2-3 minutes on my system.

Create the operating system

Type ./build-tss.sh. This will download the disk images and copy them to the dasd/ directory.

Start TSS/360

Type ./run.sh. It will check that Hercules is available and then start the main Hercules console. The red line saying Hercules is not running in an elevated mode is expected.

Open two other windows and connect via telnet to port 1052 on your local machine, eg by typing telnet 0 1052. The first window will be the operator console and the second the user console. In the screenshot below you can see this with Hercules on the left, the operator console on the top right and the user console in the bottom right.

/images/tss/pre-ipl.png TSS/360 before IPL. Source: Rupert Lane. License: CC0.

These telnet sessions must be connected before doing the next step.

Now type ipl 250 in the Hercules console to IPL (initial program load, ie boot the system). Press Enter in the operator console and you will get a ? prompt.

Type ls (meaning long start) to start the loading process. Answer the questions as shown below (<Enter> means just type the Enter key at this point)

ENTER PHY ADDRESS OF CARD RDR OR DEFAULT = EOB.
<Enter>
ENTER ADDR OF PAGING DISK
251
PRINT MAPS? 0 1 2 3...NONE IVM RESSUP BOTH
3
ENTER CODE FOR FUNCTIONS NOT TO BE LOADED.ALL FUNCTIONS WANTED = EOB
99
QUICK START REQUESTED?  IF Y ENTER ADDR  OF PACK FOR QUICK START DATA SET--N = EOB
<Enter>
DELTA DATA SETS?  Y OR N
n

It will then ask you if the clock is correct

CURRENT CLOCK VALUE IS 12/10/26 05.16.13 IS CLOCK CORRECT?

I normally just accept this by typing y, but you can change it by typing n and then following the prompt.

Finally the initial start up has completed and you will get a $ prompt. Type run to start the system fully, entering n to the bulk I/O question for now, and typing reply 1,ok to the next question.

$ run
 BULKIO REQUIRED?
n
   N ACCEPTED
05:16:20        SYSOPER0 NO DRUM PATH AVAILABLE
05:16:20        TSS00001 BATCH MONITOR HAS BEEN INITIALIZED
05:16:20 R=0001 SYSOPER0 VALIDATE THE SYSTEM HARDWARE CONFIGURATION. REPLY OK WHEN DONE.
reply 1,ok

It will then print

TSS370
 STARTUP COMPLETE,USERS MAY LOGON

User logon

In the user console (the second telnet window), press Enter and type logon tss,ibm to log on as user tss with password ibm.

The screen will now look something like the screenshot below. Note in the Hercules window I'm showing the system panel, you can switch between the Hercules console and panel by typing Esc. If you don't like the colours, edit hercules.cnf in this repo and change the line PANOPT MSGCOLOR=DARK.

/images/tss/post-ipl.png TSS/360 after IPL. Source: Rupert Lane. License: CC0.

Entering commands

The prompt is an underscore: on a a physical teletype, this would have been followed by a backspace so the first character you typed would be underlined, which is a nice way of distinguishing user and system text on the printout. The terminal emulator allows you to correct mistakes with Delete and Control-U before pressing Enter.

Commands are 1-8 letters long: for example usage will print a summary of your resource usage so far.

Commands can take parameters, which are separated by commas and can be specified positionally or via keywords. For example, exhibit uid will show what users are logged on to the system.

exhibit uid
ACTIVE USER STATUS AT 09:36:38     12/17/26
USERID    TID TYPE SYSI
SYSOPER0    1 CONV  209 SYSOPER0    2 BACK    0 TSS*****   13 CONV  21F

To just show conversational users, you can set the type option.

exhibit uid,type=conv
ACTIVE USER STATUS AT 09:36:58     12/17/26
USERID    TID TYPE SYSI
SYSOPER0    1 CONV  209 TSS*****   13 CONV  21F

This could also be entered as exhibit uid,conv or even exhibit type=conv,option1=uid

Sometimes commands will prompt you for more information. If you want to stop the current program, enter ! as the first character of the line and press Enter. For example below I enter the print command without a file name and so it prompts for one; as I don't have anything to print I type ! to exit out.

print
 ENTER DSNAME
!

There is no online help, but explain can be used sometimes to provide more information about the last error message. Below I enter an unknown command foo and then get more information.

foo
 CANCELLED: SYMBOL FOO      TO BE LOADED NOT FOUND
explain
 NO MODULE WAS FOUND IN ANY OF THE DEFINED JOBLIBS CONTAINING THE SYMBOL.
  THE SYMBOL WAS EITHER NOT FOUND OR WAS CONTAINED IN A MODULE WHICH IN THE
  PROCESS OF BEING LOADED,HAD ALL CONTROL SECTIONS REJECTED

Running a simple Fortran program

Let's enter and compile a simple hello world program in Fortran. Type edit source.hworld and it will print the initial line number 100 for this new file. Now enter the following program, using spaces not tabs. You can use Delete to correct any mistakes on each line.

        DO 1 J=1,5
1       WRITE(6, 2)
2       FORMAT(' HELLO, WORLD!')
        STOP
        END

To exit the editor, you need to use the END command, but you need to type an underscore first to signal this is a command rather than just text

To compile, type ftn hworld and to execute run hworld. Your session should look something like this:

edit source.hworld
0000100         DO 1 J=1,5
0000200 1       WRITE(6, 2)
0000300 2       FORMAT(' HELLO, WORLD!')
0000400         STOP
0000500         END
0000600 _end
ftn hworld
run hworld
HELLO, WORLD!
HELLO, WORLD!
HELLO, WORLD!
HELLO, WORLD!
HELLO, WORLD!
 TERMINATED: STOP

Looking at files

Let's take a look at our files now. Type pc? to print the catalog to the screen, ie do a directory listing. You will see a bunch of existing files and our source file is there

TSS*****.SOURCE.HWORLD,   ACCESS: RW

(The asterisks after the user id TSS are to pad it to 8 characters).

By typing line? source.hworld you can list the contents of this file to the terminal.

You'd expect also to see an object file as a result of the compilation, but there's no obvious candidate. In fact, the object code has been added to this library file

TSS*****.USERLIB,   ACCESS: RW

TSS/360 collects object code into libraries like this and when you type RUN to execute it, does the run time dynamic linking needed.

There's also a listing file produced by the compile which you can view by typing line? list.hworld. But looking at the catalog we see this strangely named file:

TSS*****.LIST.HWORLD.G0000V00,   ACCESS: RW

This is a generational data group, a way of keeping several older versions around. Compile the source again by typing ftn hworld and then pressing Enter when it says DEFAULT TO REPLACE PREVIOUS MODULE. Do a pc? again and you will now see two files

TSS*****.LIST.HWORLD.G0000V00,   ACCESS: RW
TSS*****.LIST.HWORLD.G0001V00,   ACCESS: RW

These files can be accessed by the full names given above, but you can also use list.hworld(0) and list.hworld(1) to see the latest and previous version.

As you can see, TSS/360 handles files quite differently from what we've seen on other operating systems - it even gives them a different name, calling them data sets. In a future post I will go into more detail.

Logoff

Type logoff in the user console. This will trigger a bug in the system where the logoff accounting procedure does not run correctly. There is a way to work around this, however. Disconnect your user console telnet window (close the window or type Control-] and then quit). Switch to the operator console and type run twice to clear the error. You can now reconnect the user console and logon again if desired.

Shutdown

To shutdown the system, switch to the operator console and type shutdown. It will print a message saying this is completed. Now go to the Hercules console and type quit.

Further reading

Bitsavers has a comprehensive set of manuals for TSS/360. Most of these are references, but a tutorial style guide that extends on the above can be found in Introducing TSS/360: A Primer for FORTRAN Users

Questions, corrections, comments

I welcome any questions or comments, and also especially any corrections if I have got something wrong. Please email me at rupert@timereshared.com and I will add it here and update the main text.


IBM TSS/360

For our first System/360 time-sharing operating system, we'll look at TSS/360, with TSS standing for Time-sharing System. This was not a great success - from a 1972 review by IBM:

Indeed, bringing TSS/360 to the marketplace and making it productive in customer installations has been a very difficult task, both technically and financially.

History

By 1964, IBM had experimented with creating time-sharing systems, such as this one for the 7090, and had helped provide the hardware needed for MIT to produce CTSS, but had never released anything to customers. As MIT was planning for its replacement for CTSS, IBM assumed that they would use the new System/360 as their hardware. But MIT did not like the initial design of the computer, as it lacked many of the hardware support features needed for time-sharing like address translation. They, together with AT&T, decided to go with General Electric, and eventually produced Multics for a modified GE-635 computer.

IBM was not happy about this outcome, perceiving the loss of university and scientific support as detrimental to the long term success of System/360. In August 1965 they announced the System/360 Model 67, which had some of the hardware features missed by MIT, and an operating system called TSS/360 to go with it.

/images/tss/tss-collage.png Details from a TSS brochure. Source: Bitsavers

The hardware was available in 1966, but the planned shipping date for TSS in mid 1967 was missed, despite IBM throwing large numbers of programmers at it. An experimental release came in October of that year, but performance was not great (one attendee of CHM's conference on time-sharing remembered walking out of a demo in disgust when the system had not finished booting up after 30 minutes).

Potential customers drifted away to other operating systems such as VM and MTS, and to other machines, and only a handful of sites stuck with TSS. IBM did continue to improve it, boosting its performance and reliability, replacing the scheduling algorithm and command set, but decided to switch to TSO under MVT/MVS as their preferred implementation of times-sharing in 1971. Support for TSS continued for a while. including a version for newer hardware called TSS/370, but it was pretty much extinct by the mid 1970s.

Architecture

TSS/360 consists of a central memory-resident supervisor that controls tasks: each user can have one interactive task and any number of non-interactive/batch tasks running, and the system time-slices between them; later versions had a dynamic scheduler that could be adjusted by the system owner. It's possible to have more than one CPU in the system.

TSS was designed to run only on System/360 and later models that supported dynamic address translation. The system uses virtual memory, called virtual storage by IBM.

Data is stored in a catalog and is accessed via the concept of data sets which may span multiple files. Data sets can be in different formats, such as sequential, indexed sequential and partitioned, and there is provision for saving older versions of files automatically.

User commands include logon, profile management (settings and synonyms for commands), data set management and editing, language processors like Fortran, debugging and bulk I/O requests such as printing. Users can also write their own commands to extend those provided by the system. It's even possible to replace error and information messages produced by system programs with your own messages.

Users are divided into several classes, such as system managers, operators and regular users, with different commands being available to each group. It's possible to share data sets between users. Memory protection exists between tasks, with the ability for reenterable code to be shared between them.

Dynamic loading is used to start programs, allowing libraries and data sets to be associated with tasks at run time.

Preservation status

Jay Maynard has preserved version 3 of TSS/370 at this website. This includes the installation tape, a set of installed disk images and the system source code (excluding the source of some copyrighted compilers). This is the only known version that is available.

Bitsavers has a nearly complete collection of IBM manuals for TSS, covering both early and later versions.

Emulation status

The above software kit works on Hercules, allowing you to IPL (boot), login and run tasks. There are several bugs, such as user logoff not working properly that are probably underlying issues with TSS, but it is usable. With Hercules running much faster than the original hardware, performance is not an issue today.

Richard Cornwell has written a System/360 and 370 emulator which is available in his sims fork of simh. I've got this booting using Jay Maynard's disk kits but I have not been able to get remote user logins working yet.

On this blog

I plan to cover the following topics as we look closer at TSS/360.

A note on naming: I will generally call the operating system "TSS/360" in these pages, although IBM also used "TSS/370" and just plain "TSS" in their documentation.

Further reading

Again, Emerson Pugh's book IBM's 360 and early 370 systems is a great source for history. You can read it online at the Internet Archive.

Tom Van Vleck gives an account of TSS/360 and VM from the perspective of a Multics developer at multicians.org.

IBM's IBM Time Sharing System Concepts and Facilities is a good first read on TSS/360's architecture and key concepts. Several versions are available on Bitsavers, with the most recent here.

Questions, corrections, comments

I welcome any questions or comments, and also especially any corrections if I have got something wrong. Please email me at rupert@timereshared.com and I will add it here and update the main text.


Next →