Installing 2.11BSD on an RP07 (longish)?

230 views
Skip to first unread message

Bill Backstrom

unread,
Aug 25, 2022, 3:39:39 PM8/25/22
to [PiDP-11]
I'm trying to create a bootable version 2.11BSD on an RP07 disk in simh. My goal is to use this with PDP2011 so I'm following the order of operation from Sytse's installation
(https://pdp2011.sytse.net/wordpress/howto/2-11bsd-rp06).

I'm using the same simh initialization except changing rp06 to rp07:
----------------------------------------
set cpu 11/70 4m
set rp enable
set rp0 rp07
attach rp0 211bsd-rp07.dsk
set tm disable
set ts enable
set ts0 capac=0,locked
attach ts0 ./tape0%
----------------------------------------
I've partitioned the disk as follows:
----------------------------------------
d(isplay) n(umber) s(elect) q(uit)? d

type: SMD
disk: SMD
label: DEFAULT
flags:
bytes/sector: 512
sectors/track: 50
tracks/cylinder: 32
sectors/cylinder: 1600
cylinders: 630
rpm: 3600
drivedata: 1 0 0 0 0

8 partitions:
#        size   offset    fstype   [fsize bsize]
  a: 16000 0  2.11BSD    1024 1024      # (Cyl. 0 - 9)
  b: 17600 16000  swap                  # (Cyl. 10 - 20)
  g: 486400 33600  2.11BSD    1024 1024         # (Cyl. 21 - 324)
  h: 486400 520000  2.11BSD    1024 1024        # (Cyl. 325 - 628)
----------------------------------------
Created file systems on the three bsd partitions, copied /root, /usr from tape, booted and
installed the boot sector:
----------------------------------------
70Boot from ts(0,0,2) at 0172522
: ts(0,3)
Boot: bootdev=01003 bootcsr=0172522
Restor
Tape? ts(0,5)
Disk? xp(0,0,0)
Last chance before scribbling on disk. End of tape

70Boot from ts(0,0,3) at 0172522
: xp(0,0,0)unix
Boot: bootdev=05000 bootcsr=0176700

2.11 BSD UNIX #115: Tue Nov 26 18:41:59 CST 2019
    s...@vernon.2bsd.com:/usr/src/sys/GENERIC
<snip>
xp 0 csr 176700 vector 254 attached
erase, kill ^U, intr ^C
# date 2208242010
date: can't write wtmp file.
Wed Aug 24 20:10:00 CDT 2022
# dd if^C
# dd if=/mdec/hpuboot of=/dev/rxp0a count=1
----------------------------------------
I followed the process down to the point of the reboot before compiling the new kernel, but I can't boot directly from the disk image. If I do a "boot rp" or "boot rp0" I do not get a prompt. I have hit "ctrl-e" to halt simh.
----------------------------------------
<1030> pdp11 simh.ini

PDP-11 simulator V3.12-2
Disabling XQ
sim> boot rp

Simulation stopped, PC: 157264 (TST (R0))
----------------------------------------
From there I can "boot ts" from the tape and then load the kernel from the disk. I can go from single user to multi user like normal and the new partitions are there, I just can't
boot directly from the disk image.
----------------------------------------
sim> boot ts

70Boot from ts(0,0,0) at 0172522
: xp(0,0,0)unix
Boot: bootdev=05000 bootcsr=0176700

2.11 BSD UNIX #115: Tue Nov 26 18:41:59 CST 2019
    s...@vernon.2bsd.com:/usr/src/sys/GENERIC


phys mem  = 3932160
avail mem = 3707264
user mem  = 307200

I don't think I've missed any steps (I can post a complete installation script if that helps) but I'm wondering what I've missed.

Thanks,
Bill

Johnny Billquist

unread,
Aug 25, 2022, 5:05:30 PM8/25/22
to pid...@googlegroups.com
First of all, I'd use disklabel to install the boot block instead of
using dd. Second, since you have xp0a mounted, you might have problems
installing the boot block at the same time (try xp0c instead?).

Also, check that you do have xp0c defined. It should be the whole disk.
No need to set a type on it. But it should exist, at least by convention.

But the problem might be because of other reasons as well. This is
sortof a tricky thing to debug. Since you can boot from the disk using
the boot program from tape, the problem have to be either the boot block
or the boot program.

Check that you in fact do have a /boot which is the boot program. If
that is missing, you won't get anywhere. Second, try installing the boot
block. Even if done using dd, after you've done it, do an abrupt halt
and reboot. Do not use reboot, since that will sync back the file
system, which might overwrite your boot block (I can't remember for
sure, but it's another potential reason/problem).

Johnny
> --
> 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/d58a1de1-c46b-41b7-9c50-6df3c525406fn%40googlegroups.com
> <https://groups.google.com/d/msgid/pidp-11/d58a1de1-c46b-41b7-9c50-6df3c525406fn%40googlegroups.com?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

Bill Backstrom

unread,
Aug 25, 2022, 9:32:10 PM8/25/22
to [PiDP-11]
Hi Johnny,

Thanks for the tips. I added a c partition covering the whole disk:

8 partitions:
#        size   offset    fstype   [fsize bsize]
  a: 16000 0  2.11BSD    1024 1024      # (Cyl. 0 - 9)
  b: 17600 16000  swap                  # (Cyl. 10 - 20)
  c: 1006400 0  unused    1024 1024     # (Cyl. 0 - 628)

  g: 486400 33600  2.11BSD    1024 1024         # (Cyl. 21 - 324)
  h: 486400 520000  2.11BSD    1024 1024        # (Cyl. 325 - 628)

Booted from tape and then the disk and tried disklabel to write the bootstrap (in a few variations);

# disklabel -B /dev/rxp0c -b hpuboot
disklabel: /mdec/xpuboot: No such file or directory
# disklabel -B /dev/rxp0c -b hpuboot rp07
disklabel: /mdec/xpuboot: No such file or directory
# disklabel -B /dev/xp0c -b hpuboot
disklabel: /mdec/xpuboot: No such file or directory

No idea where it is getting xpuboot from, it does not exist in mdec:

# ls mdec
bruboot    hkuboot    rauboot    rluboot    rm05uboot  rx02uboot  si94uboot
dvhpuboot  hpuboot    rkuboot    rm03uboot  rx01uboot  si51uboot  si95uboot

or in /etc/disktab. Which might be the problem? Does RP07 need a special bootstrap?

There is a /boot and dumping strings /boot from the RP07 disk and a working RP06 look the same.

Sytse van Slooten

unread,
Aug 26, 2022, 6:58:58 AM8/26/22
to Bill Backstrom, [PiDP-11]
The issue is that the boot block has the geometry of the disk in it - hard coded. And the geometry is different between rp0[456] and rp07.

How to fix: go into /usr/src/sys/mdec, edit hpuboot.s, near the bottom find two lines:
	div	$22.*19.,r0
and
 
	div	$22.,r0

for rp06, that needs to be 50 instead of 22, and 32 instead of 19.
then run make; make install in that directory, go into /mdec and dd hpuboot onto the boot disk. No need for tricks with disklabel.

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/0a9ff69b-2a71-4096-b07e-bd1d1b2afbe0n%40googlegroups.com.

Johnny Billquist

unread,
Aug 26, 2022, 2:38:58 PM8/26/22
to pid...@googlegroups.com
Bill. Sytse pointed out the primary problem. The bootstraps are
different for the different type of disks.

However, as for your problems with disklabel, I haven't checked the
code, but I suspect the order of arguments matter. Follow the man-page:

disklabel -B -b <file> <disk>

Don't move the arguments around. Many of the programs are not that
clever in parsing arguments.

But take either hpuboot, or even more proper - rm05uboot. In spite of
the RP07 saying "RP" it actually have more commonality with the RM
drives. But the only thing that really matters around here is the
geometry. For basic operations, all Massbus disks are similar enough in
the other aspects. There are some differences when it comes to error
recovery and formatting, but that's not anything visible in the boot
block anyway.

Johnny
> <https://pdp2011.sytse.net/wordpress/howto/2-11bsd-rp06>).
> > # date 2208242010 <tel:(220)%20824-2010>
> <https://groups.google.com/d/msgid/pidp-11/d58a1de1-c46b-41b7-9c50-6df3c525406fn%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/pidp-11/d58a1de1-c46b-41b7-9c50-6df3c525406fn%40googlegroups.com?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
>
> --
> 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/0a9ff69b-2a71-4096-b07e-bd1d1b2afbe0n%40googlegroups.com
> <https://groups.google.com/d/msgid/pidp-11/0a9ff69b-2a71-4096-b07e-bd1d1b2afbe0n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Bill Backstrom

unread,
Aug 26, 2022, 5:18:54 PM8/26/22
to [PiDP-11]
That did the trick, thanks! I haven' tried it on the FPGA yet, I know I need to change rh_type and haven't made any of the kernel changes etc but this is great.

BTW, you were correct about the scarcity of enc424J600 based ethernet modules. Any idea if enc28J60 is compatible? I'm guessing it isn't, but they seem plentiful and cheap so if there is a chance I'd be willing to try one.
I've got slip set up between the FPGA and a raspberry pi for networking. It's slow but rock solid and plenty for ntp and a few telnet sessions.

Bill Backstrom

unread,
Aug 26, 2022, 5:23:00 PM8/26/22
to [PiDP-11]
You were right, I had the arguments rearranged. In my defense I was following an example from the disklabel man page:
----
     Install a new bootstrap on ra0.  The boot code comes from
     /mdec/rauboot.  On-disk and in-core labels are unchanged.

          disklabel -w -B /dev/rra0a -b newboot ra81x
----
Your examples worked much better though ;)
Thanks,
Bill

Sytse van Slooten

unread,
Aug 26, 2022, 8:00:13 PM8/26/22
to Bill Backstrom, [PiDP-11]
No, enc28j80 isn't compatible.

It'd be doable to make it work - as in, I think it'd 'only' or 'mostly' need microcode changes - as in, the code running in the embedded cpu within the xu controller, the thing that drives the enc chip. But I haven't looked at the enc28, ever, so no clue how difficult it would be. Definitely nontrivial though, the concept of the chip is similar but it's still quite different.

Johnny Billquist

unread,
Aug 27, 2022, 7:15:56 AM8/27/22
to pid...@googlegroups.com
Hi.

On 2022-08-26 23:23, Bill Backstrom wrote:
> You were right, I had the arguments rearranged. In my defense I was
> following an example from the disklabel man page:
> ----
>      Install a new bootstrap on ra0.  The boot code comes from
>      /mdec/rauboot.  On-disk and in-core labels are unchanged.
>
>           disklabel -w -B /dev/rra0a -b newboot ra81x
> ----
> Your examples worked much better though ;)

Oh. Bloody hell. I hadn't noticed there was an example down at the
bottom of the page, that showed that sequence. The rest of the man-page
shows a different order.

I'll fix that man-page as well. Thanks for noticing.

Johnny
> > > # date 2208242010 <tel:(220)%20824-2010> <tel:(220)%20824-2010>
> <https://groups.google.com/d/msgid/pidp-11/0a9ff69b-2a71-4096-b07e-bd1d1b2afbe0n%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/pidp-11/0a9ff69b-2a71-4096-b07e-bd1d1b2afbe0n%40googlegroups.com?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
>
> --
> 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/30974762-24e3-4ddc-9f5c-414edf46bb4bn%40googlegroups.com
> <https://groups.google.com/d/msgid/pidp-11/30974762-24e3-4ddc-9f5c-414edf46bb4bn%40googlegroups.com?utm_medium=email&utm_source=footer>.

Bill Backstrom

unread,
Aug 27, 2022, 3:51:00 PM8/27/22
to [PiDP-11]
General fsck question. I thought I'd been careful about doing orderly shutdowns and I've been runing 'fsck -p' on boot every time and not seeing any problem. On a whim today I booted and while in single user ran fsck on the /usr partition and got:

# fsck -p /dev/rxp0g
/dev/rxp0g:
NEED SCRATCH FILE (179 BLKS)

/dev/rxp0g: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.

So I tried:

# fsck /dev/rxp0g
** /dev/rxp0g
File System: /usr


NEED SCRATCH FILE (179 BLKS)
ENTER FILENAME:  scratch
** File system is clean; not checking
#

I see the same on the other partition  that I've mounted /home on, but I haven't touched that filesystem yet.

It's very possible I've messed something up working through the boot issues and I've got no problem starting the installation process over again if that's the safest path.

Johnny Billquist

unread,
Aug 27, 2022, 4:04:53 PM8/27/22
to pid...@googlegroups.com
This is just that fsck can't handle large partitions without a temporary
file to keep data in. Memory space is just too limited.
Check the man-page for fsck. Specifically the -t switch.
Or check /etc/rc, where you can see how fsck is invoked if you boot
"autoboot" which properly goes to multiuser instead of going to singler
user and from there go to multiuser.

Johnny
> <https://groups.google.com/d/msgid/pidp-11/30974762-24e3-4ddc-9f5c-414edf46bb4bn%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/pidp-11/30974762-24e3-4ddc-9f5c-414edf46bb4bn%40googlegroups.com?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
>
> --
> 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/dded6ebf-658e-4efa-ae8b-8408c9d00f19n%40googlegroups.com
> <https://groups.google.com/d/msgid/pidp-11/dded6ebf-658e-4efa-ae8b-8408c9d00f19n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Clem Cole

unread,
Aug 27, 2022, 4:29:14 PM8/27/22
to Bill Backstrom, [PiDP-11]
try: fsck -t /tmp/scratch /dev/rxp0g

This assumes you have enough space in the /tmp directory to open the temp file.
This will be interactive, and you will need to answer all Ted and my questions as we look for problems.


If you want to learn a little about how dorked the FS is try: fsck -t /tmp/scratch -n /dev/rxp0g
The -n will reply "no" to everything and tell you what is happening --> BTW -- this is handy to see if this a serious issue or not.   To be fair, Kirk's -p (preen switch - that I think you already tried) was added a few years later which added some AI that does 'safe' clean up no matter what. But it only can go so far, so when it works it is great.

Finally, if you are feeling fearless:  fsck -t /tmp/scratch -y /dev/rxp0g
Adding -y will reply "yes" to things automatically, Ted and I added the -y switch when we wrote it since most errors are simple and can be cleaned up without a problem and doing it interactively (particularly on an ASR33) can be tedious.

BTW:  I'm not sure any of the 2xBSD doc's mention it.  There is a script one of us wrote a CMU original called mklost+found to create Ted's lost+found directory with a bunch of empty slots in the root of each FS.    It needs to be run once for each FS (usually after FS creation) and those slots to be created for fsck(8) to be able to recover lost files.  

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/dded6ebf-658e-4efa-ae8b-8408c9d00f19n%40googlegroups.com.

Johnny Billquist

unread,
Aug 27, 2022, 5:20:25 PM8/27/22
to pid...@googlegroups.com
2.11BSD fsck have -p. mklost+found is obsolete in 2.11BSD. fcsk can
create and extend the lost+found directory as needed. All is in the
man-pages.

Johnny

On 2022-08-27 22:28, Clem Cole wrote:
> try:fsck -t /tmp/scratch /dev/rxp0g
>
> This assumes you have enough space in the /tmpdirectory to open the temp
> file.
> This will be interactive, and you will need to answer all Ted and my
> questions as we look for problems.
>
>
> If you want to learn a little about how dorked the FS is try: fsck -t
> /tmp/scratch -n /dev/rxp0g
> The -n will reply "no" to everything and tell you what is happening -->
> BTW -- this is handy to see if this a serious issue or not.   To be
> fair, Kirk's -p (preen switch - that I think you already tried) was
> added a few years later which added some AI that does 'safe' clean up no
> matter what. But it only can go so far, so when it works it is great.
>
> Finally, if you are feeling fearless:  fsck -t /tmp/scratch -y /dev/rxp0g
> Adding -y will reply "yes" to things automatically, Ted and I added the
> -y switch when we wrote it since most errors are simple and can be
> cleaned up without a problem and doing it interactively (particularly on
> an ASR33) can be tedious.
>
> BTW:  I'm not sure any of the 2xBSD doc's mention it.  There is a script
> one of us wrote a CMU original called mklost+found to create
> Ted'slost+found directory with a bunch of empty slots in the root of
> each FS.    It needs to be run once for each FS (usually after FS
> creation) and those slots to be created for fsck(8) to be able to
> recover lost files.
> <https://groups.google.com/d/msgid/pidp-11/30974762-24e3-4ddc-9f5c-414edf46bb4bn%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/pidp-11/30974762-24e3-4ddc-9f5c-414edf46bb4bn%40googlegroups.com?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
>
> --
> 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/dded6ebf-658e-4efa-ae8b-8408c9d00f19n%40googlegroups.com
> <https://groups.google.com/d/msgid/pidp-11/dded6ebf-658e-4efa-ae8b-8408c9d00f19n%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/CAC20D2PgY77uzksh-3%2BSJppe5vwEyWL4XJQKqWsR-SPRX1Mx-Q%40mail.gmail.com
> <https://groups.google.com/d/msgid/pidp-11/CAC20D2PgY77uzksh-3%2BSJppe5vwEyWL4XJQKqWsR-SPRX1Mx-Q%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Bill Backstrom

unread,
Aug 27, 2022, 5:36:47 PM8/27/22
to [PiDP-11]
Ah, thank you. With the scratch file specified the terrifying warning went away. Sorry for the bother, but I'll remember this for a long time.

Bill

Clem Cole

unread,
Aug 27, 2022, 6:09:56 PM8/27/22
to Johnny Billquist, pid...@googlegroups.com
On Sat, Aug 27, 2022 at 5:20 PM Johnny Billquist <b...@softjar.se> wrote:
2.11BSD fsck have -p.
Yes, I know, and I mentioned it - 2xBSD got it from Kirk's FFS version.

 
mklost+found is obsolete in 2.11BSD. fcsk can
create and extend the lost+found directory as needed.
I have not looked at it in years.  FWIW, Ted and I always thought was a bad idea on a damaged disk, which is why we did not put it there in the first place.  Kirk and I talked about it a few years later, and I don't think he did it either in his update for the FFS.   Having the space pre-allocated seems like a much safer and easier way to go than trying to grab it from the free space when the disk is currently being repaired. You know the blocks are there and already allocated to the directory.

Warner Losh

unread,
Aug 27, 2022, 7:29:11 PM8/27/22
to Bill Backstrom, [PiDP-11]


On Sat, Aug 27, 2022, 3:36 PM Bill Backstrom <home.ba...@gmail.com> wrote:
Ah, thank you. With the scratch file specified the terrifying warning went away. Sorry for the bother, but I'll remember this for a long time.


Running 2BSD is like that sometimes....

Warner 
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/a47d04af-7d49-4f59-8818-39cf0df118ean%40googlegroups.com.

Clem Cole

unread,
Aug 27, 2022, 8:17:06 PM8/27/22
to Bill Backstrom, [PiDP-11]


On Sat, Aug 27, 2022 at 5:36 PM Bill Backstrom <home.ba...@gmail.com> wrote:
Ah, thank you.
Glad to hear it.  Just ensure you have enough space on the root FS for the temp file and you should be ok.
It is a great tool - remember its original name had one letter different ;-)

It's an early influence from the IBM world -- the late Ted Kowalski and I came to UNIX from MTS and TSS respectively - we had used IBM's disk scavager, and we were somewhat surprised when we discovered Ken never wrote anything like it.  At least one of the UNIX boxes was in an 11/40e with custom microcode, and thus crashes were not unheard of events.   fsck(8) became the product of necessity.

FWIW:  The -t switch was a cute piece of Ted's code circa 1976 when we got our first RP drive on an 11/40, and we blew out the size of tables.  IIRC Joy dropped it from the VAX version when the address space increased a few years later, but being able to run fsck(8) on a 64K shared I/D space machine was great, particularly for those of us that remember debugging/trying to put it back together a crashed file system with only icheck(8) and ncheck(8).
 
With the scratch file specified the terrifying warning went away. Sorry for the bother, but I'll remember this for a long time.

As Warner says, "Running 2BSD is like that sometimes...."

My old friend and Unix hacker Mike Zuhl once said this: "It is like learning to ride a motorcycle.  There are three phases.  At first, you are terrified.  Then you get overconfident.  Finally, you learn to respect it for what a great hack that it is."
Reply all
Reply to author
Forward
0 new messages