Like playing around with Linux on low-power devices? You’d be hard pressed to find a better example than the [tvlad1234]’s linux-ch32v003
project. It’s not just a one-off — it’s something you could build right now, since it requires hardly any extra parts.
With help of a 8 MB PSRAM chip for RAM supplementation purposes and an SD card, plus some careful tailoring of the Linux .config parameters, you get Linux on a chip never meant to even come close to handling this much power. The five minutes it takes to boot up to a prompt is part of the experience.
As usual with [tvlad1234]’s projects, there’s a fun twist to it! Running Linux on this chip is only possible thanks to [chlohr]’s mini-rv32ima project, which, as you might remember, is a RISC-V emulator. Yes, this runs Linux by running a RISC-V emulator on a RISC-V chip. The main reason for that is because the MCU can’t map the PSRAM chip into RAM, but if you use an emulator, memory mapping is only a matter of software. Having applied a fair amount of elbow grease, [tvlad1234] brings us buildroot and mainline Linux kernel configs you can compile to play with this — as well as a single-layer-ready KiCad board project on GitHub. Yep, you could literally etch a PCB for this project from single-sided copper-clad FR4 with a bit of FeCl3.
While the CH32V003 is undoubtedly a more impressive target for Linux, the RP2040 Linux project might be more approachable in terms of having most of the parts in your parts box. At least, up until we start valuing the CH32V003 for all the cool stuff it can do!
“you could literally etch a PCB for this project…”
Could you connect this Linux system to a larger screen, install KiCAD on this Linux system, then design this board in KiCAD, use software running on this Linux system to convert KiCAD in to gerbers then in to Gcode to route out this board with, and then use another of these Linux boards as the controller for the CNC machine doing the routing?
Likely not due to the very low system resources (8 MB of RAM) and very low performance since I believe the chip is only 48 MHz and it runs an emulator.
I hope this is a joke.
Cool, but why? The main purpose of Linux is to be a convolution of cheap device drivers, or so I thought.
That’s why Android uses Linux as a base, after all.
Windows 9x did same with DOS, essentially.
The underlying DOS that was being moved into its own VM was good to keep old device drivers (CD-ROM, exotic network stacks etc) functioning.
Why? Because you can. And it may be the cheapest MCU to run Linux on.
That said, much more powerful is ESP32 with FabGL, which can emulate: CP/M, MS-DOS, FreeDOS, Windows 3.1 and Linux ELKS.
yeah it’s an amusing experiment, I certainly enjoyed seeing it work enough to write an article about it ^^
As a tech demo, it’s indeed impressive, I think. 😎
Well, it makes sense for all the other OSes you mentioned, except Linux.
Linux is about anti-binary compatibility, it follows the philosophy that assembler code and proccesor dependency is evil.
C++ is what it’s all about. Maybe Rust and C#, eventually.
The only exception here is x86 Linux, maybe, because of commercial products (binaries) that had actually being created for it.
There are pre-compiled packages, I mean, which do require maintaining compatibility.
Otherwise, Linux isn’t important. Someone could use BSD just as well. Its only real world purpose is to provide a large collection of free drivers made by volunteers.
But in an emulated environment, who needs those drivers?
The limited emulation hasn’t anything meaningful to provide that could have a need for those Linux drivers, kernel modules, demons etc.
There are also a lot of drivers made by paid corporations for Linux, working side by side with volunteers.
I wonder why uClinux was not used here… As that sounds like a set of modifications to allow non-MMU systems to work with Linux.
https://en.wikipedia.org/wiki/%CE%9CClinux
I read uClinux is included in mainline linux these days? Ow, even your source sais so. Buildroot does the target selection and configuration for your smaller system and you can tailor it aswell to your liking.
> Linux is about anti-binary compatibility
Not true. It is true that *inside* the kernel, there’s no ABI compatibility guarantees, but the kernel team goes out of their way to not break user-space. That’s why we still have iptables even though nftables exist, old versions of syscalls are retained etc. In theory, you could grab a statically linked executable from Linux 1.0 and run it on a modern box (I also want to try that out some time, but I do remember seeing a video where they did something like this).
Sorry, Linux on AVR was first. https://dmitry.gr/index.php?r=05.Projects&proj=07.%20Linux%20on%208bit
If you have to ask, you will never know.
I respect the art.
FireFox is ~39 million lines of code we read when installing on a Banana Pi M4 zero. Three of them.
https://openhub.net/p/firefox/analyses/latest/languages_summary
Worked.
Can we expect FireFox to be ported to RISC-V platforms?