Possibly adding a pdp11 Target

Hi LLVM community,

Some friends and I have been playing with the idea of creating a new experimental pdp11 target and possibly upstreaming it, since we got hold of some actual hardware. It would of course be really cool to run rust on it. The pdp11 architecture is quite similar to the already supported M68k architecture, so porting feels quite achievable.

What worries me is that there is probably very little demand for a pdp11 target outside of retrocomputing communities. The same might also be true for the m68k backend, however.

I have read through many posts about adding new targerts here so I think I generally know what the requirements are (regarding code quality, style, test coverage etc). But before we start spending the extra time on making it “upstreamable”, I wanted to get some opinions from the community whether this is actually realistic.

What do you think?

What operating system would it be targeting?

How widely available is pdp11 hardware?

How many people are actually doing anything with pdp11 these days? I’m concerned the effort will be abandoned partway through if there isn’t a significant community backing the effort.

2 Likes

Yeah, as much as I love new targets, this one is perhaps old enough that, once the initial work is done and the authors are “happy with it”, no one will ever use it again.

Not at all. Ebay sell parts and programs, but it’s hard to find a working version.

While writing this reply, I did find an emulator written in JavaScript, GitHub - paulnank/pdp11-js: PDP 11/70 and PDP 11/45 emulator in Javascript, which also hints at the unavailability of these systems.

I imagine UNIX, however, these systems had very small memory (single-digit MBs), so any more recent (80s+) program that isn’t written in assembly already probably won’t fit the memory.

The key is to know what is the objective here? If there’s a community that will use it for restoration projects or bring new software into the stack, it may be interesting. But if this is just a (still very interesting) nostalgia project, it may be better to keep it downstream.

It may even be easier to keep it downstream. You should have all infrastructure necessary to build such a target off even older versions of LLVM, and you can keep your fork at releases and only rebase once every 6 months or less.

We would be targeting bare metal compilation. Only very light weight operating systems like unix are even able to run on the hardware. In terms of hardware availability/practical use I think I have to agree with rengolin. There is still some uses, such as old scientific equipment supposedly even some nuclear reactor controls but its not something that has much practical use nowadays since anyone who uses these systems probably wont write much new code for them (other than hobbyists). So yeah, I’m not really confident it makes sense to try to upstream such a target.

FWIW, there’s also an option of developing a downstream fork, e.g., like the LLVM-MOS backend:

There’s been a talk at the 2022 EuroLLVM Developers’ Meeting which may be interesting in this context:

2 Likes

You can get the PiDP-11 here PDP-11 Replica: the PiDP-11

It comes with various OSes including many flavors of UNIX, DEC’s RT11, RSTS, and RSX11M+

If you dig around enough, you’ll find a Google group with a big community.

However, I wouldn’t think about a PDP-11 target.

For retro computing, you’d be happier going with a VAX target (which you can use with simh). Or even go back and resurrect the Alpha target. I’d help with either as I’m a long time DECCIE who started working on VAX compilers.