There are a few “Will it run” tropes when it comes to microcontrollers, one for example is “Will it run Doom?“, while another is “Will it run Linux?”. In one of the lowest spec examples of the last one, [gvl610] has got an up-to-date Linux kernel to boot on a vanilla Arduino Uno. And your eyes didn’t deceive you, that’s a full-fat kernel rather than the cut-down μClinux for microcontrollers.
Those of you who’ve been around a while will probably have guessed how this was done, as the ATmega328 in the Uno has no MMU and is in to way powerful enough for the job. It’s running an emulator, in this case just enough RISC-V to be capable, and as you’d imagine it’s extremely slow. You’ll be waiting many hours for a shell with this machine.
The code is written in pure AVR C, and full instructions for compilation are provided. Storage comes from an SD card, as the ATmega’s meagre 32k is nowhere near enough. If you’re having a bit of deja vu here we wouldn’t blame you, but this one is reputed to be worse than the famous 2012 “Worst PC Ever“, which emulated ARM instead of RISC-V.
Thanks [Electronics Boy] for the tip!
Could be faster if it bitbanged 8-bit connection to hyperbus RAM instead of 1-bit SPI to SD card. 8 data bits and a couple of control signals would be a good fit for the AVR IO ports.
Yes, but he didn’t have any ram laying around
Shoulda used a 555
556. I think you need 2.
I would love to, but I don’t have any small RAM around. But I want to see someone boot this with a real external RAM, and see how long would it takes.
But how used nethunter T (AND)common text coding.?short keys android.?help-tips?
My friend never expected this mention ;)
Here’s hackaday covering the same thing (Linux on a uC) over a decade ago. This older one has a video to give you a sense of the multi-hour boot.
https://hackaday.com/2012/03/28/building-the-worst-linux-pc-ever/
This project also has a video (https://youtu.be/ZzReAELagG4?si=fb26J0idjS6taq_6)
Oh, and also he has uncut videos on his channel
Yes, I think that’s mentioned in the post
You only have to wait several hours for a shell? That’s much faster than a Celeron + 5400 RPM HDD at least 😆
(This wasn’t supposed to be a reply to your comment haha)
“You’ll be waiting many hours for a shell with this machine.”
No pressure if you’re trying to stop the end of the world.
https://github.com/smunaut/iCE40linux
https://archive.fosdem.org/2023/schedule/event/rv_selfhosting_all_the_way_down/
…make more sense to me.
That’s completely different hardware.
Did I claim the opposite?
I just see more ROI in these than flexing muscles on hardware without muscles. One proof of concept Linux on an ATmega really is enough.
If you can run 8086 emulator on Arduino then you could run a tiny Linux called ELKS. You will need 256 kb of memory. Actually a rom version is able to boot with 128 kb.
https://github.com/ghaerr/elks
μClinux is a variation of the Linux kernel, previously maintained as a fork, that targets microcontrollers without a memory management unit (MMU).[1] Also see: Accelerated Linux Distribution.[2]
1. μClinux
https://en.wikipedia.org/wiki/%CE%9CClinux
2. Accelerated Linux Distribution
https://github.com/AcceleratedLinux/accelerated-linux
There arises an interesting question with this project: When you are using the Linux command line it seems to be extremely slow. A command line written directly for the Atmega328 would be much, much faster. This leads to the conclusion that Linux creates itself a unbelievable overhead and there would be at least a theoretical possibility to optimize Linux in general for a much faster speed. When you look at Linus Akkesons “Craft” project you see what’s possible with a Atmega8. When you look at the demo “debris” from Farbrausch you see what’s possible with 64k of code.
Craft:
https://www.linusakesson.net/scene/craft/index.php
debris:
https://www.youtube.com/watch?v=mxfmxi-boyo
Thr delay here may be more appropriately seen as the long journey taken by the code.
From sd card storage, to cpu, to be virtualized, with ram written out over a 1-pin bus, and fetched again. This is more than a little bit like typesetting a book with the letter bins in another county.
Farbrausch demos use procedural resource generation which leverages the processing power to minimize the footprint. Not really apples to apples comparison, you have no processing power to trade for memory savings.
I’m waiting for someone to do this with a marble-based computer…
It says it’s on a mega with 32KB of RAM, not an uno which only has 2KB. The picture and title are wrong.
But even on a mega, this is insane!
This is Arduino UNO, NOT Arduino Mega!
Still faster than the DMV’s database.