Developed in the very late 60s and through the 70s, the PDP-11 series of minicomputers was quite possibly the single most important computer ever created. The first widely distributed versions of Unix and C were developed on the PDP-11, and it’s hardware influence can be found in everything from the Motorola 68000 to the MSP430.
When [Dave Cheney] saw the recent 8086 simulator written in 4kB of C code, he realized simulating entire computer systems doesn’t actually require a whole lot of resources outside a big chunk of memory. Armed with an Arduino Mega clone, he set out on one of the coolest projects we’ve seen in a while: simulating a PDP-11 on an AVR.
[Dave] used an ATMega2560-powered Arduino Mega clone with an Ethernet module for the hardware of this build. Attached to it is a shield filled up with a pair of RAM chips that expand relatively limited amount of RAM on the ‘Mega.
So far, [Dave] has his simulated system booting Unix V6 off an SD card. For PDP-11 storage, he’s also simulating an RK05 disk drive, a massive 14 inch platter containing 2.5 Megabytes of data. Compared to the original PDP-11/40, [Dave] estimates his machine is about 10 times slower. Still, an original 11/40 system fills multiple server racks, and the most common installations consume several kilowatts of power. The Arduino Mega can fit in a pocket and can be powered over USB.
Future developments for this system include improving the accuracy of the simulator, running more advanced operating systems and the DEC diagnostic programs, and possibly speeding up the simulation. We’d suggest adding some switches and blinkenlights on an additional shield, but that’s just us.
All the code can be found on [Dave]’s git, with a description of his SPI RAM shield coming shortly.
28 thoughts on “Minicomputers On Microcontrollers”
It runs slower than slower than shit.
(an homage to RSTS/E)
Gak! RSTS/E, though I would never hear of that again. DEC had the worse documentation ever plus charged a lot for each copy of each horrible “manual”.
He should be able to get a lot more speed. I would use an instruction lookup table that points to assembly code. PDP/11 is 16 bits – not hard to emulate well. An 8 MHZ AVR-328 benchmarks at 1.1 VAX MIPS. There is a small list of comparisons a little over halfway down the extra long bonus home page here http://andahammer.com/
I agree the PDP11 documentation was hard to work with. The VAX/VMS Operating System however, was 9 feet of binders of the most consistent documentation I ever worked with. That said, “In order to understand the manual, you have to have read and understood the manual!”
Is this the 3rd one we’ve seen on an AVR now after the DCPU and the ARM emulators?
Damn, I was working on a PDP11 emulator for AVR too.
My cpu code is only 2x as slow as original though :)
Still working on emulating the rest of the system
yes, learned to program cobol on a dec pdp – 11 44
I’ve always wanted to rebuild a VAX processor in an FPGA so I can plug it into my VAX 4000/200 system and see if it’s faster.
Could someone please write an AVR emulator in qbasic, then run interpreted BASIC on the emulated PDP-11 on the qbasic AVR emulation running on a VM? I’m curious to know if time would stop.
if it didn’t, you may wish it had…..
qbasic on a PDP-11?? The only qbasic I am aware of was for MS-DOS on Intel compatibles. Was there a BASIC for the PDP11 that was also called qbasic?
He didnt say qbasic for PDP11…
He said use QBasic to write an AVR emulator. Run the PDP emulator in the AVR emulator and then run interpreted basic in the PDP emulator.
To do it properly the AVR emulator would need to run on PDP BASIC. Though in QBASIC on a modern PC you’d probably get better than the real thing for speed.
yes there was – Dartmouth Basic was certainly there – I learnt it on a 11/10 in the mid-70’s running the Dec’s PTS-11 (Paper Tape Software) monitor (pre-operating system)….
That’s pretty cool.
Couldn’t you run a PDP-11 natively though? The CPU in those systems was shrunk to a single flip chip carrier that was only about twice the size of a 32 pin DIP. It required no active cooling, and while I’m positive the power requirements were probably more then a dev kit can provide without an external PSU, it would be really cool to see an AVR or such replacing the bulk if the PDP but still running code on the native PDP CPU.
Of course I would suggest this for any computer, but the pin count on the PDP-11 flip chip is very manageable.
Sorry, flip chip is the wrong term. SOC is what I was looking for.
One of my college classes had us implement very simple CPUs in a style very similar to this. While there’s no (much of a) realistic use for such a simulator, it is certainly fun to play around with. This also costs less than building a hardware CPU ;-)
Maybe not. The emulator is in C++ so with a bit of porting it should run fine on a Pi, BeagleBone, or even a PC. With all the data logging work done on the PDP-11 I am betting someone could use a BeagleBone that could run PDP-11 software
That is actually pretty awesome. Using a Mega as the platform seems a bit misplaced, but porting the emulator to a chip with a little more grunt might be pretty sweet.
Got into computers just a little too late to be involved with the PDP-11s, but frittered away plenty of time on VAX 11/780s and always had a soft spot for VMS.
Does this mean we can finally have computers similar to those in Fallout that can potentially last 200 years with a trickle of solar??
Sounds like an interesting project. What would one do for capacitors to last that long? Does the flash in a microcontroller stay written forever?
Flash is non volatile. Doesnt require an external charge to stay in its current state in theory.
It is stored as static charges though right? They’ll bleed away eventually, since the substrate and whatever else doesn’t have infinite resistance. The Internet seems to think 5 or 10 years for a current-day SD card. In MCUs, who knows, is it on the data sheets?
For capacitors, I’d bet solid ones would last about forever. It’s easy to put 2 bits of metal next to an insulator, the work’s all done by physics rather than the chemistry that keeps electrolytics alive.
There are people like the Long Now Project involved in making machines that will work for thousands of years, currently they’re building a clock that will tick for 10,000 years with chimes each millennium. There’s all sorts of considerations that are completely irrelevant to normal mechanics and engineers, but come to dominate when you’re working on timescales like that.
Even worse are the vaults that have to store hideously dangerous nuclear waste for 5 millions years. Over that time rock acts like jelly! Still really no clue as to how that’s gonna work, we’ve still got linguists working out how to write warning signs for a language that’s evolved 5 million years later. Although whatever the hell will be walking the Earth by then is another complete mystery.
Ah, life is brief!
Thanks for your comments.
Right now this project falls solidly into the ‘I wonder if this could be done’ space. If you’re looking for a simulator that runs at a reasonable speed, have a look at the version I wrote in parallel in Go (https://github.com/davecheney/pdp11).
If you actually want a usable simulator E11 or SIMH are awesome, but if you’re like me, and like to tinker, then the best way to understand something is to pull it apart, and put it back together again.
@dmitry, I’d love to collaborate to improve the speed of the simulator. As I identified in the first article the two areas that I know I’m throwing away performance are the ALU, where everything is handled as a 32 bit int, which absolutely blows on the 8bit Atmel ALU, and the memory bus.
I was thinking of adding an L2 cache using the few kilobytes of spare SRAM on the atmega2560, but I now have two XRam style memory expansion boards in my possession so I’m going to integrate one of them into my design. Yay! Bank switching like it’s the ’80’s
There are many Apple II fans at 6502.org who did the same with their AVRs: http://forum.6502.org/viewtopic.php?f=8&t=2766
Does anybody have an old serial terminal they can send this guy? Something that looks like it may have one day been attached to a real PDP11?
There’s very few on Ebay, and they sell for a lot of money. And shipping is no joke. I’d guess the best time to get them would’ve been about 10 – 15 years ago as companies threw them out. Then again, are they still used much?
My first terminal was a lovely Wyse 60, on a Honeywell Bull mini. I learned C and Unix on that. And COBOL. This was early 1990s, gods know why they taught us COBOL. I suppose in 20 years when everyone else who ever knew COBOL is dead, I can corner the market!
IIRC A Decwriter is a 300 baud pin printer that takes full wide computer paper. Runs very slow, and if you pause while typing the head will to a mover to the right so you can see what you have done. I was actually cheaper to buy a new Apple II at the time (which cost a lot) and use a terminal program, though it was nearly impossible to talk campus computing centers or CS/Math/Physics departments to do it. It also turned out that running BASIC programs for a class was a lot faster using the Applesoft than the timeshared PDP-11 or VAX-11/780. Can you imagine 32 or 64 people using your Arduino-328? All limited to 64KBytes through virtual RAM. Hmmm. Contest?
I got my computer science degree on a 16-bit PDP-11 running BSD 2.9 Unix Circa 1981. Mostly at 1200 Baud from my home CP/M 8-bit machine. Alas, the computer I really loved was the 16-bit HP 2000A Timeshare Basic machine. Circa 1971. We had 110 Baud teletypes and paper-tape. We liked to call PDP-11 C Language a Macro-Assembler.
Please be kind and respectful to help make the comments section excellent. (Comment Policy)