Bash for PiDP-11 BSD 2.11?

299 views
Skip to first unread message

John Winslade

unread,
Dec 11, 2023, 4:14:37 PM12/11/23
to [PiDP-11]
Does anyone know of a bash shell for the BSD 2.11?

I know I could probably make one from the various sources, but if someone knows of one that will drop in or build without a lot of futzing around I would appreciate it.

Thanks.

Johnny Billquist

unread,
Dec 11, 2023, 4:32:45 PM12/11/23
to pid...@googlegroups.com
No bash for 2.11BSD, and you can probably forget ever getting it.
You have sh if you really want that.

If you want a nice interactive experience, learn tcsh.

But good luck trying to futz bash into 64K.

Johnny

--
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

Warner Losh

unread,
Dec 11, 2023, 5:15:05 PM12/11/23
to Johnny Billquist, pid...@googlegroups.com
On Mon, Dec 11, 2023 at 2:32 PM Johnny Billquist <b...@softjar.se> wrote:
On 2023-12-11 22:14, John Winslade wrote:
> Does anyone know of a bash shell for the BSD 2.11?
>
> I know I could probably make one from the various sources, but if
> someone knows of one that will drop in or build without a lot of futzing
> around I would appreciate it.

No bash for 2.11BSD, and you can probably forget ever getting it.
You have sh if you really want that.

If you want a nice interactive experience, learn tcsh.

But good luck trying to futz bash into 64K.

Agreed. Some numbers.

2.11BSD/V7 /bin/sh is 15-18kk all in. tcsh is ~150k. The largest binary in 2.11BSD
tcsh at 150k. I've done experiments that created binaries as large as 250k, but
the swapping was a bit crazy...

On my FreeBSD box, bash (and also ksh93) are each 1MB+. Data is close to the 64k
limit in both cases, so it is theoretically possible, but the .o's aren't well laid out to fit
neatly into 8k segments (and there are several functions larger than 8k if my quick
peek at symbols isn't lying to me). It's quite tricky to even know where to start. So it's
about 5-10x too large

Warner

Johnny Billquist

unread,
Dec 11, 2023, 5:35:10 PM12/11/23
to Warner Losh, pid...@googlegroups.com
Just one small comment. Functions don't need to be smaller than 8K, not
does an overlay segment. The size of the overlay segments are rounded up
to the next 8K boundary, but it could be 16K just as well as 8K.

See tcsh for example:

simh:/home/bqt> size /bin/tcsh
text data bss dec hex
48384 14478 11936 74798 1242e total text: 140352
overlays: 15424,16000,14208,14080,16256,16000

All overlays are close to 16K each, with a base of 48K. Which in the end
keeps things below 64K.

But I think your numbers speak for them selves, Warner. Getting bash
into 2.11BSD is more than just some futzing...

Johnny Billquist

unread,
Dec 11, 2023, 6:14:01 PM12/11/23
to pid...@googlegroups.com
By the way, while tcsh is certainly big, the largest binary I've found
on 2.11BSD is actually hack.

Kermit also sortof is a big heavier than tcsh. But so far, I think tcsh
comes in third. :-)

simh:/home/bqt# ls -l /usr/games/hack /usr/new/kermit /bin/tcsh
-r-xr-xr-x 1 bin 154878 Apr 29 2023 /bin/tcsh
-rws--x--x 1 daemon 194570 Apr 29 2023 /usr/games/hack
-rwxr-x--x 1 root 166045 Aug 12 2009 /usr/new/kermit
simh:/home/bqt# size /usr/games/hack /usr/new/kermit /bin/tcsh
text data bss dec hex
37568 32236 12400 82204 1411c /usr/games/hack total text: 148224
overlays: 24512,24192,22528,18688,20736
48640 20728 25162 94530 17142 /usr/new/kermit total text: 103680
overlays: 13440,15744,14720,11136
48384 14478 11936 74798 1242e /bin/tcsh total text: 140352
overlays: 15424,16000,14208,14080,16256,16000

Johnny

John Winslade

unread,
Dec 11, 2023, 7:26:26 PM12/11/23
to [PiDP-11]

Thanks everyone, but I would SWEAR that we had a bash on a 11-70 running Ultrix at the university back in 1995 or so.  It may have been a student hack.  Yes, I really wish I would have saved sources and such from those days.

Digby R.S. Tarvin

unread,
Dec 11, 2023, 7:39:27 PM12/11/23
to pid...@googlegroups.com
I'd say definitely not practical except as a challenge to push the boundaries of what is possible on a PDP11, and accepting that the result may be too slow to be practically useful.

I did similar things with an 8 bit 6809 system in the dim distant past (trying to reproduce the Unix environment I really wanted back before they were affordable for hobbyists). I ended up with 1MB of memory connected via a mechanism that allow 32 x 2K segments to be mapped into the processor address space (with a 5MB hard disk for files and swapping). No separate I & D, so it was more limited than the 11/70, but it did suppose swapping to a 'system' mapping on receipt of an interrupt, so the O/S did not occupy any of the application address space. With a bit of effort you could produce a program of nearly 1MB so long as no individual function and its associated data exceeded the 64K limit. For anyone that is interested:
I used one of the physical address bits as a write protect, so 1MB rather than 2MB maximum physical memory. The hardware also had a 2K 'poison' address that could be mapped into unused parts of a process's address space - so accessing unallocated memory products an interrupt that could terminate the process. (6809 had no illegal instruction traps, and there were some illegal instructions that would lock up the processor if a program went off the rails).

The simplest solution was to write an interpreter/emulator simulating a machine with a larger address space, and let the interpreter handle the mapping, and if necessary swapping if the 1MB was exceeded. Otherwise your application needs to do the mapping explicitly. I did get a Unix like shell going within the 64K available without needing paging, but it was a rewrite rather than attempting to get the existing source to build. Just getting the wild card expansion in was a challenge.

I'd still like to have a go at writing a small xlib library for BSD2.11 (not the server, just the library for accessing an external server), as that would provide some functionality which is not currently there. But I don't find the extra functionality in bash over the existing BSD2.11 shells enough to justify the effort of trying to do a port - but just xlib, none of the libraries that layered on top of it. I used to find that programs using just xlib did not bloat too much for small machines.

I am in any case quite impressed by how much functionality the BSD2.11 implementers have managed to squeeze into such a constrained system. I rarely encounter limits except when trying to port code from modern more bloated systems... 

--
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/25d9aa3d-e226-4f64-987e-a08233cf28b7%40softjar.se.

Johnny Billquist

unread,
Dec 11, 2023, 8:11:45 PM12/11/23
to pid...@googlegroups.com
Timewise that would be back at bash v1. Not sure where you'd find that
today. But even so, I would actually be a little surprised if it
actually have been done. GNU in general, at that point, had long since
stated that they were not caring about getting anything running on the
PDP-11.
And I believe bash back in 1995 was still fairly big, in PDP-11 terms.

tcsh is still at 6.00 in 2.11BSD (which is from 1991). Any newer version
is just a no-go. And even that version had to be seriously poked at to
make it fit. It's not an effort I think anyone would like to do again.

But at least you know that it's bash v1 you would want to look for. v2
was released in 1996.

Good luck.

Johnny
> >>      > Does anyone know of a bash shell forthe BSD 2.11?
> --
> 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/4dbf487a-0d9b-49bb-9d16-bc076d059de5n%40googlegroups.com <https://groups.google.com/d/msgid/pidp-11/4dbf487a-0d9b-49bb-9d16-bc076d059de5n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Johnny Billquist

unread,
Dec 11, 2023, 8:15:48 PM12/11/23
to pid...@googlegroups.com
On 2023-12-12 01:39, Digby R.S. Tarvin wrote:
> I'd say definitely not practical except as a challenge to push the
> boundaries of what is possible on a PDP11, and accepting that the result
> may be too slow to be practically useful.

I do not expect that speed would be the big issue. Just getting running
would be. If you did get it running, I think it would be acceptable
speedwise.

> I'd still like to have a go at writing a small xlib library for BSD2.11
> (not the server, just the library for accessing an external server), as
> that would provide some functionality which is not currently there. But
> I don't find the extra functionality in bash over the existing BSD2.11
> shells enough to justify the effort of trying to do a port - but just
> xlib, none of the libraries that layered on top of it. I used to find
> that programs using just xlib did not bloat too much for small machines.

I've from time to time been thinking the same thing. Both for 2.11BSD as
well as for RSX. It could be an interesting thing to do.
But I don't know how much work it would require.

> I am in any case quite impressed by how much functionality the BSD2.11
> implementers have managed to squeeze into such a constrained system. I
> rarely encounter limits except when trying to port code from modern more
> bloated systems...

Indeed. 2.11BSD is quite complete and potent.

John Winslade

unread,
Dec 12, 2023, 6:51:15 AM12/12/23
to [PiDP-11]
I just built the PiDP-11 and I am trying to get the two better unices (BSD 2.11 and Ultrix) somewhat close to the other systems I regularly use.

David D Johnson

unread,
Dec 12, 2023, 7:04:49 AM12/12/23
to John Winslade, [PiDP-11]
So the original csh from Berkeley as well as the later tcsh both come with 2.11 BSD.
You might be able to find the sources for ksh.  No idea regarding the size and complexity
of the Korn shell, but probably nowhere near the size of bash.  I consider bash to be somewhat
of a merger between ksh and tcsh.  

-- 
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.

Warner Losh

unread,
Dec 12, 2023, 8:52:33 AM12/12/23
to David D Johnson, John Winslade, [PiDP-11]


On Tue, Dec 12, 2023, 5:04 AM David D Johnson <david_...@brown.edu> wrote:
So the original csh from Berkeley as well as the later tcsh both come with 2.11 BSD.
You might be able to find the sources for ksh.  No idea regarding the size and complexity
of the Korn shell, but probably nowhere near the size of bash.  I consider bash to be somewhat
of a merger between ksh and tcsh. 

On my FreeBSD system, Bash is about 100k smaller , but links in more shared libraries. 

Warner 

Heinz-Bernd Eggenstein

unread,
Dec 12, 2023, 3:48:48 PM12/12/23
to [PiDP-11]
For me, tcsh (in 2.11 BSD) is modern and feature-rich enough to justify the big footprint. It feels like riding a vintage 911 sort of (old but still...a 911). Some of the older shells were just a bit too much Ford Model T for my taste :-). I'm just too used to (or spoiled? by) command line history and auto-completion by key-stroke .

HB

Jeff Spears

unread,
Nov 3, 2024, 2:35:07 PM11/3/24
to [PiDP-11]
Greetings;
I am not a computer programmer by profession. Been playing with linux since early 1990's. So:

Would somebody please help me find a /bin/sh .profile for my home directory? Or anything else I may need?

Thank you;
Happy hacking!

Johnny Billquist

unread,
Nov 3, 2024, 2:37:10 PM11/3/24
to pid...@googlegroups.com
What do you mean by "find"?

Johnny
>> b...@softjar.se <http://softjar.se/>wrote:
>> visithttps://groups.google.com/d/msgid/pidp-11/288928f8-edc7-427f-8526-8936df757e3en%40googlegroups.com <https://groups.google.com/d/msgid/pidp-11/288928f8-edc7-427f-8526-8936df757e3en%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.
>
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pidp-11/93E14BD8-9AB8-4373-A5ED-96A56E45DF40%40brown.edu <https://groups.google.com/d/msgid/pidp-11/93E14BD8-9AB8-4373-A5ED-96A56E45DF40%40brown.edu?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
> To view this discussion visit
> https://groups.google.com/d/msgid/pidp-11/8d67b6be-5c17-40aa-9646-6a558e2100fan%40googlegroups.com <https://groups.google.com/d/msgid/pidp-11/8d67b6be-5c17-40aa-9646-6a558e2100fan%40googlegroups.com?utm_medium=email&utm_source=footer>.

Mark Rosenthal

unread,
Nov 3, 2024, 2:50:35 PM11/3/24
to [PiDP-11]
Apologies if this is a dumb question John, but I noticed your reference to a college machine at university in 1995.  Is it possible that the machine you remember running bash was a VAX 11/780 instead of a PDP 11/70?
Reply all
Reply to author
Forward
0 new messages