8 ms·
Linux on an 8-Bit Micro? (2012)
- iammer 8y agoNeeds (2012)
- tlrobinson 8y agoSpoiler: they wrote an ARM emulator. Very impressive project, but if you were hoping to run Linux on an 8-bit microcontroller for anything real you'll be disappointed.
- dmitrygr 8y agoWell, it will run Linux on an 8-bit microcenter for real, just sloooowly :)
- FPGAhacker 8y agoAll they have to do fix that is set LS_COLORS appropriately.
- taneq 8y agoI dunno if a factor of 40 is going to cut it.
- TickleSteve 8y agoNot really... Linux is running on the ARM... its just the ARM that is emulated. Subtle difference, granted.
- tyingq 8y agoWas not disappointed...other than the comment section. Oy.
- neilv 8y agoFor people interested in this, another thing to be aware of is uClinux: https://en.wikipedia.org/wiki/%CE%9CClinux https://en.wikipedia.org/wiki/%CE%9CClinux 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 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.)
- deathanatos 8y agoVery impressive. Kinda reminds me of Linux running on JavaScript: https://bellard.org/jslinux/vm.html?url=https://bellard.org/jslinux/buildroot-x86-xwin.cfg&graphic=1 https://bellard.org/jslinux/vm.html?url=https://bellard.org/...
- snazz 8y agoThey’re both hacks for running Linux in ways it was not intended to run, by exploiting other technology, so there’s certainly some connection.
- mey 8y agoYou are literally on a site called hacker news.
- johnhenry 8y agoHow was linux intended to run?
- cachvico 8y agoOn a PC.
- kej 8y agoOn a 386 with AT hard drives.
- mr_toad 8y agoIt’s in the article: “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.
- lisk1 8y agoAccording to him it takes about 5 hours to get to the command prompt which is kinda funny but interesting project nevertheless
- ilaksh 8y agoMaybe CP/M would be an easier type of operating system for that type of computer..if a bit dated. https://spritesmods.com/?art=avrcpm https://spritesmods.com/?art=avrcpm https://hackaday.com/2017/03/25/cpm-8266/ https://hackaday.com/2017/03/25/cpm-8266/ https://github.com/toyoshim/cp-mega88 https://github.com/toyoshim/cp-mega88
- aquabeagle 8y agoOr FUZIX https://github.com/EtchedPixels/FUZIX https://github.com/EtchedPixels/FUZIX
- wazoox 8y agoYep, definitely http://www.fuzix.org/ http://www.fuzix.org/ . It works on a whole lot of 8 bit machines.
- 0815test 8y agoInteresting. Making it run RISC-V rather than ARM would provide slightly quicker emulation, I believe. (And indeed, more generally, running a RISC-V VM provides a quick way of enabling modern 64-bit code to run even on hardware that's restricted to a 32-bit address space. Given that there's a lot of such hardware around, even of quite recent vintage, this can be practically helpful.)
- dmitrygr 8y agoRiscv didn't exist when I wrote this. Even now it doesn't exist (it will "exist" when someone ships a billion somethings with it in it)
- 0815test 8y agoYup, of course. Today it "exists" as a supported architecture in Linux, however... so it makes sense as a suggestion to whoever may want to try something broadly similar, but in a way that can even be practically useful. (Almost all current ISAs other than RV itself have historical warts that can slow down not just hardware implementations but emulation a lot... that's one of the reasons RV was made in the first place!)
- cesarb 8y ago> Almost all current ISAs other than RV itself have historical warts 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".
- 0815test 8y ago> RISC-V shuffles the immediate bits on its instruction encoding to speed up decoding the immediate in hardware 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.
- hermitdev 8y agoThis is impressive. 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.
- dang 8y agoFor the curious—2017: https://news.ycombinator.com/item?id=15841241 https://news.ycombinator.com/item?id=15841241 2016: https://news.ycombinator.com/item?id=12537653 https://news.ycombinator.com/item?id=12537653 2014: https://news.ycombinator.com/item?id=8791812 https://news.ycombinator.com/item?id=8791812 2013: https://news.ycombinator.com/item?id=5581851 https://news.ycombinator.com/item?id=5581851 2012: https://news.ycombinator.com/item?id=3767410 https://news.ycombinator.com/item?id=3767410
- johnklos 8y agoIt's a good example of a minimal system, but it's more academic than an example of something that illustrates a useful system. It's arguable whether much could be done with it in real time. There's no TCP/IP stack, and even if networking did exist, most connection types would time out. 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.
- michrassena 8y agoI found even a Vaxstation 3100 with the m42 cpu and 12MB of RAM was enough to work with. Sometime within the last five years, I installed NetBSD by netbooting from a Linux mopd server (because I didn't have a working 512-byte block SCSI cdrom). As a computer, it was quite reasonably usable. Not fast by any means. I didn't have anything but a serial console to work with, so no gui. I thought the best thing in the world would have been to browse the Internet on the machine, but I gave up on it because I couldn't Lynx to work. All of this seems under-powered today, but was actually more horsepower than a comparable PC capable of running Windows 95.
- neilv 8y agoIf you ever want to put VMS on that VAXstation 3100 m42, it's pretty neat to play around with. DEC people were sharp, like the Bell Labs and Berkeley people, and did a lot of things differently than Unix did. VMS was perhaps less agile, but more consistent. If you can get hold of VAX C for it, you might be amused to find that some of the documentation for system libraries has examples in BLISS instead. 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.)
- GeorgeKangas 8y agoI had an 8-bit micro, the Tandy (i.e. Radio Shack) Color Computer ("CoCo"), made in the mid 80s. 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.
- orionblastar 8y agoTrs80 Coco series used the 6809 CPU that is 16 bits. The article talks about Linux on 8 bit systems. I'd say the Mega65 might be a good 8 bit machine to port Linux to. http://mega65.com http://mega65.com
- GeorgeKangas 8y agoThe 6809 was 8 bits, in the same way Z80 and 6502 and 6800 were: 8 bit data bus, 16 bit address bus. 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 https://en.wikipedia.org/wiki/Motorola_6809
- teilo 8y ago
- deleted 8y ago[deleted]
- rcdwealth 8y agoSadly the software is proprietary. Indicating for "commercial use" means it is proprietary. 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.
- geezerjay 8y agoGive it a rest. The project is really impressive and quite a feat. Leave the militant piggy-backing out of it.
- fulafel 8y agoI wonder what would be the ideal Linux compile target for running on interpreter style emulators (as contrasted to binary translation style). 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...
- poizan42 8y agoI have probably commented this before, but the nommu support was merged all the way back in 2.5.46, so a mmu is certainly not a requirement for running Linux. 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.
- phkahler 8y agoReminded me of this XKCD: https://xkcd.com/505/ https://xkcd.com/505/