Because You Can: Linux On An Arduino Uno

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!

26 thoughts on “Because You Can: Linux On An Arduino Uno

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

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



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

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

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.