It’s UNIX. On A Microcontroller.

It’s difficult to convey in an era when a UNIX-like operating system sits in your pocket, how there was once a time when the mere word was enough to convey an aura of immense computing power. If you ran UNIX, your computer probably filled a room, and you used it for Serious Stuff rather than just checking your Twitter feed. UNIX machines may still perform high-end tasks, but Moore’s Law has in the intervening years delivered upon its promise, and your phone with its UNIX-like OS is far more powerful than that room-sized minicomputer of the 1970s. A single chip for a few cents can do that job, which begs the question: just how little do we need to run UNIX today? It’s something [Joerg Wolfram] could advise you upon, because he’s got a functional UNIX running on a microcontroller.

Of course, the UNIX in question is not exactly the same as the one you’d find on a supercomputer, either in the 1970s or now. Mini UNIX is a minimalist version of the operating system developed by [Heinz Lycklama] at Bell Labs four decades ago. It gives you a complete UNIX V6 system for the DEC PDP-11, but which needs only 56K of RAM, and no MMU. Emulating a PDP-11 on an STM32 microcontroller allows it to run happily, and while it’s not the most minimalist of microcontrollers it’s still a pretty cheap part upon which to run UNIX.

It’s doubtful whether a 1970s version of an operating system on a commodity microcontroller will take the world by storm, but that’s hardly the point of such a neat hack. It’s certainly not the first time we’ve seen similar work, though this PIC32 offering has a little more in the way of resources to offer.

Header image: Golonlutoj [CC BY-SA 3.0].

70 thoughts on “It’s UNIX. On A Microcontroller.

  1. ” If you ran UNIX, your computer probably filled a room, and you used it for Serious Stuff rather than just checking your Twitter feed. ”

    What’s Twitter running on now? DOS?

    1. I’ve seen CDC Cyber’s take up a good sized room but that’s about the biggest beast out there or was.

      Most Unix boxes even during the 80’s didn’t take up much space. By the time Apollo and Sun came on the scene, the Unix boxes had began to shrink quite a bit. Now some like Sequents did take up 2-3 rack spaces but few used them.

      1. In the late 80’s I worked in a store that ran a UNIX Point-Of-Sale system running on a 386DX-16, which seemed like a serious machine at the time (we were still selling 8088 and 80286 based computers there), but now seems like something that any 32-bit ARM MCU should be able to handle, at least in terms of computing power.

        1. I always thought it would be amusing to hook up as many old-school serial terminals via USB-Serial interfaces as possible to a Raspberry Pi, run a getty on each one and see how the Pi performs as a VAX. Of course one would have to find a bunch of terminals first…

  2. PDP-11s didn’t fill a room, at least, not if you just had one. A rack, maybe. You’re thinking of older machines (PDP-1, maybe even the PDP-10 if you had several mobys of memory) that took up multiple racks and filled a room. MULTICS which UNIX was created in reaction to, ran on a large Honeywell machine that took up a room… though by todays standards MULTICS was much smaller than even Linux is today. And it had a more flexible paradigm for interoperation – in UNIX it’s the stream which requires serialization (essentially emulates tape), but in MULTICS it was RAM! Everything was treated like RAM. Really not a bad OS, particularly compared to the bloat we have today.

      1. There were at least 84 Multics sites, some of which contained multiple Multics mainframes. For example the Air Force site at the Pentagon for example ran 6 Multics systems
        https://multicians.org/site-afdsc.html

        US Navy War College had at least 4 systems (1 dev, 3 production)
        https://multicians.org/site-nwgs.html

        Ford ran 4 and GM ran 3
        https://multicians.org/site-ford.html
        https://multicians.org/site-gm.html

        https://multicians.org/sites.html

        Given the cost of the Hardware Multics ran on you are probably looking at something in range of $200-$350m+ in equipment (north of $500m when inflation taken into account)

      1. An 11/70 with some hard drives – removable platter floor standing units – a couple line printers, VT100 terminals and a a pair of Vector General display takes a fair sized room. And don’t call me Shirley.

    1. i believe jenny list was talking about the “aura” of unix rather than its reality. when i first heard of unix (early 90s), its inaccessibility was its most prominent feature. i don’t know how big the machines actually were, just that they might as well have been as big as the moon as far as getting one into my house went.

      and anyways, isn’t the PDP-11 remarkable for its smallness? and even so just its power supply is bigger than all of my computers put together.

    1. While that is impressive, this is as well in its own right. This uses even less hardware, and I infer from the developer’s documentation that it doesn’t take hours to boot. The performance is likely to be much better, as well.

    1. It’s got a hell of a lot more power under the hood than an Altair/IMSAI. Even the lowly Arduino can emulate the 8086 CPU. If the STM32 board had some more RAM, it could probably give early 1990’s desktops a run for their money.

        1. There is many but none got any significant traction.
          Haiku for one a remake of BeOS. I used BeOS in his time, was an advanced OS for the time. Saddly it was a commercial failure. It is not enough to have good features to succeed, it needs a lot of cash to push it to market.

    2. The STM32 should be able to do at least 20 VAX MIPS, which is a good sized building full of PDP11/70’s. And with much faster communications, like 200 times faster that a single 11/70.

  3. Now we have BSD and Plan9 which are the systems closest to Unix.
    And my mainframe does fill a room – four racks for four tape drives. But being manufactured behind the iron curtain, it does not spark anyone’s curiosity.

    1. It’s really very, very, VERY hard to get running on a microcontroller, but Mac OS X is actually officially recognised as a real Unix. It has UNIX 03 certification (SUS).

  4. Disc and Tape Drives took up a lot of the space in the 70’s, while the CPU was likely only equivalent to 2-3 Disc Drives. It was not uncommon to see a row of Drives sitting next to the processor cabinet. My 1976 mini was quite literally the length of my garage – suitably lined and air conditioned of course.

  5. The Data General Eclipse’s and HP1000’s CPU’s I worked on weren’t space hogs. But their HDD’s were the size of washing machines and the Ampex 28 track tape drive took up a entire rack. Oh yeah don’t forget the high speed printer. All told it took up a fair bit of space.

    1. The Eclipses were terrific machines, I think our largest one was 3 bays, of which 2 held tape drives. I worked for an OEM, and we got to see the early releases of AOS (not AOS/VS) and DG/L (for those not familiar w/the latter, DG/L was an Algol-like language designed for systems-level programming, and had a 9-pass compiler)

      And every 6 months or so our tech would open up the double-density Zebras – 300 MB! – and clean circuit-board contacts with a “Pink Pearl”.

    1. There are a few “Vortex86” bits around; and some remnant of VIA’s Epia that is mostly in Chinese.

      Pretty thin on the ground in things you can actually buy, though.

      I can only assume that they are in a tough spot: DOSbox is pretty good at what it does for most software compatibility purposes; and runs on relatively modest hardware; modest enough that the efficiency gained by a native implementation probably isn’t going to beat the economies of scale of yet another random ARM SoC.

      Legacy customers who must have the proprietary ISA card of importance +5 won’t be satisfied with that, and will probably pay pretty well; but ‘small, deep pocketed market’ is not the stuff of which inexpensive boards are made.

      Probably doesn’t help that Team ARM continues to offer improved performance for those willing to emulate; while Team Intel is sort of off and on about actually caring about their low speed/low power parts; but definitely could spin up an Atom or Core M to beat down any contemporary VIA or Transmeta type; which ind of reduces the incentive to be one.

  6. Mini-Unix has 24K kernel-space and 32K user space which will be swapped by process-change. You can write programs in assembler, C-compiler, BASIC and FORTRAN. Its also possible to compile a new kernel on the system, this takes approx. 5-10 min on a STM32.
    The next version will support digital and analog IO on some µC as well as a random device. Currently 2 serial lines are supported, so (theoretically) 2 users can log in at the same time…

    1. I would like to install your system on a STM32F407VET6 dev board. I am a PC/Windows guy. Would point me to info/help to do the installation and bring up?
      Thanks,
      Tom

  7. Probably the STM32F405 version should work, for the STM32F407 I have no I/O library (unilib) at the moment but it should be mainly identical to the STM32F405. You can see the schematics at the project site, if You use another crystal frequency than 16MHz or/and other I/O pins, the board.h must be customized and the program must be re-compiled. If You gave me the necessary information, I can do that and release this variant. If You want to compile the project under windows, I’m sorry but I can’t help. There are many guys that have more windows experience than me.
    For copying the image to the SD-card, I think WINDD can do this. The Image must be copied to the start of the card beacuse I don’t have implemented a FATxx driver. And, this should be important for the STM32F4xx, I don’t use the SDIO but rather SPI for accessing external media. This is, why the common PyBoards with STM32F405 will not work with this project, although they have a controller which I also use.

    Joerg

Leave a 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.