5 ms·
Ask HN: Someone Port Linux to Arduino
Someone port Linux to Arduino please. Why? Just for fun!
https://superuser.com/questions/1687541/is-there-a-way-to-run-linux-in-arduino-due-like-ubuntu
https://forum.arduino.cc/t/simple-arduino-based-operating-system/502929
https://forum.arduino.cc/t/an-os-for-arduino/641772
https://www.hackster.io/SamRuben123/mcuos-an-os-for-arduino-boards-eacf3b
- hnlmorg 3y agoThe links you posted explain why Linux couldn’t be ported. If you need Linux on a developer board then you’re better off with a Raspberry Pi (or one of its many equivalents). Also, it’s pretty bad form to ask people requests like these. You’re asking them to give up weeks of their free time for nothing.
- roschdal 3y ago"text-based variant of the Linux kernel that doesn't require a MMU can be built" Seems to be possible.
- hnlmorg 3y ago“built” and “usable” are two very different things. The resources on an Arduino are so small that you wouldn’t have a usable system. Which is what the other comments on those links you provided also, rightfully, say. I remember seeing a post where someone has ported Linux to a hobby CPU, might have even been built in Minecraft, but it took several days just to boot. That’s the kind of distinction I’m making here. Just because you can compile to the right instruction set, it doesn’t mean you have anything that is even remotely usable as an operating system. The key thing you’re missing here is the size of the kernel, which is bigger than the cache size of the chips. And that’s before you factor in the GNU userland. And without an MMU, addressing all of that is going to be painful on such a low footprint system.
- tony-allan 3y agoSmall systems (such as the Raspberry Pi) and microcontrollers are very different beasts. A linux system requires more resources than are generally available with a microcontroller. Microcontrollers work without and operating system or with a very small Real-time operating system (RTOS). A microcontroller just as the Raspberry Pi Pico (RP2040 chip) and a Raspberry Pi running linux (e.g. Raspberry Pi Zero 2 W) are almost the same price — $4 vs $15. Microcontroller have KB's to MB's of RAM and storage and computers have GB's of RAM and storage. There is some overlap in how these systems are used but generally if you want to control low-level are hardware with specific time or latency constraints use a microcontroller. If you want to run regular programs (with or without a keyboard and screen) use linux.
- roschdal 3y agoI think there is value in running Linux on an Arduino. Clinux. https://www.electronicdesign.com/technologies/embedded/article/21795660/practical-advice-on-running-uclinux-on-cortexm3m4 https://www.electronicdesign.com/technologies/embedded/artic...
- roschdal 3y agoOr Arduino making a new board with an MMU which will run Linux
- hnlmorg 3y agoDid you read that article? It literally says it’s impossible to run Linux without hundreds of megabytes of additional RAM, which Arduinos wouldn’t have and some boards can’t even be upgraded (eg https://arduino.stackexchange.com/questions/28794/how-to-expand-program-memory-on-an-arduino https://arduino.stackexchange.com/questions/28794/how-to-exp...). As you said, cLinux exists - so if you want Linux on an embedded device you can have it. Just not on an Arduino (or at least not on any models I’ve used).
- simonblack 3y agoEarly Linux distros used to run on very small machines with about 4 megabytes of RAM (if you were lucky enough to have one that big!) I used to run Slackware 2-point-something, or maybe it was 3-point-something around 1993-1994 on a Toshiba T5200. (LATER: It was Slackware 2.01 on a CD from InfoMagic.) IIRC, the critical factor was a CPU that was capable of multi-tasking. In the x86 world, that was a 386 or better.
- hnlmorg 3y agoLinux today is very different from what it was like back then though.
- 3y ago
- pjmlp 3y agoWhat for? It doesn't provide any value over Nuttx, FreeRTOS+POSIX, Zephyr, Azure RTOS, Mbed, RIOT,...