Having restored the BCPL tape, before you can properly install BCPL you must undertake some pre-requisite work. Fortunately the pre-requisites are stated in the BUILD.CTL file that ships on the tape and boil down to three things:
- Check the code in LINK recognises compiler code #13 as requiring SYS:BCPLIB.REL as the default library. This code should be in LINK v2 onward.
- Check COMPIL recognises the extension .BCL and .BCP as requiring the BCPL compiler.
- Set up a BCPL library area identified as BCL: and known to the monitor.
On the face of it, this may seem simple but it turns out that the standard utilities shipped with TOPS-10 7.04 do not meet all these requirements, so we must make some changes to the monitor and the tools in the o/s.
To keep this simple, I decided to go with the easiest first. It is a relatively simple matter to determine if the linker supports BCPL by checking if the linker will take BCPL as an argument for the /SYSLIBRARY switch. As can be seen in the example below, the linker on my system won’t accept any old rubbish, but will accept BCPL, so I conclude the linker is BCPL ready.
.r link
*/SYSLIBRARY:foo
?SCNUSV Unknown switch value FOO
*/SYSLIBRARY:bcpl
*^C
.
The next step is to make sure the COMPIL command understands BCPL files for input. I have already tried this and currently it tries to compile BCPL with the default FORTRAN compiler, so clearly not. Therefore we have to make some modifications to the COMPIL command to support BCPL. Fortunately, in the BCPL provided files is a file called COM22C.SCM which shows the differences between before and after edits on the COMPIL command source code which should be found in the PPN,SFD of [10,7,COMPIL] on most systems. In order to apply the changes in the COM22C.SCM file we have to manually edit the source file by hand to make the changes and then re-compile the COMPIL command. For this we need to use the SOS editor, which for its days was pretty decent but is still essentially a line orientated teletype based editor.
When making the changes to COMPIL.MAC[10,7,COMPIL] be very aware that the version of COMPIL on Tops-10 v7.04 is going to be a later version from the Essex comparison 1976 version so we will have to adapt the changes as appropriate.
The first step in the edit cycle is to make a backup of the original source. I will call this backup COMPIL.DEC as it is the original supplied by DEC and goes with the naming convention in the COM22C.SCM file above:
.r setsrc
*cp [10,7,compil]
*^Z
EXIT
.copy compil.dec=compil.mac
.dir
COMPIL EXE 40 <155> 1-Sep-88 22G(605) DSKB: [10,7,COMPIL]
COMPIL MAC 229 <155> 10-Sep-87
COMPIL DEC 229 <057> 21-Feb-18
Total of 498 blocks in 3 files on DSKB: [10,7,COMPIL]
.
Next, I revert back to my home PPN and take a copy to work on with the SOS editor. I did try and use file transfer to the host and edit using a visual text editor but the files produced by SOS are not plain text and include control characters which break the source file if lost.
.r setsrc
*cp [1,2]
*^Z
EXIT
.copy dsk:=compil.mac[10,7,compil]
.sos compil.mac
Editing COMPIL.MAC
*
Now that I have opened COMPIL.MAC for edit, we will need to make all the changes listed in the COM22C.SCM file above. This is a bit tricky because the COMPIL.MAC that I am editing is not the same as the CPOMPIL.MAC that was originally compared with in the differences file. My system is Tops-10 7.04 and the COMPIL.MAC has had many updates since then. As an illustration the DEC version of the Essex original was 3, but my DEC source is now 7 and the Essex VEDIT level is 307 and my source is 605. So we will have to be careful when making changes to ensure that we are making them intelligently in the context of the more recent source rather than just blindly following the instructions. This is particularly true for the edit on original source page 58 which has an relative JUMPL instruction that in my later source is a JUMPL to a label, so I need to be sure what effect the changes are supposed to have before just blindly applying the new BCPL sections.
First lets Find the location of the first change and insert the addition and then print the surrounding lines. When using SOS, the $ character is displayed when I press the key and * is the prompt:
*fVUPDATE$
03200 VUPDATE==7 ;DEC UPDATE LEVEL
*i3150
03150 VLOCAL==1 ;ESSEX UPDATE LEVEL
*P3100:3300
03100 VCOMPIL==22
03150 VLOCAL==1 ;ESSEX UPDATE LEVEL
03200 VUPDATE==7 ;DEC UPDATE LEVEL
03300 VEDIT==605 ;EDIT LEVEL
*
Now lets change VEDIT and VCUSTOM as per the changes listed above. We do this by using the substitute command and apply it to line 3300 which we listed above and then find VCUSTOM and substitute the version on that line. Remember that the $ is the key.
*sVEDIT==605$VEDIT==VLOCAL*1000+605$3300
03300 VEDIT==VLOCAL*1000+605 ;EDIT LEVEL
*fVCUSTOM$
03400 VCUSTOM==0 ;NON-DEC UPDATE LEVEL
*s==0$==2$3400
03400 VCUSTOM==2 ;NON-DEC UPDATE LEVEL
*
Now continue to make the remaining changes to the file as listed in the differences file above, remembering to be intelligent about the edits as your source file is probably not the same as the original source that the differences listed in COM22C.SCM refers to. The other thing to watch out for is that large files like COMPIL.MAC are divided into pages as the number of lines exceed the maximum that SOS can accommodate. So when specifying where to make a substitution or do a find ensure that you are aware of the page number. Where you do need to specify a line and page number the format is line/page. Look at the SOS help for more details on commands and parameters. For example, here I have found something on page 5 that needs to have an insert done before it:
*fIFN SNOBOL$
Page 5
02400 IFN SNOBOL,
*i2310/5
02310 IFN BCPL, ;[1000]
*
After applying all the edits to the new COMPIL.MAC file, the first test of having successfully done this to see if it will indeed compile.
.compil compil.mac/compile
MACRO: COMPIL
EXIT
.
The fact that it completes the compile suggests that at least the syntax is right, so no silly spelling mistakes have occurred as I would expect the compiler to pick that up.
Next, lets see if it can link, produce an executable program, and execute.
.execute compil.mac/ssave
MACRO: COMPIL
LINK: Loading
[LNKXCT COMPIL execution]
?CMLNPC No previous command
.dir
COMPIL MAC 298 <057> 22-Feb-18
COMPIL REL 52 <057> 23-Feb-18
COMPIL EXE 44 <057> 23-Feb-18 22G(1605)-2
Total of 399 blocks in 3 files on DSKB: [1,2]
The error after the compile is produced by COMPIL.EXE, so this suggests that not only does it compile and link, but successfully executes and reports that no file name was passed to COMPIL.
Having produced (presumably) a successful EXE with BCPL support, now lets install the new COMPIL command. If you are not already, login as OPR, then copy dsk:[10,7,compil]=compil.exe
and copy sys:<055>=compil.exe
after which the new COMPIL should be in place. Notice the new version number and date in the directory below.
.dir sys:compil.exe
COMPIL EXE 44 <055> 22-Feb-18 22G(1605)-2 DSKB: [1,4]
Now we have the new COMPIL command that supports BCPL, we can add a BCL: ersatz device to the monitor. To do that we must go through MONGEN.
First, lets choose and create the directory for BCL:
.r credir
Create directory: [5,24]/protection:775
Created DSKB0:[5,24].UFD/PROTECTION:775
Create directory: ^Z
I have used the PPN of [5,24] as this is the next in sequence after the reserved PPNs for language sources listed in Appendix D-2 of the Operating System Commands Manual.
Now lets set up the ersatz device in MONGEN.
.r setsrc
*cp [10,7,mon]
*^Z
EXIT
.r mongen
Write MONGEN.MIC (YES,NO) : n
MONGEN for 704 monitors
MONGEN will generate any known TOPS-10 configuration. For information
about which configurations are supported, please refer to the SPD.
/HELP (PROMPT,SHORT,LONG) ]: prompt
Which GEN (SYS,F) : s
Output(DSK:SYSCNF.MAC):
DECsystem10 (KL,KS) : ks
System name : PDP10
CPU0 serial number (1-10000) : 4097
Exclude monitor overhead from user run time (YES,NO) : y
Account verification (YES,NO) : n
Autoconfigured device options:
Include Ethernet service (NO,YES,PROMPT): n
Prompt for RP0x/RM0x Massbus disks (NO,YES): n
Include TM02/TM03 magtapes (NO,YES,PROMPT): y
Include UNIBUS/LP20 printers (NO,YES,PROMPT): y
Include UNIBUS/CD20 card readers (NO,YES,PROMPT): n
Local terminal configuration:
DZ-11 TTY lines (0-32) : 32
OPR octal line number (CTY,0-37) : cty
Data set lines
Number of Jobs (1-511) : 127
Maximum pages of core for each job (0,0-16384) :
Total amount of system core in K (512-4096) : 1024
Clock ticks per second (60,50) : 60
Allow jobs to be locked in core (YES,NO) :
Guaranteed number of pages for unlocked jobs (0,0-16384) :
Number of pages reserved for locking jobs in Exec Virtual Memory (10,0-?) :
Number of high priority interrupt queues (0,0-15): 15
Meter (NO,YES) :
KASER (NO,YES) :
MPXSER (YES,NO) :
PSISER (YES,NO) :
IPCF (YES,NO) :
ENQ/DEQ (YES,NO) :
Disk sets (ALL) :
Configure non-autoconfigured hardware (NO,YES) :
Number of KMC/DUP Lines (0,0-2) :
Number of PTYs (20,1-476) :
Network software (YES,NO) : n
Decimal "symbol,value"
Octal "symbol,value"
SIXBIT "symbol,value"
Type "device-mnemonic,PI-channel" for special devices
Type "device-mnemonic,PI-channel,no.-of-devices"
Type "device-mnemonic,PI-channel,highest-ac-to-save"
Type "ersatz-device,P,Pn,search-list-type"
BCL,5,24,SYS
Type "command-name,dispatch,flags,unique-bits,PRVTAB-name"
Terminal class :
Additional terminals for classes:
Class to extend :
System default terminal type (TTY) :
File DSK:SYSCNF.MAC Closed
Which GEN (SYS,F) : f
Output(DSK:F.MAC):
Feature set (KL10,KS10) : ks10
Standard settings (YES,NO) :
File DSK:F.MAC Closed
Which GEN (SYS,F) : ^Z
EXIT
.compile/compile f,s
MACRO: F
MACRO: S
EXIT
.compile/compile devprm,dteprm,netprm,d36par
MACRO: DEVPRM
MACRO: DTEPRM
MACRO: NETPRM
MACRO: D36PAR
EXIT
.compile/compile syscnf+<common,comdev,commod>
MACRO: COMMON
MACRO: COMDEV
MACRO: COMMOD
EXIT
.r link
*sys2/save/noinitial/hash:13k = /locals -
#common,comdev,commod,tops10[10,7,mon,ks]/search-
#/patch:200/counters/go
[LNKRLC Reloc. ctr. initial value current value limit value
.LOW. 0 64443 344000
.HIGH. 344000 607662 720000
.INIT. 740000 764722 771000
.TWIC. 771000 772401 1000000
Absolute code loaded]
EXIT
.
This has now created a new system monitor in [10,7,mon] called SYS2.EXE which should now include the BCL: ersatz device. Lets check it works by booting with the new system.
BOOT>sys2.exe[10,7,mon]
[Loading from DSKB:SYS2.EXE[10,7,MON]]
PDP10 23-Feb-18
Why reload: sch
Date:
Time:
Startup option: g
PDP10 20:32:10 CTY system 4097
Connected to Node CENTRA(0) Line # 42
.LOGIN 1,2
.R OPR
[CCPWFD Waiting for file daemon to start]
%%TTY STOMPER – Starting
OPR>
The system boots! Now lets check if the BCL: device exists.
OPR>push
.dir bcl:
%WLDDEM Directory is empty bcl:
.
That shows that the BCL: device is linked to the empty directory in [5,24] that I created earlier.
So, now all the pre-requisites are complete, lets install BCPL! We will also want to make SYS2.EXE[10,7,MON] our default SYSTEM, but we can do that later when we are sure everything works.
Minor hiccup – your MONGEN instructions include the line:
.compile/compile syscnf+
This should be:
.compile/compile syscnf+
I suspect the ≤ > HTML tags got mangled somehow.
Hmm, mangled again. WordPress issue? I’ll try ampersand lt; and gt;
.compile/compile syscnf+<common,comdev,commod>
Yes, wordpress trying to interpret the < and > as markup. Ive debugged it.
Hi Drew
Yes, a wordpress “feature”. I think Ive debugged it now.
Quentin –
I’ve tried countless times to edit the compil.mac file as described above, but I always end up with errors when I try and compile it. Would it be possible for you to upload your altered t10.dsk somewhere?
Your instructions miss out the word ESC where you are saying about inputting $ in sos, probably a WordPress issue.
Hi rob. I’ll look into this when I get back from vacation.
Hope you had a great holiday!
Hi Rob
Yes thanks good break. The amended COMPIL.MAC source is on GitHub as source https://github.com/PDP-10/essex-bcpl/blob/tape/compil.mac
If you upload the COMPIL.MAC source file to your TOPS-10 and then EXECUTE COMPIL.MAC/SSAVE and put the resulting COMPIL.EXE in the SYS: library, you should then be able to compile BCPL. Even if you don’t have a working COMPIL.MAC, I think you can still get COMPIL to work with BCPL by using the BCPL switch – COMPIL/BCPL MYPROG.BCL – but I haven’t checked it recently and you would have to manually link the BCPL libraries before getting an executable.
Cheers Quentin, I’ll give that a try!
I managed to get the tape version of mud84 working using the pre-compiled exe file and your instructions about exploding the .mas file to obtain the various txt files required. It has berserk mode enabled, meaning unless you enter berserk mode – which is a one time choice and means you can no longer obtain points from treasures – you can’t remove the longsword from the rock. There’s always the broadsword though, but the guardian might be unhappy unless fed! It lacks wafer, so more sleeping required and a few wiz and archwiz commands which I’m hoping mud86 will. Runs great on a Raspberry Pi 3b though.
I am struggling to find the correct syntax for changing the file permissions to alter the persona file to be read by any other user than Richard is a bugbear for me, as it appears to have a .pm extension, but COPY mud..pm [022] mud..pm isn’t accepted.
I think you can remove the longsword without being berserk even in MUD84. You just need to be suitably equipped and levelled. I haven’t tried it though.
Ah yea, the old double dot. The trick is to use a wildcard: MU*.PM. It was a crude copy protection.
re: the new compil.exe to support BCPL. Thanks for creating a tape backup as I was struggling with making the changes to compil.mac using sos. Restoring from tape has made my life a lot easier!
One step closer to getting mud 86 to compile…
Paul –
Hope you’ve managed to compile mud86 successfully Paul, I got mine working.
I haven’t been able to get Valley to run with the mud86 source however, despite it running on the ’84.
I’m still searching for the name of the wiz file, I’ll give wiz.txt, txtwiz.txt and wiz.dba a try later.
I followed all steps until here.
I saw several ways to get to the . prompt inside the TOPS.
This tutorial starts with run “.r link”
How do you go there from :
foo /tmp/mud1 $ pdp10 pdp10.cfg
PDP-10 simulator V3.8-1
Listening on port 2020 (socket 5)
Modem control activated
Auto disconnect activated
BOOT V4(76)
BOOT>
[Loading from DSKB:SYSTEM.EXE[1,4]]
KS10 07-Oct-88
Why reload:
What do we put at the “Why reload” to go forward with the tutorials?
If you press [return] at the
Why reload?
prompt you will be given a list of reasons which you can ask for HELP on. In general, you would use SCHED (or just SC) for a scheduled restart. Eg:Why reload:
Options are: OPR PARITY POWER STATIC HARDWA NXM
HALT LOOP HUNG PM CM SA
NEW SCHED OTHER
Type "HELP" for additional information
Why reload: sched