I finally broke down and got the pidp-11 to run on the latest 64 bit version of the raspberry pi OS.
It was more involved than you’d think so I thought I’d write down the steps for everyone who whats to give it a try.
So why make the change? These days most computing platforms are 64 bit. 32 bit versions are becoming obsolete. So going forward the sweet spot of compatibility will soon be 64 bit. 64 bit OS are also more efficient and can access more than 4 Gb of memory. Raspberry 3 and 4 pi hardware supports 64 bit OSes.
The other recent change is to get rid of the default “pi” user, which is a security risk. It also often makes sense to setup login using ssh keys instead of passwords, which is both more secure and less hassle since you don’t need to remember passwords.
So while I’m at it I’ll show you how to do all those things, and a couple more, as well.
The instructions are long and I hope there aren’t too many typos!
Start by downloading the latest Raspberry Pi Imager from:
I’m on a mac so I downloaded the macOS version, but I suspect the others work the same way.
Pop your SD card into the computer with the Raspberry Pi Imager and run the Imager.
Click “CHOOSE OS" to choose "Raspberry Pi OS (other)" -> "Raspberry Pi OS (64-bit)". Raspberry Pi OS Lite (64-bit) would probably also work, but I’m going to use VNC to remotely login to use the desktop that isn’t in the Lite version.
Click “CHOOSE STORAGE” to choose your SD card. Mine says “Generic MassStorageClass Media - 128.2 GB”
Click on the gear icon in the panel to bring up a bunch of options:
For me it says “Would you like to pre-fill the wifi password from the system keychain?” Choose yes. This will setup your Raspberry Pi to use wifi to get to the internet, which is handy. Alternatively you could setup wired ethernet or manually setup the SSID and password in the Advance options panel that comes up.
Check "Set hostname". I chose "pidp-11”.
Check "Enable SSH". You can either use password or Allow public-key authentication only. I chose public-key authentication because it’s more secure. It’s also more complicated and convenient. If you want to learn how to do it google "set up public key ssh.” In my case it automatically populates the field for authorized_keys from my mac’s .ssh file.
Check "Set username and password". Choose a name other than “pi", the old default user. Fill out a password. If you allow public-key authentication I’ll show you how to disable password login later if you want increased security.
Check "Configure wireless LAN”. It was already pre-fill the SSID and wifi password from the system keychain, but if not you could fill it out here. Set wireless LAN country if it’s not “GB”
Click Set locale settings, which defaulted to the locale of my mac.
Under Persistent settings I chose “Eject media when finished” and “Enable telemetry.” Enable telemetry sends some anonymized information back to the Raspberry PI orgainzation.
Press “Save”
Press “WRITE”
It should write the SSD with the OS, which takes a minute or two.
Put the SSD into the raspberry PI of the PiDP-ll and plug in the power. Wait a minute or two for it to boot.
Go figure out the IP address of your Raspberry PI on your local network. You can usually do this by looking at the IP addresses listed in your Router/Modem.
I set up my router to use a fixed IP address for the Raspberry PI using its MAC address to reserve the IP address. I then added 2 lines to my etc/hosts file with a symbolic name to my Raspberry Pi’s IP addresses. One for the fixed ethernet address and one for the wifi ethernet address:
192.168.1.30 PIDP-11
192.168.1.31 PIDP-11W
That way I can just open a shell and type:
$ ssh user@pidp-11w
instead of
$ ssh user@192.168.1.31
Where “user” is the user name I specified in the settings above to remotely login over wifi. It should ask you to save a fingerprint or complain if you have previously setup this Raspberry PI with ssh. In that case you need to remove the old key from your known_hosts file.
If you setup public-key authentication you’ll be logged in otherwise you’ll need to type the password.
Once logged in via ssh let’s update the Raspberry Pi:
$ sudo apt upgrade
$ sudo reboot
It can be tedious doing the rest of the steps in a shell via ssh. It’s more convenient to use the desktop via VNC. Near the end of this description I have instructions on setting that up. Now might be a good time to do that otherwise continue with the shell:
Remotely login again:
$ ssh user@pidp-11w
Let’s go setup the pidp-11 software by first downloading everything:
$ cd /opt/pidp11
then unpack pidp11.tar.gz
$ sudo gzip -d pidp11.tar.gz
$ sudo tar -xvf pidp11.tar
and the systems:
$ sudo gzip -d systems.tar.gz
$ sudo tar -xvf systems.tar
At this point we’ll need to change some things to recompile for 64 bits. First we’ll need to edit the install file located at /opt/pidp11/install/install.sh. Replace all the occurrences of "/home/pi" with “home/user” where user is your username.
then run the install file:
$ sudo /opt/pidp11/install/install.sh
This will install a bunch of packages and install the old 32 bit version of the pidp-11 software, which will have to be replaced with the 64 bit version that we’ll eventually build.
Make sure the gcc compiler is installed (I’m not sure if both these are required):
$ sudo apt install gcc-aarch64-linux-gnu
$ sudo apt install build-essential
You’ll need a new 64 bit version of libpcap.a located in /opt/pidp11/src/02.3_simh/4.x+realcons/rpi-build. Copy the new one over:
$ cd /opt/pidp11/src/02.3_simh/4.x+realcons/rpi-build/
$ mv libpcap.a libpcap.a-32bit
$ sudo cp /usr/lib/aarch64-linux-gnu/libpcap.a /opt/pidp11/src/02.3_simh/4.x+realcons/rpi-build
Let’s remove the 32 bit client before building the 64 bit one since make clean doesn’t work:
$ sudo rm /opt/pidp11/src/02.3_simh/4.x+realcons/bin-rpi/pdp11_realcons
The first problem we’ll have to fix is that “find_dev" is defined in the new libpcap.a and in the pidp-11 source code. So we’ll replace all the occurrences of “find_dev” with something else, e.g. “find_device". 19 occurrences these files:
12 in /opt/pidp11/src/02.3_simh/4.x+realcons/src/scp.c
1 in /opt/pidp11/src/02.3_simh/4.x+realcons/src/scp.h
1 in /opt/pidp11/src/02.3_simh/4.x+realcons/src/sim_tmxr.c
1 in /opt/pidp11/src/02.3_simh/4.x+realcons/src/PDP11/pdp11_dl.c
1 in /opt/pidp11/src/02.3_simh/4.x+realcons/src/PDP11/pdp11_td.c
3 in /opt/pidp11/src/02.3_simh/4.x+realcons/src/PDP11/pdp11_io_lib.c
Let’s fix another bug in PDP11/pdp11_cpu.c so we don’t get multiple definitions of realcons_event_cpu_reset due to an implicit definition:
in /opt/pidp11/src/02.3_simh/4.x+realcons/src/PDP11/pdp11_cpu.c replace:
console_controller_event_func_t realcons_event_cpu_reset;
with
extern console_controller_event_func_t realcons_event_cpu_reset;
Next we need to add a linker flag for -ldbus-1 to /opt/pidp11/src/02.3_simh/4.x+realcons/src/quickmake:
LDFLAGS = -lrt -lm -lpthread -ldl -lreadline -ldbus-1
Now we can build the 64 bit version:
$ cd /opt/pidp11/src
$ sudo ./makeclient.sh
If it works it should say something like:
.//../bin-rpi/pdp11_realcons: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, BuildID[sha1]=ae02bf98f52a059dd4e47bb0239322a0c5cf6877, for GNU/Linux 3.7.0, not stripped
That’s the 64 bit executable without symbols stripped.
Now let’s build the server. First let’s fix the makefile so it uses the 64 bit compiler:
in /opt/pidp11/src/11_pidp_server/pidp11/makefile change:
CC=arm-linux-gnueabihf-gcc -std=c99 -U__STRICT_ANSI__ $(CC_DBG_FLAGS) $(OS_CCDEFS) -I.
to
CC=gcc -std=c99 -U__STRICT_ANSI__ $(CC_DBG_FLAGS) $(OS_CCDEFS) -I.
Then build the server:
$ cd /opt/pidp11/src
$ sudo ./makeserver.sh
It should say something like:
bin-rpi/pidp1170_blinkenlightd: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, BuildID[sha1]=c82d2743c7450584114f47bc3cb9fafc0e45d176, for GNU/Linux 3.7.0, with debug_info, not stripped
Server compiled OK!
Now let’s delete the old version of scansw and compile a new one:
$ cd /opt/pidp11/src/11_pidp_server/scanswitch
$ rm scansw
$ make
Time to reinstall our new 64 bit versions:
$ sudo /opt/pidp11/install/install.sh
$ sudo reboot
At this point you should see the lights on the Raspberry Pi. If you login remotely via ssh you should see:
PDP-11 simulator V4.0-0 Current REALCONS build Mar 31 2023
Starting PDP-11/70 (4mB memory) ...
Searching realcons controller "11/70" ...
Connecting to host localhost ...
Loading core memory ...
There are a few remaining tasks you might consider doing:
I use VNC to remotely log into the headless Raspberry PI to use the desktop, either on the local network or remotely. To do that you need to enable VNC with raspi-config and set the screen resolution. I chose the biggest resolution, but your screen might be smaller. In a shell on the Raspberry Pi type:
$ sudo raspi-config
It displays a bunch of options. You want to enable VNC and increase the screen resolution:
2 Display Options -> D5 VNC Resolution -> 1920X1080
3 Interface Options -> I3 VNC Enable
choose reboot
I’ve been using the free "VNC Viewer" on Mac to connect to the Raspberry Pi’s VNC server. There are other VNC viewers for other platforms.
If you use public-key authentication to login it’s more secure to remove password login for ssh. To do that edit /etc/ssh/sshd_config as root and change:
#PasswordAuthentication yes
to
PasswordAuthentication no
RemoteIT is a very useful tool for accessing your Raspberry Pi remotely via ssh or VNC. It’s more secure and easier to use than setting up port forwarding on your router. It works by installing a service on the Raspberry Pi that connects to a remote server that you can use to access your Raspberry Pi no matter where you are. It’s free and easy to setup. Check it out at:
Finally I find it useful to install unattended-upgrades which automatically keeps my Raspberry Pi up to date with the latest important updates. Check it out here:
That's it. Enjoy your PiDP-11!