Thursday, February 12, 2015

TOPS-20: Making more space in the public structure

The Panda distribution is for sure the easiest way to make contact with TOPS-20, and in a previous entry I explained how to set it up to run in a Raspberry Pi (or similar) computer. One of the challenges of using those ancient operating systems is the lack of support and/or documentation. Fortunately, there is a whole treasure of information in the internet, and a quite active newsgroup devoted to the PDP10 class computers, where some of the actual designers of those machines and those operating systems is happy to answer a beginners question about the work of their life.

On the other hand, one of the fun things one can do is to dig around and find the answers from himself!

The problem: lack of disk space in the public structure

The "public structure" is what in other environments we would call the "system disk" or the "root filesystem". The Panda Distribution comes with a public structure defined in a RP07 class disk. Those disks held about 476 Megabytes, and as far as I know the "regular" TOPS-20 did not support those devices for the public (boot) structure. The late Mark Crispin modified heavily the montitor (what we could call "kernel" nowadays) to support those big (at the time) disks. Just after the first boot, there is plenty of available space in Panda's TOPS20 structure:

@info disk
 TOPS20:<OPERATOR>
 3 Pages assigned
 500 Working pages, 500 Permanent pages allowed
 82831 Pages free on TOPS20:, 133545 pages used.

That is about 160 MBytes of space (remember that the PDP10 was a 36 bit machine, so our eight-bit bytes are not really the best unit in that environment). For a casual use it is obviously more than enough. But if you start installing stuff, testing things and messing around you can find yourself with a few thousands of pages left. In that case, you can do several things:

  • Purge the old versions of the log files to free up space. Those files, called LOGFILE.LOG, accumulate themselves in the SYSTEM: directory (that is a logical which points to TOPS20:<SYSTEM> and can take a big chunk of space.
  • Create another structure and mout it as a USER structure, using it to do your stuff.
  • Add another volume to the TOPS20: structure. This is the best long-term solution and it will be explained in this blog entry.

Preparation

We must do two things before we start adding space: preparing a DUMPER tape and actually dumping (backing up) the TOPS20: structure.

Creating a bootable DUMPER tape.

The first thing we must do is to make a bootable TAPE which must contain the DUMPER utility. The DUMPER utility is the TOPS-20 backup program. Since we will create a new, pristine structure we need to be able to boot directly into DUMPER from tape to restore our current information.

The good news is that it is really easy to create a dumper tape:

  • First, we will create a virtual tape, escaping to the KLH10 console (pressing CTRL-\) and typing:

@[HALTED: FE interrupt]
KLH10> devmount mta0 dumper.tap create
Mount requested: "dumper.tap"
KLH10> [mta0: Tape offline]

KLH10> cont
Continuing KN10 at loc 01063335...

@

  • Now we have to copy the monitor program and DUMPER itself into the tape. We will use Mark Crispin's monitor, which supports big structures:

@copy system:monitr.exe mta0:
 <SYSTEM>MONITR.EXE.1 => MTA0:MONITR [OK]
@copy tops20:<subsys>dumper.exe mta0:
 <SUBSYS>DUMPER.EXE.1 => MTA0:DUMPER [OK]
@rewind mta0:
@unload mta0:
@

  • And we are done. We just have to detach the virtual tape from the emulator, and keep the file safe

@[HALTED: FE interrupt]
KLH10> devunmount mta0
Unmount requested
[mta0: Tape offline]
KLH10> 


Backing up the system

Now we need to get a backup copy of our running system on tape. To do this we will shut down the system, and then we will use DUMPER to create the backup. These are the steps:
  • Enable privileges and shut down the system typing CTRL-E followed by CEASE NOW

@enable
$^Ecease now
 TOPS20 Will be shut down IMMEDIATELY 
[Confirm]
12-Feb-2015 12:54:20 ACJ: System shutdown set by job 9, user OPERATOR, program C
EASE, TTY5
$
[Timesharing is over]

OPERATOR - Wait for the message "Shutdown complete" before
entering commands to PARSER.
[ni20_cmdchk: Illop=0 wd=4,,0 qe=1443101]
[dpni20-W: "tap0" multicast table ignored - interface not dedicated]
[ni20_cmdchk: Illop=0 wd=4,,0 qe=164061]
SJ  0: OPR>Killed Job 1, User OPERATOR, TTY13, at 12-Feb-2015 12:54:21
SJ  0:  Used 0:00:00 in 0:17:24
[dpni20-W: "tap0" multicast table ignored - interface not dedicated]
[ni20_cmdchk: Illop=0 wd=4,,0 qe=164061]
12-Feb-2015 12:54:24 HSYS: Shutdown complete
  • Create a virtual tape to hold the backup. We do this as we did before, pressing CTRL-\ to access the console:
[HALTED: FE interrupt]
KLH10> devmount mta0 backup-tape.tap create
Mount requested: "backup-tape.tap"
[mta0: Tape online]
KLH10> cont
Continuing KN10 at loc 01003136...

$


  • Run DUMPER and take the backup. This step can take some time. You must be careful to not forget to issue the CREATE command before the SAVE. The CREATE command allows you to do the full restore you'll need afterwards, adding to the backup tape the image of the directory structure.

$r dumper
[Using MTA-DUMPER:]
DUMPER>tape mta0:
DUMPER>create
DUMPER>save tops20:

 DUMPER tape #1, Thu 12-Feb-2015 1257. 

 TOPS20:<ALGOL>
 TOPS20:<BBOARD>
 TOPS20:<BLISS>
.
.
.
 TOPS20:<UNSUPPORTED>
 TOPS20:<UTF9>
 TOPS20:<UTILITIES>
 TOPS20:<WINDOW>



 Total files dumped:   7403
 Total pages dumped: 104812
 Directories dumped:    141

 CPU time, seconds:  570.00


  • Detach the backup tape and shut down the simulator. Remember the system was already shut down, so we can quit KLH10 without damaging anything.
Now it is a good practice to make a copy of the virtual disk we are about to replace, just in case we are unable to restore the tape we have just made. Since we are going to create the disks from scratch, you can simply rename the file to avoid it to be overwritten. That is one of the nice things of emulation: we can do things we couldn't dream about if we were using real devices!

Creating the new system disks

Now we are going to create the new disk structure. The KLH10 distribution included in panda contains a configuration file which is appropriate to install a system from scratch. That file is inst-klt20.ini. We will modify this file to acomplish what we want to  do. The part of the file which contains the device definitions is:


devdef dte0 200   dte   master
devdef rh0  540   rh20
devdef rh1  544   rh20
devdef dsk0 rh0.0 rp    type=rp06 format=dbd9
devdef mta0 rh1.0 tm03  type=tu45


We will change the disk type to rp07 add another disk definition, so it will become:


devdef dte0 200   dte   master
devdef rh0  540   rh20
devdef rh1  544   rh20
devdef dsk0 rh0.0 rp    type=rp07 format=dbd9
devdef dsk1 rh0.1 rp    type=rp07 format=dbd9
devdef mta0 rh1.0 tm03  type=tu45

Now we will start the simulator. Be sure you have the mtboot.save file in the current directory and start kn10-kl using the modified configuration file:

$ ./kn10-kl inst-klt20.ini 
KLH10 V2.0H (MyKL) built Feb 12 2015 00:50:35
    Copyright ? 2002 Kenneth L. Harrenstien -- All Rights Reserved.
This program comes "AS IS" with ABSOLUTELY NO WARRANTY.

Compiled for LINUX on ARM with word model USEINT
Emulated config:
CPU: KL10-extend   SYS: T20   Pager: KL  APRID: 3600
Memory: 8192 pages of 512 words  (SHARED)
Time interval: SYNCH   Base: OSGET
Interval default: 60Hz
Internal clock: COUNT
Other: MCA25 JPC DEBUG PCCACHE EVHINT
Devices: DTE RH20 RPXX(DP) TM03(DP) NI20(DP)
[MEM: Allocating 8192 pages shared memory, clearing...done]

KLH10# ; Sample KLH10.INI for initial installation
.
.
.
KLH10# ; Load tape bootstrap directly
KLH10# load mtboot.sav
Using word format "c36"...
Loaded "mtboot.sav":
Format: DEC-CSAV
Data: 4067, Symwds: 0, Low: 040000, High: 054641, Startaddress: 040000
Entvec: JRST (120 ST: 0, 124 RE: 0, 137 VR: 0,,0)
KLH10# 
KLH10# ; Now ready to GO
KLH10# [EOF on inst-klt20.ini]
KLH10# 

Now we must attach the bootable dumper tape we build before, and start the virtual frontend:

KLH10# devmount mta0 dumper.tap
Mount requested: "dumper.tap"
[mta0: Tape online]
KLH10# go
Starting KN10 at loc 040000...

BOOT V11.0(315)

MTBOOT>

To load the monitor from the mounted tape, we will issue a '/L' command (without the quotes) and after that we will invoke the disk formatting procedure issuing a '/G143':
KLH10# go
Starting KN10 at loc 040000...

BOOT V11.0(315)

MTBOOT>/L

[BOOT: Loading] [OK]

MTBOOT>/G143



[For additional information type "?" to any of the following questions.]

Do you want to replace the file system on the system structure? 

The whole disk and structure formatting is as follows:
Do you want to replace the file system on the system structure? YES

Do you want to define the system structure? YES

How many packs are in this structure: 2

On which "CHANNEL,CONTROLLER,UNIT" is logical pack # 0 mounted? 0,-1,0

On which "CHANNEL,CONTROLLER,UNIT" is logical pack # 1 mounted? 0,-1,1

Do you want the default swapping space? Y

Do you want the default size front end file system? Y

Do you want the default size bootstrap area? Y

Do you want to enable password encryption for the system structure? Y

What is the name of this structure? TOPS20

[Structure "TOPS20" successfully defined]

[TOPS20 mounted]
?TOPS20 unit 0 has no BAT blocks.
Do you want to write a set of prototype BAT blocks? Y
?TOPS20 unit 1 has no BAT blocks.
Do you want to write a set of prototype BAT blocks? Y
PANDA PROGRAMMING, PANDA TOPS-20 Monitor 7.1(21733)-4 Internet: Loading host names
%%No SETSPD.

Be aware of the numbering of the controller (it is -1), and take almost all the defaults, excepting for the structure name, where you must specify TOPS20 explicitly. After that, our monitor will complain about not being able to load the internet address list and other stuff we don't need now. Eventually, the messages will stop. The next step will be to restore the backup we made previously.

Restoring our system

To begin the process we will press CTRL-C and will get a MX> prompt. Following from the last screen capture:

%%No SETSPD.

System restarting, wait...
Date and time is: Thursday, 12-February-2015 9:17PM
Why reload? 12-Feb-2015 21:17:48 ***BUGINF NOADDR*** Failed to find SYSTEM:INTERNET.ADDRESS file  Job: 0, User: OPERATOR
12-Feb-2015 21:17:48 ***BUGINF NOHSTN*** Failed to find host name file SYSTEM:HOSTS.TXT  Job: 0, User: OPERATOR
12-Feb-2015 21:17:48 ***BUGCHK NOACTF*** No account database - account validation disabled  Job: 0, User: OPERATOR

Why reload? OTHER - Question timeout
 DDMP: Started

No SYSJOB
12-Feb-2015 21:18:49 ***BUGCHK KNICFF*** PHYKNI - Cannot reload the NIA20  Job: 0, User: OPERATOR, Data: 600104
NO EXEC
MX>

Now we will load DUMPER into memory, following these steps:

MX>GET FILE mta0:
?
MX>GET FILE mta0:
MX>sTART
DUMPER>

Yes, the first command gives out and error, and the second one works. Notice you just have to type the first letter of the commands. A 'G' for GET FILE and an 'S' for START.

Now we must drop to the KLH10 console and mount the virtual tape which contains our backup:

DUMPER>[HALTED: FE interrupt]
KLH10> devmount mta0 backup-tape.tap 
Mount requested: "backup-tape.tap"
[mta0: Tape online]
KLH10> c
Continuing KN10 at loc 01053253...

DUMPER>

We are almost there. To restore the contents of the tape we will use the CREATE and RESTORE commands. Again, do not forget to issue the CREATE before the RESTORE. Ignore the error messages and be ready to wait for a while.

DUMPER>TAPE MTA0:
DUMPER>CREATE
DUMPER>RESTORE TOPS20: TOPS20:
UNNAMED saveset 12-Feb-2015 2057
%Failed to create TOPS20:<ROOT-DIRECTORY>Cannot find error message file - RETRYING
12-Feb-2015 21:24:52 ***BUGINF RTCRAT*** JSYSF: ROOT-DIRECTORY CRDIR attempted  Job: 1, User: OPERATOR, Data: 777576170026, 60000000
0000
12-Feb-2015 21:24:52 ***BUGINF RTCRAT*** JSYSF: ROOT-DIRECTORY CRDIR attempted  Job: 1, User: OPERATOR, Data: 777576170026, 60000000
0000
?Directory TOPS20:<ROOT-DIRECTORY> not created - Cannot find error message file
TOPS20:<ACCOUNTS> created
TOPS20:<ALGOL> created
TOPS20:<BBOARD> created
TOPS20:<BLISS> created
TOPS20:<BLISS-SOURCES> created
TOPS20:<CHIVES> created
TOPS20:<CHIVES.V1> created
TOPS20:<CHIVES.V1.CONFIG> created
TOPS20:<CHIVES.V1.DOCUMENTATION> created
TOPS20:<CHIVES.V1.SOURCE> created
TOPS20:<CLISP> created
TOPS20:<DECNET-SOURCES> created
.
.
.
TOPS20:<UTILITIES> created
TOPS20:<WINDOW> created
 Loading files into TOPS20:<ALGOL>
 Loading files into TOPS20:<BBOARD>
 Loading files into TOPS20:<BLISS>
.
.
.
Loading files into TOPS20:<TSU>
 Loading files into TOPS20:<UNSUPPORTED>
 Loading files into TOPS20:<UTF9>
 Loading files into TOPS20:<UTILITIES>
 Loading files into TOPS20:<WINDOW>
 End of Tape.


 Total files restored:   7402
 Total pages restored: 104811
 Directories created:   140
 Files skipped:     1
DUMPER>

And we are almost done! Now we just go back to the KLH10 console and quit the simulator. If we check the working directory we'll found two disk images (and possibily the old, renamed image). Now we have to modify the working configuration to add the newly created disk (the original name is klt20.ini) and start the simulator. If everthing has been done properly, we will be able to enjoy our new, super-sized public structure!

@info disk
 TOPS20:<OPERATOR>
 3 Pages assigned
 500 Working pages, 500 Permanent pages allowed
 297809 Pages free on TOPS20:, 134943 pages used.

Remember you can get the panda distribution, which includes both the PANDA TOPS-20 image and the KLH10 emulator (compiled for x86 linux) here. Enjoy!

No comments:

Post a Comment