CP/M 8266

Hands up if you’ve ever used a machine running CP/M. That’s likely these days to only produce an answer from owners of retrocomputers. What was once one of the premier microcomputer operating systems is now an esoteric OS, a piece of abandonware released as open source by the successor company of its developer.

In the 1970s you’d have seen CP/M on a high-end office wordprocessor, and in the 1980s some of the better-specified home computers could run it. And now? Aside from those retrocomputers, how about running CP/M on an ESP8266? From multi-thousand-dollar business system to two-dollar module in four decades, that’s technological progress.

[Matseng] has CP/M 2.2 running in a Z80 emulator on an ESP8266. It gives CP/M 64K of RAM, a generous collection of fifteen 250K floppy drives, and a serial port for communication. Unfortunately it doesn’t have space for the ESP’s party piece: wireless networking, but he’s working on that one too. If you don’t mind only 36K of RAM and one less floppy, that is. All the code can be found on a GitHub repository, so if you fancy a 1970s business desktop computer the size of a postage stamp, you can have a go too.

There’s something gloriously barmy about running a 1970s OS on a two-dollar microcontroller, but if you have to ask why then maybe you just don’t understand. You don’t have to have an ESP8266 though, if you want you can run a bare-metal CP/M on a Raspberry Pi.

81 thoughts on “CP/M 8266

      1. Your machine was the best Christmas gift I ever got. Funny story, my parents didn’t have alot of money, but got lucky that the local Sears printed an advertisement in the Sunday paper with a misprint leaving off the first digit of the price. In those days misprints had to be honored, and my parents scored my gift for an incredible $99! Then I pooled every penny I had saved, along with all the gift cash from relatives to score an Enhancer 2000. Best Christmas ever!

        Being a child in the seventh grade, it was my first exposure to CP/M. Also, building my first basic transistor driver circuits, I had that user port controlling the motors on my first computer controlled robot, which was four feet tall. I entered that robot into the Baylor University Junior Regional Science Fair, and won second place. I still have the newspaper article somewhere with a picture of the robot and your machine in it…

        Thank you, Bil, for the memories!!!!!

        1. Always amazing to hear these old stories and I love passing them on to the guys. Congrats on the exposure for your hard work way back when.

          My first exposure to a video game/computer was at Sears, they had a Pong game in the basement. Saved my quarters all week and walked there on Saturday mornings.

    1. Too bad Commodore became terrible at marketing. The 128 was arguably the best 8 bit computer. I went from the C-64 to the PC, to the Amiga, and back to the PC. Loved the C-64 but I want to find and hurt the people that crippled it with the 1541 and the fact that the you could not do a “seek” on a file!

      1. A cool feature of the 1541, that in no way made up for its shortcomings, was that you could upload your own executable code blocks to it. This allowed some fancy copy protection and you could even write your own file seek I suppose. Mostly it was used to do things like play “Daisey” on the stepper motors and one Trojan would sit in a loop writing to ROM (bad design) until it burned out.

  1. “That’s likely these days to only produce an answer from owners of retrocomputers.”

    We’re not dead yet ya’ young punk!

    One of my first jobs was programming db apps on a NorthStar Horizion Z80A running CP/M.
    ( 64K RAM, 5 Meg hard drive) hehehe
    :)

    1. Fortunately we managed to avoid The Purge. I remember hiding while they rounded up all the other people who ever used C/PM, wrote a program on punch cards, or bought a C-64 new in the box. Survivor’s guilt is my constant burden.

        1. My parents smuggled the C64G through the Iron Curtain for me from West Berlin; they were allowed to travel there only because they left me and my brother back in Czechoslovakia as de-facto hostages, knowing that had they not come back, all their adult relatives would go to prison.

      1. Well now that Phillp has admitted to being one of us, he’s bound to mysteriously vanish within a day or so. That’s why Bil and I never leave the subterranean tunnels under Hackaday Headquarters. We just keep running Zork and WordStar on a homebrew computer made out of odd bits we steal from the museum upstairs in the early morning hours.

        1. WordStar was great, you could be very productive with it, 10,000 words a day was very doable if you were up against a deadline.

          Hmmm I wonder how much more it would take to use cpm-8266 to turn an old CRT TV into a word processor, or terminal, just another couple of ESP8266 modules and a keyboard? One ESP for networking the other to generate a video signal?

        2. You know, the funny thing about Wordstar was that it had this block copy and paste function – where you could highlight a block of text on the screen of arbitrary width and height and copy it. All these newfangled word processors just assume you want to copy from edge to edge. I’ve not seen a word processor since that has this. It was surprisingly handy.

    2. I used to do a lot of programming and development on cp/m and mp/m computers. I had a couple of altair 8800b’s and a couple of no-brainer s100 systems. And I did a fair amount of work on morrow designs computers. Wrote a lot of testing apps and inventory mgmt stuff.

      1. I have an old Morrow MD-3 I bought with some stuff at an auction.
        Came with the disks and manuals but I didn’t get the terminal but it worked after I figured out how to hook it to the serial port of a PC.
        Maybe I should make a proper terminal for it using a propeller chip and a VGA monitor.

  2. This is so awesome!!! That’s the smallest CP/M machine I’ve ever seen!!! I thought Lee Hart’s Z80MC was going to be the smallest…. wrong! I am really hoping he can get it working with the wifi portion! That would be even more awesome to telnet to it!

  3. Not only that I used a CP/M computer, but I designed one, including writing a BIOS in order to port the CP/M OS to my new hardware. I ended up with about 4KB of assembly code (including the character generator and the floppy disk drivers). Still have the CP/M sources listed on tractor paper.

    I can not tell you the joy when I saw the first CP/M prompt on my own hardware.
    :o)

    https://cdn.hackaday.io/images/2572221402262586660.jpg

    https://hackaday.io/project/1411-xor-hobby-a-vintage-z80-computer-prototype

    1. My favorite CP/M WordStar story. Keep in mind WS could do documents and ASCII text. The alternative was CP/M’s ed command which was horrible. I wrote a few thousand lines of 6805 code around 1982 or so on some QDP 100 (North Star rip off) using a TV910 terminal. All with ed. I told my boss, “If you won’t buy a better editor, I’ll pay for it out of my pocket.” He said, “I’m not buying $*$*#. We’ve had a copy of WordStar for a year and no one can get it to work.” I said, “We have a copy of WordStar?” About an hour later, I was in heaven and it took me a long time to give up WordStar.

      In those days (as I’m sure you know) installing software involved writing code to drive your particular terminal and printer. I guess they got it just before I joined the company and gave up.

      1. Didn’t you have to know to go into insert mode or something like that? I.E. you had to know wordstar to use wordstar?

        A couple of our programmers at CBM used Wordstar on a Xerox to draft their documents, (the chip guys pretended there were not enough terminals on the Vax for programmers). Bitch was Xero had removed the format command from their 8 inch floppy menu forcing you to buy pre-formatted hard-sectored disks. Try as the programmers might, whenever they put in a PO for Xerox 8″ floppies they would receive a box of Commodore brand 5 1/4 inch floppies as the purchasing agent figured they were cheaper.

  4. This link,
    “… you can run a bare-metal CP/M on a Raspberry Pi…”
    does not take me to ‘CP/M on a Raspberry Pi’. If it did, I’d buy a(n) RPi in a heartbeat since this is the first rational use of the Pi I’ve encountered (duh, I almost forgot: Windows is the other one).

      1. Attention: that CP/M emulator for Pi does NOT work. It’s too broken. (At least it was on my original Pi B.)

        For me, the scrolling is busted, so after a few lines it goes down past the bottom and becomes invisible. If you’re quick enough and keep clearing the screen before too far, you might get away with it. But I couldn’t run anything practical, only play with it a bit.

        (Maybe that bug has been fixed since I tried it last year.)

        1. So much for any rational uses of the Raspberry Pi (I can’t comment on the use of a(n) RPi to emulate a 555, when one needs to blink LEDs. Some people swear by the RPi as a substitute for an NE/SE 555, however).

    1. Windows on a Pi? My work provided Windows laptop only has 16G of ram so I have to stop and wait for swap to catch up with me all the time, it would take a week for a Pi to boot windows.

      Back on topic, where is the CP/M source published, got links?

  5. Waves hand slowly..
    I still have a Compaq “Luggable” that used to run CP/M, although it’s been in the back room for quite a few years..
    [img]http://oldcomputers.net/pics/compaqI.JPG[/img]
    I actually had two, one with an early version of DOS, and the CP/M one.

  6. Not only that I used a CP/M computer, but I designed one, including writing a BIOS in order to port the CP/M OS to my new hardware. I ended up with about 4KB of assembly code (including the character generator and the floppy disk drivers). Still have the CP/M sources listed on tractor paper.

    I can not tell you the joy when I saw the first CP/M prompt on my own hardware.
    :o)

      1. The good part was that the CCP and BDOS components of the CP/M OS were hardware agnostic, so only 7 BIOS functions plus a bootloader were enough to have a running computer with file system, monitor and keyboard. Also, for the VT52 emulation I happily found out that it is not mandatory to implement all the VT52 escape sequences. With only a couple of VT52 commands implemented (like clear screen, move cursor to XY, backspace and a few others) all the games, editors and tools were running just fine, even the “text graphical” ones, like Wordstar.

  7. Ok, now I’ll have to dig out that old Cromemco z2d? … (went down stairs to look ). Yup, still there, my dell laptop has
    native rs 232 so I don’t have an excuse to not fire it up. It’s rainy here in Chicago land area so no excuse this weak end
    Hopefully the last floppy drive still works…
    64k, z80, 4Mhz…

    Off topic did Hackaday ever find a payphone? Don’t remember witch thread that was…

    later

  8. I’ll have to dig into my emulator archives and see if I can’t find my CP/M Turbo Pascal 3 disk images. Finally, I can write in Turbo Pascal on the 8266! Muahahahaha!

  9. I was still using my Kaypro II about two years ago in my work truck. Great “portable” CP/M machine.
    Sitting on the passenger seat in it’s original blue nylon carrying case, it made a great desk for my laptop to sit on.

  10. I had a Xerox 820-II, used mainly for Wordstar, printed to a Diablo 630. I also made the cable to connect to its internal LPT port so I could use an Epson 9 pin printer. The other hack I did was moving one of the ground pins on all the floppy cable connections to where the side select pins were missing so I could used DSDD drives. Quite a lot of effort Xerox went to, making cables with one less wire to sell with the single sided drives. If you wanted to upgrade to double sided they could sell you an expensive cable too.

    Then I installed a V20 CPU in my PCjr and running 22-Nice it was a faster CP/M machine than the Xerox, or my 12Mhz 80286 emulating a Z-80 with 22-Nice. I don’t recall if the 286 with emulated Z-80 was faster than the Xerox.

  11. CP/M was a quite viable operating system well into the 1980s, running on popular computers such as the barely portable Kaypro. The early versions of DOS were little more than clones of CP/M. But for the legitimate fear at Digital Reseach of being screwed by IBM, the first IBM-PCs might have shipped with CP/M as the standard OS.

    During that era, David Rothman wrote a book that describes events. He recently released a digital version for free download. You can get the details here:

    https://teleread.org/2017/03/15/silicon-jungle-now-free-via-pg-read-about-kaypro-wordstar-arthur-c-clarkes-2010-modem-connection/

    For those who lived through that era, reliving its events is fascinating. I know because my first computer was a CP/M Kaypro. And those who came along later might find that bit of their history intriguing. Imagine an era when two floppy drives are the ultimate in storage, when 64K memory is enormous, and when speeding a 2.5 MHz CPU clock up to 5 MHz (that’s megahertz not gigahertz) made you a power user.

    And as deficient as all that seems to today’s users, then it was enormously empowering.

  12. I, too, have a soft spot in my heart for my old Kaypro IV and CP/M. It was my favorite computer for two simple reasons.

    (1) I UNDERSTOOD it. I’m not talking about how to use the control keys in WordStar. I’m talking about the whole system. I had the schematic for the hardware, manuals for the chips, AND listings of bout the Kaypro BIOS and CP/M itself. If it was doing something I didn’t like, I could and did change it. Try _THAT_ with your Windows 10 machine!

    (2) It worked. Reliably. Every time. With the Kaypro, I never saw a Blue Screen of Death, or discovered that my registry was corrupted. I didn’t need Disk Doctor or Norton Anti-Virus. I never had to force a reboot.

    I never went into my computer room in the morning, to discover that the Kaypro wasn’t working the way it had been, the night before.

    I’m saddened that whole generations of modern PC users don’t even know what that feels like.

    Jack

  13. It’s cool to see that people are running CP/M on systems like the Pi or the 8266 or any other little microcomputer, but so far they’re all running in emulation mode.

    The advantage of using a Z80 emulator is, of course, that all the old software, like WordStar and many other apps, can run on it without changes.

    But what I’d really like to see is CP/M CONVERTED — that is, retargeted — to the native hardware. After all, there WAS a CP/M86 and a CP/M 68000. Why not a CP/M8266?

    Some years ago I sought to port CP/M to the Rabbit, which had a very nearly Z80 architecture, and even executed most of the same binary opcodes. I never got very far with it, though.

    I’m currently involved in just this kind of project based on the TI MSP430FR6994. With 256K of nonvolatile FRAM, _PLUS_ an SD card interface, it seems more than up to the task.

    Yes, I know, to really enjoy the Kaypro experience, I’m going to have to port all those lovely apps, but I’m hoping to do just that. Wish me luck!

    Jack

    1. Yes, it’s possible. I’ve run a port of CP/M-68K on a couple of flavors of ARM. Big problem, naturally, is that there is no software available for it beyond what I’ve written.

      I took some of the system utilities (all I’ve got is PIP, STAT, and ED) from CP/M-Z8000. ED from CP/M-Z8000 assumes that there will never be more than 32K of RAM available, so I wrapped it in a memory allocator that limits it.

      I also found and ported an ancient version of microEMACS for CP/M-68K.

      One of my targets was a microcontroller with 512K of flash; that serves as drive A:. It also has 96K of RAM built in, which gives a nice playground fro running CP/M-ARM programs. Upshot: single-chip 32-bit CP/M computer.

  14. 250k disk images are a bit tight for the upcoming CP/Minator of my new world domination project. ;-)
    Are there bigger showstoppers blocking a change to e.g. the round about 1M image size AltairZ80 uses? Or just have a fat A: drive only and sort the software stuff into the user areas? What about additional flash chips? The biggest size CP/M allows would be a bitsy more than 8M per drive… having exchangeable flash “drives” would bring back the disk jockey feeling of the 80s… I’ll ask about hot pluggable later… much later… I promise!

    1. Well.. I really had no particular reason for the 256256 bytes floppys except that is the original default size of a CP/M floppy back in the days.

      It would be quite easy to have three 1MB drives instead. I think I’ll make an option for that. Or even a single 3M drive. Support for user areas is built in, and also supported in the Linux cpmcp utility so it seems like a good thing.

      Speaking about hot pluggable drives… I’ve been thinking of making some “memory units” like the one they used the original star trek series back in the 60s. The small colored plastic blocks. Powered by either a solarcell at one side and communicating via IRDA from an edge. Or just by a inductive wireless charger and irda. That would look rather cool to just put a piece of acrylicsv into a loosely fitting slot and they be able to read data from it. ;-)

        1. A 32mbit device uses about 15-20ma when reading and 20-25 while erasing/writing. So that is about 80 mw. A small ev-panel (40x40mm) is usually rated at 140-150mw. So that might work even after ir-comms and a microcontroller is added. The question is if the leds powering the module will burn it to a crisp or not ;-)

  15. I used CP/M on an Amstrad PC for the 4 years of my uni degree in 1984-88, including the Pascal and C programming courses. (I also had microProlog and Logo interpreters as well as Wordstar and a CAD program for drawings) After uni ‘I used CP/M for industrial control on dedicated single board Z80 computers right through to about 1994. In fact I still have a fabulous book on my shelf called “Soul of CP/M” that teaches assembly programming on CP/M by building a full featured text editor. I also had a brief dalliance with CP/M-86 and MP/M but they were fighting a losing battle by that time.

  16. How about running CP/M on a Zenith Z-100 with the 8085 and ZDOS on the 8086 side. Was my main computer in 1980s. Still have the software that I had written on the Z-100.

Leave a Reply to Michael W. Perry, WA4MPCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.