Blog

It’s UNIX. On A Microcontroller. | Hackaday

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. TLE4252D

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].

” 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?

But Mac OSX *is* Unix. :)

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.

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.

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…

“Of course one would have to find a bunch of terminals first…”

What for? Terminals emulators would do the job.

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.

I was thinking the same thing about the size. https://goo.gl/images/hnSrs5

Did anyone actually use multics though?

Your homework: read _Hackers_ by Steven Levy. :-)

The US military used it for fire control solutions, at least.

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)

Then DEC brought out the LSI-11 and a 4-card backplane that could fit in a shoebox (http://www.diane-neisius.de/pdp11/pdp11module.jpg). I used to work for a UK company that built papertape reader/punches to sit on shelf containing the “shoebox” fixed to an LS120 DecWriter.

It seems to me that this pdp-11 is effectively an lsl-11.

The PDP-11 where I went to college did have its own air conditioned room.

>PDP-11s didn’t fill a room

That would depend on the size of the room, surely? ;-)

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.

Throw in a tape drive for good measure, maybe a card reader/punch/sorter… Oh! Did you want telecommunications with that? B^)

Yes. Forgot dual tape drives. Each one a full rack. Without two, how do you make copies not thrash your drive?

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.

Nah, you could get SCO Unix on a 386 in the early 90s. No idea of the exact dates, just from my memory.

Previously on HaD: https://hackaday.com/2012/03/28/building-the-worst-linux-pc-ever/

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.

Yes, but it’s got at least 1MB of DRAM in that SIMM in addition to its 16kB of SRAM. This is with the on-chip SRAM alone.

So you’re telling me UNIX now runs on the “blue pill” $2 Fleabay STM32? UNIX on a $2 device, with about the same performance as a 70s minicomputer?

https://m.ebay.com/itm/STM32F103C8T6-ARM-STM32-Minimum-System-Development-Board-Module-For-Arduino/162247218933?epid=532038167&hash=item25c6b016f5:g:ZXMAAOSwA3dYCJJd

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.

I’d like to see some of the alternative OS come out some more. That’s where some of the early creativity was.

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.

In the mid 1980’s there was Kyan Pascal and KIX for Apple II. It was pretty cool. If you didn’t have a hard drive or big RAM disk, it went to the floppy for each terminal command, which was a little tiresome. However, with a solid state HD emulator in a slot, it zipped right along! http://www.appleoldies.ca/kix/ https://www.youtube.com/watch?v=U8_u6tI0QAg

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.

The STM32F103C8T6 is not sufficient because is has not enough Flash and RAM. The minimum requirements are 256K Flash and 64K RAM.

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.

Well, I’m curious! What kind of machine? What kind of specs? Can you share photos?

In Soviet Union, computers don’t spark curiosity, they spark YOU! (ZAP!) B^)

In mother Russia, You don’t program computers, Computer programs you

NuttX is probably superior if you want a unix-alike. RetroBSD is a good mention but it doesn’t have realtime capabilities like NuttX.

There’s also Fuzix that runs on quite a lot of microcontrollers and older CPUs:

https://github.com/EtchedPixels/FUZIX/wiki

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).

https://en.wikipedia.org/wiki/%CE%9CClinux

µClinux is already forgotten? it worked decades ago on M68K and dragonball.

An then there was LUnix for 6502 CPUs: http://lng.sourceforge.net/

And also ELKS Linux for the 8086 http://elks.sourceforge.net/

nommu µClinux kernel alone will occupy >500KB

Yeah, but without the memory protection and paging, it’s not a real UNIX.

Oops, I see that this project doesn’t simulate an MMU either.

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.

Also look at FrostedOS (posix compliant, there is a port of busybox and micropython for it):

https://www.cnx-software.com/2016/06/09/frosted-os-is-an-open-source-posix-operating-system-for-cortex-m-processors/

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.

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”.

You can run bsd 4.4 on an mz pic 32, Serge and friends at retrobsd sorted that one out ;)

With the popularity of SBC, I have been waiting for SBC 486 “PC”… Why aren’t there any? Wouldn’t it be dirt cheap? Wouldn’t there be interest?

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.

You start a project and I’ll help if I can

Intel’s Quark line is/was 486-based. http://www.linleygroup.com/newsletters/newsletter_detail.php?num=5074

If you’re looking for a computer that fills a room, might I recommend the IBM System 370 series? See: https://en.wikipedia.org/wiki/IBM_System/370

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…

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

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.

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.

VNLD5300TR-E By using our website and services, you expressly agree to the placement of our performance, functionality and advertising cookies. Learn more