PiDP-8/I Software

Update of "Incandescent Thought"
Log In

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview

Artifact ID: 154e90e144443bb09fa480d2bed9a801b9ade83c
Page Name:Incandescent Thought
Date: 2018-03-20 04:06:22
Original User: tangent
Mimetype:text/x-markdown
Parent: 37b9507f98f462ada123d83c4eddb5d2ba1ce848 (diff)
Next 63fc34472df9aa8c672d9a57dcd1640049825068
Content

The Situation

In February 2016, Norman Davie released a program he called Deeper Thought after an earlier program by Steve Gibson called Deep Thought. The most important difference between these two programs for our purposes here is that instead of running as PDP-8 code within the simulator, as Gibson's program does, Davie's Deeper Thought runs as a native program on the Raspberry Pi, using a version of Oscar Vermeulen's original gpio.c module to manipulate the LEDs on the PiDP-8/I's front panel and read its switches.

Davie's program has been forked several times, but this mode of operation remains in all of the versions I've tried.

When Ian Schofield created the incandescent lamp simulator (ILS) for the PiDP-8/I, he changed the external interface in a couple of ways which prevented it from being used with any of these versions of Deeper Thought.

When I rewrote the ILS, one of the things I did was add a compatibility interface for programs like Deeper Thought which remain dependent on the old gpio.c module interface. This article describes the steps you must take to build a version of Deeper Thought against our new ILS.

Modifying deeper.c

The first thing you have to do to build any version of Deeper Thought against the current version of the PiDP-8/I software is copy its deeper.c file into the PiDP-8/I software's src/misc subdirectory:

$ cd ~/pidp8i                  ⇠ or wherever the PiDP-8/I source code is
$ cp /path/to/deeper/thought/deeper.c src/misc

Use your favorite Linux text editor to make a few adjustments to src/misc/deeper.c to get it to build:

  1. Add the following line between the big block comment at the top of the file and the #include lines following it, at line 156 or so:

    #include "gpio-common.h"
    
  2. Remove these lines, found up among the #include lines:

    extern void *blink(void *ptr); // the real-time multiplexing process to start up
    extern uint32 ledstatus[8];     // bitfields: 8 ledrows of up to 12 LEDs
    extern uint32 switchstatus[3];  // bitfields: 3 rows of up to 12 switches
    
  3. Replace the block of code beginning with the pthread_create() call and ending with sleep(2) — inclusive — with the following:

    pidp8i_simple_gpio_mode = 1;
    if (start_pidp8i_gpio_thread ("Deeper Thought 2") != 0) exit (EXIT_FAILURE);
    

With that done, you must reconfigure the software to get it to recognize that deeper.c has been added to the src subdirectory. If you're happy with your current configuration, this will do the trick:

$ make reconfig

Otherwise, re-read README.md and run configure manually:

$ ./configure --with-your-new-option-set

Either way, among the lines in the configure script output should be this one:

Found Deeper Thought; building it against ILS GPIO module

If you reconfigure it on a multi-core Pi such as the Pi 2 or Pi 3, it will build against the ILS; otherwise, it will build against the NLS, which may look slightly different from the appearance you get from the old gpio.c module, but it probably isn't worth continuing unless you're simply curious.

Now you can try saying make. If the software builds, you can now run it as sudo bin/deeper.

If you want to install it, I recommend that you build and install Deeper Thought in the normal way, then copy the bin/deeper executable you built above over the top of the normal one. This lets you leverage the rest of the installation process shipped with Deeper Thought, such as installing the deeper system service.

Disabling the PiDP-8/I Simulator

If you want Deeper Thought to run by default instead of the PiDP-8/I simulator, say:

$ sudo systemctl stop pidp8i
$ sudo systemctl disable pidp8i

The Deeper Thought installer script will mark its service to start by default. If you don't give those two commands, Deeper Thought will crash on boot because it can't grab control over the GPIO lines going to the PiDP-8/I front panel while the PiDP-8/I simulator is running.

Reverting to Boot with the PiDP-8/I Simulator

To revert the changes made in the previous section and mark Deeper Thought to not start on boot, say:

$ sudo systemctl stop deeper
$ sudo systemctl disable deeper
$ sudo systemctl enable pidp8i
$ sudo systemctl start pidp8i

Why Not Make This Easy?

You might be wondering why I describe how to modify deeper.c to build against the PiDP-8/I software instead of just integrating it and shipping it along with it. It's because this software is not licensed under any open source license, and attempts to get the authors to so license it have been ignored. Therefore, I cannot re-distribute this software, even though it is freely-available on the Internet.

License

Copyright © 2017-2018 by Warren Young. This document is licensed under the terms of the SIMH license.