Installing BCPL

Having completed the pre-requisites for BCPL, it should be a simple matter to install BCPL using the BUILD.CTL job that is included with the BCPL files on tape.

First, boot Tops-10 with the amended system that was generated with MONGEN to include the BCL: ersatz device.

PDP-10 simulator V4.0-0 Beta git commit id: ba447399
Listening on port 2020
Modem control activated
Auto disconnect activated
BOOT V4(76)

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

I used the operator account working directory [1,2] to restore the BCPL tape into as when I tried to use either a sub directory (SFD) or another PPN [100,100] I could not get the BUILD.CTL batch job to complete successfully. Essentially the SUBFIL utility which is provided as an EXE does not seem to recognise SFDs for output files, and so always puts it out into the UFD which breaks the subsequent steps in the CTL file if you SUBMIT from the SFD. I suspect this is because it is built on an earlier system that did not support SFDs. I also could not find a way for the BUILD.CTL file to have a default path of a PPN directory that it was not logged in to. Both of these problems might be down to my poor knowledge of the TOPS-10 batch system, so to cut a long story short and get something to work I just copied the entire BCPL tape to the operator UFD of [1,2] and submitted BUILD.CTL from there. I also found it seemed to need more system time than the suggested allocation in the comments, so I went for /TIME:60:00:00 as you can see below.

OPR>push
 
.submit build.ctl/time:60:00:00
[Batch job BUILD queued, request #3, limit 60:00:00]
 
.type build.log
                        25-Feb-18 12:52:42
 
BATCON Version  105(5027)                       GLXLIB Version  5(1601)
 
            Job BUILD Req #3 for OPR [1,2] in stream 2
 
        OUTPUT:  Log                            TIME-LIMIT: 60:00:00
        UNIQUE:  Yes                            BATCH-LOG:  Append
        RESTART: No                             ASSISTANCE: Yes
        CORE:    512 pages                      SEQUENCE:   537
 
 
        Control file: DSKB:BUILD.CTL[1,2]
        Log file:     DSKB:BUILD.LOG[1,2]
 
12:52:42 MONITR ^C
12:52:42 MONITR
12:52:42 MONITR .LOGIN [1,2] -
12:52:42 USER   Job 12  PDP10  TTY43
12:52:42 USER   #/BATCH:(INTERVENTION:YES,NAME:"BUILD",SEQUENCE:537,STREAM:2,REQ
UESTID:3)/ACCOU-
12:52:42 USER   #NT:""/NAME:"OPR   "/CORE:512P/DEFER/LOCATE:0/SPOOL:ALL/TIME:216
000
12:52:42 USER   [LGNJSP Other jobs same PPN]
12:52:42 USER   %LGNSVM Set maximum virtual and physical limits failed
12:52:42 USER   12:52   25-Feb-118   Sunday
12:52:43 MONITR
12:52:43 MONITR .
12:52:43 COMENT ;FILENAME:      BUILD.CTL

....

12:52:46 BATCH  .
12:52:46 BATCH  .KJOB/BATCH
12:52:46 USER
12:52:46 USER   [LGNJSP Other jobs same PPN]
12:52:46 USER   Job 12  User OPR  [1,2]
12:52:46 USER   Logged-off TTY43  at 12:52:46  on 25-Feb-118
12:52:46 USER   Runtime: 0:00:01, KCS:20, Connect time: 0:00:03
12:52:46 USER   Disk Reads:2866, Writes:1435, Blocks saved:30
 

Finally, lets test the compiler. Here is a simple BCPL program I prepared earlier, which we will now execute as a user (not OPR):

Note: There is an error in the Hello World program below, which I fix later on.
.type hello.bcp
GET "BCL:BCPLIB"

LET START() BE
$(
WRITES("Hello, world!!!*C*L")
$)

.execute hello.bcp/save
?CMLRUF RUN UUO failure (2) for SYS:BCPL
EXIT

.

Oh dear, that does not look good.

.dir sys:bcpl*.*

%WLDLKE Protection failure file DSKB:[1,4]BCPL.EXE
%WLDLKE Protection failure file DSKB:[1,4]BCPL00.EXE
%WLDLKE Protection failure file DSKB:[1,4]BCPL01.EXE
%WLDLKE Protection failure file DSKB:[1,4]BCPL02.EXE
%WLDLKE Protection failure file DSKB:[1,4]BCPL03.EXE
%WLDLKE Protection failure file DSKB:[1,4]BCPL.HLP
%WLDLKE Protection failure file DSKB:[1,4]BCPL.TXT
%WLDLKE Protection failure file DSKB:[1,4]BCPLIB.REL
Total of 8 LOOKUP errors on DSKB: [1,4]

Looks like a simple problem with the permissions. Back as OPR I take a look at SYS:

.dir sys:bcpl*.*


BCPL    EXE   104  <057>    8-Feb-80    3H(103) DSKB:   [1,4]
BCPL00  EXE   132  <057>    8-Feb-80    3H(103)
BCPL01  EXE   144  <057>    8-Feb-80    3H(103)
BCPL02  EXE   104  <057>    8-Feb-80    3H(103)
BCPL03  EXE    28  <057>    8-Feb-80    3H(103)
BCPL    HLP     5  <057>   31-Aug-78
BCPL    TXT    11  <057>   21-Nov-78
BCPLIB  REL   137  <057>    7-Feb-80
  Total of 665 blocks in 8 files on DSKB: [1,4]

Yep, these should be protection 055 not 057. So a swift rename as OPR should fix that:

.rename sys:<055>=sys:bcpl*.*
Files renamed:
DSKB:BCPL.EXE
DSKB:BCPL00.EXE
DSKB:BCPL01.EXE
DSKB:BCPL02.EXE
DSKB:BCPL03.EXE
DSKB:BCPL.HLP
DSKB:BCPL.TXT
DSKB:BCPLIB.REL

Now, lets try again.

.execute hello.bcp/save
BCPL:  HELLO
GET "BCL:BCPLIB"
                ^
(E36-1) Unable to get GETFILE
        
(W50-5) Name not declared
WRITES
400027/2
% 1 Error 
LINK:   Loading
?LNKUGS 1 undefined global symbol
        WRITES  0
%LNKDLT Execution deleted

EXIT

The good news is that the compiler works, it is automatically invoked by the COMPIL command but there is something wrong with the library reference in my test BCPL hello world program.

A quick check of BCL: reveals it also has a permissions problem:

.dir bcl:

%WLDLKE Protection failure file DSKB:[5,24]ACS.GET
%WLDLKE Protection failure file DSKB:[5,24]BCPLIB.GET
%WLDLKE Protection failure file DSKB:[5,24]BITS.GET
%WLDLKE Protection failure file DSKB:[5,24]ERRORS.GET
%WLDLKE Protection failure file DSKB:[5,24]IOLIB.GET
%WLDLKE Protection failure file DSKB:[5,24]IOPACK.GET
%WLDLKE Protection failure file DSKB:[5,24]IOUUO.GET
%WLDLKE Protection failure file DSKB:[5,24]JOBDAT.GET
%WLDLKE Protection failure file DSKB:[5,24]SCB.GET
%WLDLKE Protection failure file DSKB:[5,24]USEFUL.GET
%WLDLKE Protection failure file DSKB:[5,24]KERNEL.GET
%WLDLKE Protection failure file DSKB:[5,24]BCPLIB.MAS
%WLDLKE Protection failure file DSKB:[5,24]GLOBAL.REL
%WLDLKE Protection failure file DSKB:[5,24]LOWLIB.REL
Total of 14 LOOKUP errors on DSKB: [5,24]

So, another quick rename as OPR can fix this:

.rename bcl:<055>=bcl:*.*
Files renamed:
DSKB:ACS.GET
DSKB:BCPLIB.GET
DSKB:BITS.GET
DSKB:ERRORS.GET
DSKB:IOLIB.GET
DSKB:IOPACK.GET
DSKB:IOUUO.GET
DSKB:JOBDAT.GET
DSKB:SCB.GET
DSKB:USEFUL.GET
DSKB:KERNEL.GET
DSKB:BCPLIB.MAS
DSKB:GLOBAL.REL
DSKB:LOWLIB.REL

Now on the user account delete the failed compiler outputs and try again with execute:

.del hello.rel,hello.exe
Files deleted:
DSKB:HELLO.REL
DSKB:HELLO.EXE
17 Blocks freed

.execute hello.bcp
BCPL: HELLO 400027/2
LINK: Loading
[LNKXCT BCPL execution]
?
?PC out of bounds at user PC 420504

Well we have a working compiler that feeds the linker, but the output executable seems to be broken in someway as the PC seems to be pointing to a bad address. In linux/unix terms its the old Segmentation Fault error and this is where it gets difficult. Still BCPL is installed and seemingly working, if only the executables produced would work. My first guess is that this is probably a library issue as they came pre-compiled on the BCPL tape, and so may not be 100% compatible with the latest 7.04 monitor. So the next step will be to either use DDT (the debugger) to see what the cause is, or just have a go at re-compiling the BCPL library from source and see if that fixes it.

About Quentin

Im just a normal bloke.
This entry was posted in Retro Computing and tagged , , , , , . Bookmark the permalink.

3 Responses to Installing BCPL

  1. I’m following this with great interest!

  2. John Forecast says:

    WRITES() requires a stream descriptor as the first argument. If we change the example code to:

    .type hello.bcp
    GET “BCL:BCPLIB”

    LET START() BE
    $(
    WRITES(TTY, “Hello, world!!!*C*L”)
    $)

    we get:

    .execute hello.bcp/save
    BCPL: HELLO 400031/2
    LINK: Loading
    [LNKXCT BCPL execution]
    Hello, world!!!

    EXIT

Leave a Reply

Your email address will not be published. Required fields are marked *