RetroChallenge 2023/10

A re-implementation from existing source code of a long-forgotten UNIX text editor – ded (Display EDitor).

Ded was created by Richard Bornat in 1981 at the Queen Mary College Computer Systems Laboratory.

My aim is to make it suitable for a Raspberry Pi using a VTxxx emulator or xterm (much the same thing as far as ded will be concerned). I’m going to attempt a CP/M 2.2 port, as the code may be just small enough to work – but as there are a number of UNIX-specific things the code relies on this may prove to be a step too far! However, it should help me better document the existing code.

Ded was the first editor I used in a UNIX environment – a Vax 11/780 running BSD 4.something in 1982 at the University of Warwick. A chance conversation with a couple of Mastodon users led me to a copy of the source code dated 1991 from UMIST (University of Manchester Institute of Science and Technology), with some minor changes added by a ded enthusiast – Louis Beliveau – in 2003 and 2006.

My goals during October 2023 are:

  1. To mercilessly hack a version together to make it work on a Raspberry Pi running Raspberry Pi OS.
  2. To clean up the source code (K&R C) so that it compiles better (without warnings!) using a more modern C standard. I may also decide to remove some capabilities for long-dead terminal types that ded supported – with the aim of reducing the size of the code to make the stretch goal possible.
  3. To improve the code’s documentation and build environment.

Stretch goal: To attempt a port of ded to CP/M 2.2 – suitable for use on an RC2014 computer.

04/10/2023

Goal 1 is complete! It didn’t take a huge amount of effort:

  1. A couple of include files (stat.h and types.h) referenced by three of the source files are in a different place on Linux compared with the UNIX version the code was original created for. A simple edit (sadly, using vi!) to fix this was all that was necessary.
  2. There is a conflict with the declaration and usage of a function called qread(). However, it’s only used by a couple of fairly obscure (at least, to me!) terminal types. The easiest bodge was to remove them and assume that the terminal being used is always a VTxxx.
  3. Finally, on my 11 year old Pi B, I simply needed to ignore warnings from the C compiler – mostly for implict declarations of integers and functions – and remove the -n from the arguments used to link the ded executable to create a first working version.

So here’s me using ded (on a Pi Zero, just to check portability!) to edit a file for the first time since 1985 …

At the same time as creating an initial port, I exchanged emails with the creator of ded, Richard Bornat. At the moment it doesn’t look as if I’ll be able to host the cleaned up code in public, as the rights were sold to Logica (subsequently bought by CGI) at some point in the 1980s. However, I’m going to try to find a contact in their legal department to ask about this. After all I can’t imagine that there’s much, if any, commercial value left in the source code of ded these days.

After seeing one of my toots on Mastodon, Tom Stepleton – who owns an incredibly rare and working Whitechapel MG-1 from the mid 1980s – mentioned that a version of ded was ported to this UNIX workstation. The manual entry for that port of ded is hosted here.

Goals 2 and 3 next – cleaning up the code and documenting it well enough to attempt a CP/M port.

11/10/2023

Not a huge amount of progress to report this week, but at least I’ve recovered from my annual flu jab and 8th covid jab that I had last weekend.

What little time I’ve spent on this project has been dedicated to working out what the call structure looks like (a pen and paper exercise, rather than using a modern automated tool, naturally) and working out what any CP/M port gotchas might be. I’m now even less optimisitic about the viability of this than I was at the start, but I’m going to carry on anyway – I might learn something …

Progress over the next few days is likely to be equally slow because I’m away from home.

The success or otherwise of this challenge will all come down to what I can achieve in the second half of the month.

25/10/2023

I appear to be out of time for this challenge – real life has got in the way this year.

It’s not all bad though – I learned a lot from looking through the code, hacking a first version together and exchanging emails with ded’s creator.

I shall probably return to this exercise later on, once the weather gets really bad in the UK.

But in the meantime there are roads to be explored in the retro hardware pictured below!

A yellow Caterham 7 pictured in the Brecon Beacons.
My Caterham 7, pictured in the Brecon Beacons earlier on this year.