Skip to content

fergusleen/pidpdemo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pidpdemo

pidpdemo is a compact demonstration menu for a PiDP-11 or other PDP-11 style 2.11BSD installation (specifically https://github.com/chasecovello/211bsd-pidp11)

It is intended for:

  • museum or exhibition use
  • desk-side historical demonstrations
  • telnet or serial terminal sessions
  • development on a modern host against an old remote target

Repository: github.com/fergusleen/pidpdemo

Video: https://www.youtube.com/watch?v=FBJSq19VJRU

Goals

The project aims to provide a restrained front end for a live historical Unix system.

The menu should:

  • present short historical information pages
  • launch a few safe demonstrations
  • return cleanly to the menu
  • avoid assumptions about modern libraries or terminals
  • remain small enough to fit comfortably on the target

This is not a modern application framework. It is a thin wrapper around plain text files, small built-in demos, and a few external commands.

Current Features

The current menu includes:

  1. Welcome / Introduction
  2. About the PDP-11
  3. About UNIX
  4. About 2.11BSD
  5. PiDP-11 Front Panel Notes
  6. Games On This System
  7. Show system information
  8. Prime number / CPU timing demo
  9. Process or memory demo A. Directory listing / filesystem demo B. Adventure (if installed) C. Trek (if installed) Q. Quit

The page entries read wrapped text files from pages/. The demonstration entries either call built-in code or launch commands.

Layout

pidpdemo/
  README.md
  Makefile
  src/
  pages/
  scripts/
  logs/

The important files are:

  • src/main.c: menu table and command-line handling
  • src/menu.c: plain and optional curses menu logic
  • src/pager.c: screen-at-a-time text pager
  • src/actions.c: built-in actions and command launch paths
  • scripts/sysinfo.sh: helper used by the system summary page

Build

Default build:

make

Optional curses build:

make clean
make CPPFLAGS='-DUSE_CURSES=1' LDLIBS='-lcurses -ltermcap'

The project does not try to detect curses automatically. If your system uses different library names, edit the command line explicitly.

Useful make targets:

  • make
  • make clean
  • make run
  • make smoke
  • make install

make run starts the plain menu locally with pages/.

Run

Typical usage:

./pidpdemo -p -d pages

Useful options:

  • -p force plain mode
  • -c request curses mode if it was compiled in
  • -d DIR choose an alternate page directory
  • -h show usage

Built-in helper modes:

  • ./pidpdemo --sysinfo
  • ./pidpdemo --cpu-demo
  • ./pidpdemo --proc-demo

Design Notes

Plain mode first

The plain text path is the main target. It is the most trustworthy mode for telnet and museum use.

The current plain interface:

  • clears the screen before drawing the menu
  • clears between pager pages
  • clears after Press RETURN to continue

Optional curses

If compiled with USE_CURSES, the program can use a full-screen menu. If curses setup fails or the terminal is unsuitable, the code falls back to plain mode.

System summary

The system summary is generated by scripts/sysinfo.sh rather than by a large in-process C implementation. This was a practical compromise: the richer C version pushed the target binary over the PDP-11 linker size limit.

Demo timings

The prime/pi entry is a visible demonstration, not a strict benchmark. It performs terminal output while running, so the reported elapsed time includes terminal I/O effects as well as computation.

Remote Workflow

The project assumes a very old remote environment.

Do not assume:

  • SSH
  • SCP
  • FTP
  • Python
  • Git on the target
  • modern shell features

The provided scripts are built around telnet and expect.

Typical host-side workflow:

  1. build locally
  2. push changed files
  3. build on the target
  4. run on the target

Script Configuration

The host-side scripts read configuration from environment variables. If scripts/local-config.sh exists, the shell wrappers will source it before using defaults.

Tracked example:

  • scripts/local-config.sh.example

Untracked local override:

  • scripts/local-config.sh

The main variables are:

  • TARGET_HOST
  • TARGET_PORT
  • TARGET_USER
  • TARGET_DIR
  • TARGET_PROJECT
  • TARGET_PROMPT
  • TARGET_SH_PROMPT
  • TELNET_CMD

The repository defaults are intentionally placeholders so the public tree does not point at any specific live system.

Deployment Scripts

scripts/push-file-to-bsd.sh

Uploads one file at a time over telnet. This is the preferred update path for day-to-day work on fragile targets.

Recommended pattern:

  1. upload to something.new
  2. rename it into place on the target
  3. rebuild

scripts/build-on-bsd.sh

Logs in and runs make clean all on the target.

scripts/run-on-bsd.sh

Logs in, changes to the project directory, and starts the menu.

scripts/deploy-to-bsd.sh

Bootstraps the whole tree via telnet paste. It is useful when first setting up a target, but it is less robust than the single-file uploader for repeated iteration.

Public Release Notes

This repository is intended to be publishable as source.

To keep the public tree clean:

  • live target details are not stored in script defaults
  • local site settings belong in scripts/local-config.sh
  • build outputs and local wrapper state are ignored by .gitignore

If you adapt the scripts to your own machine, keep those changes in the local override file rather than hard-coding them back into the tracked wrappers.

Portability

This code is written for old systems first.

Practical lessons from target testing:

  • keep the binary small
  • prefer simple C over abstraction
  • assume very old /bin/sh
  • assume very old userland tools
  • prefer deterministic shell scripts over manual terminal sequences
  • avoid depending on modern awk, ifconfig, or advanced shell syntax

License

This project is licensed under the GNU General Public License v3.0.

github.com/fergusleen March 2026.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors