make, jove, 2.11BSD revisited

464 views
Skip to first unread message

Golden Richard

unread,
Aug 20, 2020, 12:00:30 PM8/20/20
to [PiDP-11]
OK, so I clearly hadn't had enough coffee (or alternatively, too much).  I'll try again.

I'm trying to compile the most recent version of Jove under the 2.11BSD included in the standard systems collection for the PiDP-11.

I inadvertently stated previously that the issue was with make.  It's clearly something else, as make works correctly in other contexts.  But make crashes with a bus error when I try to compile Jove 4.14.

Any thoughts?

BTW, if you're infuriated with not being able to use the arrow keys with jove, on a vt-100 and with Jove 4.09, just add these lines to .joverc:

bind-to-key ansi-codes ^[[
bind-to-key ansi-codes ^[O

I discovered this recently.

Cheers,

--Golden

David Johnson

unread,
Aug 20, 2020, 12:20:21 PM8/20/20
to Golden Richard, [PiDP-11]
This might be similar to an earlier problem that came up on this list, that the
stack space was overflowing because of too many/too long environment variables.
I forget what the solution might have been, but perhaps a search of the archives
might help.

--
You received this message because you are subscribed to the Google Groups "[PiDP-11]" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pidp-11+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pidp-11/26ac622a-3aad-427b-84d9-6653ca850073n%40googlegroups.com.

Golden Richard

unread,
Aug 20, 2020, 12:21:58 PM8/20/20
to [PiDP-11]
Ah-hah.  I will search.  This would make sense, because the jove makefile sets up a ridiculous number of environment variables.

Johnny Billquist

unread,
Aug 20, 2020, 5:35:37 PM8/20/20
to David Johnson, Golden Richard, [PiDP-11]
I also do seem to remember some thread that might have been about a
similar problem earlier.
Environment variables certainly might be the problem.

On a different note, if you want some other alternative to Jove, which
is sortof an Emacs clone, you could try NEMA. It's a hack I threw
together, which I've also made sure builds under 2.11BSD, and it can
edit very large files, and have (I think) reasonable key bindings.
It also happens to work under RSX, VMS and Linux...

Johnny

On 2020-08-20 18:20, David Johnson wrote:
> This might be similar to an earlier problem that came up on this list,
> that the
> stack space was overflowing because of too many/too long environment
> variables.
> I forget what the solution might have been, but perhaps a search of the
> archives
> might help.
>
>> On Aug 20, 2020, at 12:00 PM, Golden Richard <golden...@gmail.com
>> <mailto:golden...@gmail.com>> wrote:
>>
>> OK, so I clearly hadn't had enough coffee (or alternatively, too
>> much).  I'll try again.
>>
>> I'm trying to compile the most recent version of Jove under the
>> 2.11BSD included in the standard systems collection for the PiDP-11.
>>
>> I inadvertently stated previously that the issue was with make.  It's
>> clearly something else, as make works correctly in other contexts.
>>  But make crashes with a bus error when I try to compile Jove 4.14.
>>
>> Any thoughts?
>>
>> BTW, if you're infuriated with not being able to use the arrow keys
>> with jove, on a vt-100 and with Jove 4.09, just add these lines to
>> .joverc:
>>
>> bind-to-key ansi-codes ^[[
>> bind-to-key ansi-codes ^[O
>>
>> I discovered this recently.
>>
>> Cheers,
>>
>> --Golden
>>
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "[PiDP-11]" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an email to pidp-11+u...@googlegroups.com
>> <mailto:pidp-11+u...@googlegroups.com>.
>> <https://groups.google.com/d/msgid/pidp-11/26ac622a-3aad-427b-84d9-6653ca850073n%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "[PiDP-11]" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to pidp-11+u...@googlegroups.com
> <mailto:pidp-11+u...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pidp-11/645582BD-C1A0-435B-B93E-0C92DD8153B1%40brown.edu
> <https://groups.google.com/d/msgid/pidp-11/645582BD-C1A0-435B-B93E-0C92DD8153B1%40brown.edu?utm_medium=email&utm_source=footer>.

--
Johnny Billquist || "I'm on a bus
|| on a psychedelic trip
email: b...@softjar.se || Reading murder books
pdp is alive! || tryin' to stay hip" - B. Idol

Golden Richard

unread,
Aug 21, 2020, 10:37:51 AM8/21/20
to [PiDP-11]
Once I found the bind-to-key fixes for the installed version of JOVE, the urge to upgrade it went away, except for the fact that I don't like that I can't.  :)    I'm wondering how the other version of JOVE was compiled for 2.11.

Another disturbing memory issue is that adb seems to always give this error:

[7] root--> adb a.core
adb: no memory for symbols
adb>

I was originally going to use adb on the make core dumped when I tried to compile JOVE to see if it really looked like stack space was being exhausted, but no luck because of that error.  In this case, tho, a is simply 2-3 lines I threw together that deliberately seg fault, just so I'd get a core dump to test. 

Have I forgotten something about adb?  It has been a very long time.  Otherwise, any idea what might cause this?

Summary: I haven't used a PDP-11 for 30 years, but I don't recall memory errors at every turn when I did.  Things did have to be more efficient, but it was possible to get work done.  :)

Finally, yes, very interested in taking at look at NEMA.  Is the code posted somewhere?

Cheers,

--Golden

John Dow

unread,
Aug 21, 2020, 1:22:23 PM8/21/20
to Golden Richard, [PiDP-11]
More importantly, who’s managed to get rogue to build? :)

J

Sent from my iPhone

On 21 Aug 2020, at 15:37, Golden Richard <golden...@gmail.com> wrote:

Once I found the bind-to-key fixes for the installed version of JOVE, the urge to upgrade it went away, except for the fact that I don't like that I can't.  :)    I'm wondering how the other version of JOVE was compiled for 2.11.
To unsubscribe from this group and stop receiving emails from it, send an email to pidp-11+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pidp-11/35fbe48e-f8fd-4acf-a085-9b987b72d381n%40googlegroups.com.

Johnny Billquist

unread,
Aug 21, 2020, 7:48:15 PM8/21/20
to Golden Richard, [PiDP-11]
NEMA can be found at ftp://ne...@mim.update.uu.se/

And I can only say that in general I very seldom see any problems when I
work under 2.11BSD.

Can't really tell why you are having those problems.

The version that comes with 2.11BSD have the makefile in the source
tree, so you can easily see how it is compiled.

Johnny
> https://groups.google.com/d/msgid/pidp-11/35fbe48e-f8fd-4acf-a085-9b987b72d381n%40googlegroups.com
> <https://groups.google.com/d/msgid/pidp-11/35fbe48e-f8fd-4acf-a085-9b987b72d381n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Golden Richard

unread,
Aug 21, 2020, 8:29:36 PM8/21/20
to [PiDP-11]

RE: rogue, I didn't think it would be that big a deal, but surprises always await?

4.2BSD source for rogue compiles cleanly under BSD2.11, then...

<<drum roll>>

ld: /usr/lib/libcurses.a(refresh.o): text overflow

But mkovmake to the rescue?  Almost, but then missing symbols:

tputs, tgoto, tgetent, etc.

This makes no sense (?), as these clearly should be defined in libtermcap, which I specified...

Mark Lawler

unread,
Jun 30, 2021, 1:34:20 PM6/30/21
to [PiDP-11]
Half a year later and I'm now at the very same stopping point.  Has anybody gotten the game rogue to build on the 2.11 BSD on the PiDP-11/70?  I found the source over at, https://www.retro11.de/ouxr/211bsd/usr/src/games/rogue/, and was able to FTP all the source files over to my PiDP-11/70 running 2.11 BSD due to the great WiFi TCP/IP setup instructions provided in other threads on this forum and the April 29, 2019 draft of the PiDP-11 USER MANUAL.  However the make chokes at the same point shared by golden...

ld:/usr/lib/libcurses.a(refresh.o): text overflow
*** Exit 4
Stop.

Any ideas?  Surely somebody has done this given how many have gotten to to work under CP/M on the Altair and IMSAI kits.

Best,
-Mark

Paul Birkel

unread,
Jun 30, 2021, 4:06:55 PM6/30/21
to Mark Lawler, [PiDP-11]

I sure hope that you can push through to success!

 

And then get Rog-o-Matic running as well :->.  https://en.wikipedia.org/wiki/Rog-O-Matic

 

(source code: https://britzl.github.io/roguearchive/#rogomatic )

 

You’d watch it live; a fast and uncanny player.  A real beast!

 

Go Mark!!

Mark Lawler

unread,
Jun 30, 2021, 4:42:36 PM6/30/21
to [PiDP-11]
Over lunch, I noticed that the game hack has 2 makefiles, one of them specific to PDP-11s with overlays.  This seems to be a common error when making C programs on PDP-11s where the sizes of combined O files and libs get too big.  I'm hoping I can take the generic rogue makefile and use it to create a copy that leverages overlays to resize things to fit (using the pdp-11 specific makefile for hack as a model/example)...  Fingers crossed.  I'll have to do it after work or over the weekend though...

In other news, I was able to get the game hack to work over lunch!  This is what we played all the time back at the University of California campus I was at back in the mid 80's instead of rogue (hack has the dog that you can befriend to help you as well as lots of other monsters).  It was throwing lots of errors, but it appears that the games/lib/hackdir directory was missing the two empty text files perm and record with permissions set for read/write.  Looks like it and other games might have ended up in this BSD image after steps of the makefiles either failed or were simply copied over as binaries without copying other directories they depended.  That or they were not rebuilt from the original sources to begin with. Just guessing.  Anyways, add the two empty files and it works!  I was shocked to see no mentions of this program in this forum, which leads me to my next question...  

Is this the right forum / google group to post this stuff to or is there a better one for this specific 2.11 BSD image that I should post to instead?

Best,
-Mark

Adam Thornton

unread,
Jun 30, 2021, 4:44:33 PM6/30/21
to Paul Birkel, Mark Lawler, [PiDP-11]
That was about as far as I got with Rogue as well.  I played around a little with different overlay definitions but never had much success.  If you do get it working I would like to know the magic.

For Rog-O-Matic I think you’re going to need the VAX, though.

Clem Cole

unread,
Jun 30, 2021, 5:38:41 PM6/30/21
to Adam Thornton, Mark Lawler, Paul Birkel, [PiDP-11]
Interesting.  Ken did the work at UCB on the Ingres 11/70.  I had a version that ran on pure V7 on the Teklabs 11/70 I got from him in early 1980, so it did run without overlays at one point.   I played it until I tired of it and had the high score on teklabs machine fir a while but Charlie Perkins (of ipv6 fame) spent hours playing it trying to beat my score which he eventually crushed. 

I may have that binary somewhere I’ll look. 

--
Sent from a handheld expect more typos than usual

Mark Lawler

unread,
Jun 30, 2021, 7:35:22 PM6/30/21
to [PiDP-11]
Your wish is my command it appears: Rogue works!  So I played with the Makefile to use overlays and got it to not only compile, but run somewhat reliably.  That said the install option has errors that I didn't fix, but I'll let somebody else do that.  Some things to note: 
  • What is the BASE vs the various OV# overlays was chosen arbitrarily more as a proof of concept than as a scientific engineering exercise.  I didn't use size or any real logic as I broke things up.  I'll leave that to others to better organize / optimize.
  • Rogue assumes it can create and delete the file /usr/games/lib/rogue.lock.  You'll need to set permissions to allow for this.
  • Rogue assumes the file /usr/games/lib/rogue.scores already exists and is of 0 bytes in length in the very beginning.  I had to create it by hand.  Also the program must have permissions to read and write that file as well.  It'll maintain the top 10 high scores (kinda).
  • The scores file doesn't seem to store the actual score though.  For some reason the scores were always 0 even though all the other fields were correct.  I'll leave to others to figure out why.
Here is the modified Makefile for the PiDP-11/70, preserving the copyright and redistribution attributions in the file.

#
# Copyright (c) 1987 Regents of the University of California.
# All rights reserved.
#
# Redistribution and use in source and binary forms are permitted
# provided that this notice is preserved and that due credit is given
# to the University of California at Berkeley. The name of the University
# may not be used to endorse or promote products derived from this
# software without specific written prior permission. This software
# is provided ``as is'' without express or implied warranty.
#
# @(#)Makefile 5.3.1 (2.11BSD) 1996/12/1
#
# Modified June 2021 by Mark Lawler for the PDP-11 to use 
# overlays.  No attention as paid to sizing them correctly, and
# there is most like a better choice of file groupings to
# better size each overlay and better match the right files together.
#
CFLAGS= -O -DUNIX -DUNIX_BSD4_2
SRCS= curses.c \
hit.c \
init.c \
inventory.c \
level.c \
machdep.c \
main.c \
message.c \
monster.c \
move.c \
object.c \
pack.c \
play.c \
random.c \
ring.c \
room.c \
save.c \
score.c \
spec_hit.c \
throw.c \
trap.c \
use.c \
zap.c

OBJS= curses.o \
hit.o \
init.o \
inventory.o \
level.o \
machdep.o \
main.o \
message.o \
monster.o \
move.o \
object.o \
pack.o \
play.o \
random.o \
ring.o \
room.o \
save.o \
score.o \
spec_hit.o \
throw.o \
trap.o \
use.o \
zap.o

BASE = main.o random.o move.o curses.o

OV1 = hit.o init.o inventory.o level.o machdep.o

OV2 = message.o monster.o object.o pack.o play.o ring.o room.o 

OV3 = save.o score.o spec_hit.o throw.o trap.o use.o zap.o

all: rogue

rogue: $(OBJS)
@echo "Loading ..."
@ld -i -X -x -o rogue /lib/crt0.o $(BASE) -Z $(OV1) -Z $(OV2) -Z $(OV3) -Y -lcurses -ltermlib -lc
@echo "Load complete"

clean: FRC
rm -f ${OBJS} core rogue

depend: FRC
mkdep ${CFLAGS} ${SRCS}

install: rogue
install -s -o games -g bin -m 4700 rogue ${DESTDIR}/usr/games/hide
(cd ${DESTDIR}/usr/games; rm -f rogue; ln -s dm rogue; chown games.bin rogue)

lint: FRC
lint ${CFLAGS} ${SRCS}

tags: FRC
ctags ${SRCS}

FRC:

# DO NOT DELETE THIS LINE -- mkdep uses it.
# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.

curses.o: curses.c
hit.o: hit.c rogue.h /usr/include/curses.h /usr/include/stdio.h
hit.o: /usr/include/sgtty.h /usr/include/sys/ioctl.h
hit.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h
init.o: init.c /usr/include/stdio.h rogue.h /usr/include/curses.h
init.o: /usr/include/stdio.h /usr/include/sgtty.h /usr/include/sys/ioctl.h
init.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h
inventory.o: inventory.c rogue.h /usr/include/curses.h /usr/include/stdio.h
inventory.o: /usr/include/sgtty.h /usr/include/sys/ioctl.h
inventory.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h
level.o: level.c rogue.h /usr/include/curses.h /usr/include/stdio.h
level.o: /usr/include/sgtty.h /usr/include/sys/ioctl.h
level.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h
machdep.o: machdep.c /usr/include/stdio.h /usr/include/sys/types.h
machdep.o: /usr/include/sys/file.h /usr/include/sys/stat.h /usr/include/pwd.h
machdep.o: /usr/include/sys/time.h /usr/include/time.h /usr/include/sgtty.h
machdep.o: /usr/include/sys/ioctl.h /usr/include/sys/ttychars.h
machdep.o: /usr/include/sys/ttydev.h /usr/include/signal.h
machdep.o: /usr/include/machine/trap.h rogue.h /usr/include/curses.h
machdep.o: /usr/include/stdio.h /usr/include/sgtty.h
main.o: main.c rogue.h /usr/include/curses.h /usr/include/stdio.h
main.o: /usr/include/sgtty.h /usr/include/sys/ioctl.h
main.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h
message.o: message.c /usr/include/stdio.h rogue.h /usr/include/curses.h
message.o: /usr/include/stdio.h /usr/include/sgtty.h /usr/include/sys/ioctl.h
message.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h
monster.o: monster.c rogue.h /usr/include/curses.h /usr/include/stdio.h
monster.o: /usr/include/sgtty.h /usr/include/sys/ioctl.h
monster.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h
move.o: move.c rogue.h /usr/include/curses.h /usr/include/stdio.h
move.o: /usr/include/sgtty.h /usr/include/sys/ioctl.h
move.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h
object.o: object.c rogue.h /usr/include/curses.h /usr/include/stdio.h
object.o: /usr/include/sgtty.h /usr/include/sys/ioctl.h
object.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h
pack.o: pack.c rogue.h /usr/include/curses.h /usr/include/stdio.h
pack.o: /usr/include/sgtty.h /usr/include/sys/ioctl.h
pack.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h
play.o: play.c rogue.h /usr/include/curses.h /usr/include/stdio.h
play.o: /usr/include/sgtty.h /usr/include/sys/ioctl.h
play.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h
random.o: random.c
ring.o: ring.c rogue.h /usr/include/curses.h /usr/include/stdio.h
ring.o: /usr/include/sgtty.h /usr/include/sys/ioctl.h
ring.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h
room.o: room.c rogue.h /usr/include/curses.h /usr/include/stdio.h
room.o: /usr/include/sgtty.h /usr/include/sys/ioctl.h
room.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h
save.o: save.c /usr/include/stdio.h rogue.h /usr/include/curses.h
save.o: /usr/include/stdio.h /usr/include/sgtty.h /usr/include/sys/ioctl.h
save.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h
score.o: score.c /usr/include/stdio.h rogue.h /usr/include/curses.h
score.o: /usr/include/stdio.h /usr/include/sgtty.h /usr/include/sys/ioctl.h
score.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h
spec_hit.o: spec_hit.c rogue.h /usr/include/curses.h /usr/include/stdio.h
spec_hit.o: /usr/include/sgtty.h /usr/include/sys/ioctl.h
spec_hit.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h
throw.o: throw.c rogue.h /usr/include/curses.h /usr/include/stdio.h
throw.o: /usr/include/sgtty.h /usr/include/sys/ioctl.h
throw.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h
trap.o: trap.c rogue.h /usr/include/curses.h /usr/include/stdio.h
trap.o: /usr/include/sgtty.h /usr/include/sys/ioctl.h
trap.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h
use.o: use.c rogue.h /usr/include/curses.h /usr/include/stdio.h
use.o: /usr/include/sgtty.h /usr/include/sys/ioctl.h
use.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h
zap.o: zap.c rogue.h /usr/include/curses.h /usr/include/stdio.h
zap.o: /usr/include/sgtty.h /usr/include/sys/ioctl.h
zap.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h

# IF YOU PUT ANYTHING HERE IT WILL GO AWAY

Best,
-Mark

Adam Thornton

unread,
Jun 30, 2021, 8:49:32 PM6/30/21
to Mark Lawler, [PiDP-11]
That’s magnificent!  Thank you!

Geert Rolf

unread,
Jul 1, 2021, 5:55:32 AM7/1/21
to [PiDP-11]
To my surprise line 12 of the Makefile for rogue states:
                                                             @(#)Makefile    5.3.1 (2.11BSD) 1996/12/1

rogue, vi, jove are big for 16 bit iron...  that's why 11/45, /50, /55, /44, /70 and the /53, /73, /83, /84, /93, /94 are/were loved for their Separated I&D.

Size of rogue on my "handheld Gould PowerNode" (=SIMH/sel32 on RPI-4):
text    data    bss     dec     hex
212992  24576   14696   252264  3d968
data + bss is no problem. The text is about a 32 bit machine.... could be a lot better, but well over 64KB.

Geert

Mark Lawler

unread,
Jul 2, 2021, 6:43:03 PM7/2/21
to [PiDP-11]
Turns out the issue with getting the correct score into the rogue score files was a very easy code fix.  I was able to find/fix the error in the score file claiming the score is always 0 when saved to disk (Note: see earlier post for the creation of the save files and permissions required to save scores).

In the file score.c it is a matter of line 301 being changed from this
      sprintf(buf, "%2d    %6d   %s: ", rank+1, rogue.gold, login_name);

to this instead
      sprintf(buf, "%2d    %6ld   %s: ", rank+1, rogue.gold, login_name);

Since rogue.gold is a long, the original source code would simply set the value to 0 in the sprintf() call due to invalid masking.

I suspect this also means there could be other aspects of this source that should probably be reviewed for full compatibility on BSD 2.11 on a PDP-11.  That said it appears to be playing fine now and keeping score wonderfully!  Enjoy!

Best,
-Mark

Warner Losh

unread,
Jul 2, 2021, 6:51:01 PM7/2/21
to Mark Lawler, [PiDP-11]
If you look at the history of 2.xBSD, this is a very common type of bug that was fixed in the code
ported over from the 4BSD line. Complaints and/or snarky remarks about int vs long errors are
common if you look at the usenet archives...

Warner

Geert Rolf

unread,
Jul 5, 2021, 6:42:03 AM7/5/21
to [PiDP-11]
Well done!!!

Lucky us... -- we all ordered our PDP 11/70s with 4MB memory ;-)
Reply all
Reply to author
Forward
0 new messages