Linux on an 8-Bit Micro? (2012)
dmitry.gr
dmitry.gr
I'm interested in the minimal computing resource needed to run a full network stack and recent software. So far, I've run an m68030 with 10 megs of memory and a 16 bit memory bus (Mac LC II) multiuser with networking. 24 megs in a VAXstation VLC is enough to compile plenty of real software. Even a real 11/780 from 1977 can still run sshd and negotiate a connection before a timeout.
All of this seems under-powered today, but was actually more horsepower than a comparable PC capable of running Windows 95.
BTW, don't underestimate an old workstation with only 12MB of RAM: they were often used for technical software that today people might write to require machines with 100x that much RAM.
(I did a little work on the VAXstation, for technical software. I also kludged up a gateway to one, from a TCP/IP LAN, through an Ultrix box that was also on DECnet, since no one had paid for a TCP/IP stack. A lot of important software was optional, little was free, and the printed manuals you could find were precious.)
(It seems you had a great hack to get VMS connected. Was that used for file sharing only, or could you do more with it?)
I gatewayed remote logins from arbitrary hosts, and I probably used a stock DECnet facility to transfer/share files between a VAX/VMS and Ultrix MIPS box, possibly direct to NFS volume mounted from a SPARCserver onto Ultrix. I think there was at least one NFS implementation (TGV?) for VMS at the time, but didn't have it.
I wonder if one could achieve like a month of battery life for such a glorified typewriter/thin client.
I wound up using a Renesas RZ/A1L, it's an ARM-A9 core with 3MB of SRAM on the die. You attach it to an inexpensive quad-lane SPI NOR flash part and it will boot Linux with just those two parts. The flash serves as a filesystem and I believe you can also XIP the kernel off the NOR part if you choose.
We even ran Qt on it with an XGA LCD and it was poky but it worked. It could probably do what you're looking to do.
https://www.renesas.com/us/en/doc/products/mpumcu/doc/rz/r01...
That's probably the lowest-end part I'd say would work for something like this. You can run Linux off a cheaper Cortex-M with some amount of work, but it's not pleasant. The iMXRT1050 does look interesting, though.
No video though.
Another easy way to play around with Linux fit onto very modest hardware (but not 8-bit microcontrollers), which is very popular and very useful, is OpenWrt on a cheap old home WiFi router: https://en.wikipedia.org/wiki/OpenWrt
(If you want to pick up an old router for $20, WNDR3700v2, WNDR3700v4, WNDR3800, and select later ones in that family are a good starting point. The OpenWrt wiki pages for them will give specs and suggest what hardware revs are better.)
Myself and several project mates used an Atmel AVR in early 2003 to build an mp3 player. We didnt bother with the storage integration instead to just opt to stream the mp3 file from a host PC over a UART. IIRC, we only had 32k RAM & 32k ROM to work with (we werent using a Mega chip, I'd have to dig through notes to find the model).
Knowing what we went through to get that mp3 player working (which we delegated the actual decoding to a dedicated chip) with just the AVR, what Dmitry accomplished with this is amazing. Many props.
Edit: this was a senior level college project for a BSEE, not work related.
Kinda reminds me of Linux running on JavaScript: https://bellard.org/jslinux/vm.html?url=https://bellard.org/...
“The common answer is that it requires a 32-bit architecture and an MMU and at least a megabyte of ram to fit the kernel.”
He gets around the 32 bit + MMU requirement by emulation. It’s a cool hack, but it really is a hack.
The pipelining and internal optimizations differ greatly.
A 32-bit architecture is not really a requirement either, you just need a compiler that can be told to use 32-integer types and pointers. You probably also have to modify the compiler to generate accesses to your external ram for loads and stores.
The real thing preventing you from running Linux on 8-bit micros is the requirement of a von Neumann architecture (or something that looks like it). These small MCUs usually don't even have a way of loading code at runtime which makes it impossible to run any sort multitasking without interpretation.
https://spritesmods.com/?art=avrcpm
I got an optional OS for it, called "OS9" but unrelated to Apple's OS9 (which came later).
OS9 had capabilities very similar to (and modeled on)Unix. Clearly, Linux or something a lot like it could also have run on the CoCo.
They don't have MMUs because they are designed to directly address a much smaller ram space. On an the micro in the article, this is only 16K. They are also designed to execute machine code directly, and automatically from an on-board or external ROM, whether a masked ROM (rare these days), an EPROM, or an EEPROM/NVRAM of various kinds. They are not designed to use an OS at all.
That's what makes this so impressive.
I'd say the Mega65 might be a good 8 bit machine to port Linux to. http://mega65.com
It had a few 16 bit instructions: arithmetic on data in registers, or loading/storing a 16 bit register (8 bits at a time). I think the Z80 did as well.
Here's Wikipedia: https://en.wikipedia.org/wiki/Motorola_6809
Very impressive project, but if you were hoping to run Linux on an 8-bit microcontroller for anything real you'll be disappointed.
Subtle difference, granted.
I guess the machine instructions should be as high level as possible, to reduce the interperter dispatch overhead. Of course then you'd need to port Linux and gcc to your hyper-CISC...
The billion cores mark for RISC-V will be somewhere around the middle of 2020 thanks to Western Digital and Microsemi.
https://www.forbes.com/sites/tiriasresearch/2017/12/06/weste...
> What many do not realize is that the company ships over 1 billion processor cores within its products each year and is moving toward 2 billion per year.
https://hackaday.com/2019/02/13/western-digital-releases-the...
> Last year, Western Digital made the amazing claim that they will transition their consumption of silicon over to RISC-V, putting one Billion RISC-V cores per year into the marketplace.
https://www.microsemi.com/product-directory/mi-v-embedded-ec...
RISC-V doesn't have historical warts only because it's too new for any warts it has to be considered historical.
> that can slow down not just hardware implementations but emulation
RISC-V shuffles the immediate bits on its instruction encoding to speed up decoding the immediate in hardware, but this slows down decoding the immediate in software. This will in the future probably be considered one of RISC-V's "historical warts".
You're right that this might be a problem, in principle. Surprisingly enough, however, RV is actually more than competitive as a system-level virtual ISA. People have experimented with this on existing emulation platforms, and that was the result they got.
When already doing something for Linux kernel, it would be advisable to promote the same license as the Linux kernel, such as GNU General Public License 2.
Promote free software and advance of free software.