Live data from Hacker News

Linux on an 8-bit micro

dmitry.gr

61–70 of 80 posts

Re: Linux on an 8-bit micro

#61
post #21

Earlier quoted context omitted.

"You're usin' a 286? Don't make me laugh / Your Windows boots up what, in a day and a half?" - Weird Al

http://www.youtube.com/watch?v=qpMvS1Q1sos - just to make it easy for others to appreciate this gem.

"See, it ain't about the Benjamins or Pentiums or Athlons" https://www.youtube.com/watch?v=IuGjtlsKo4s

Re: Linux on an 8-bit micro

#62
post #38

And slightly on topic, here is Windows 95 on a 25Mhz 386 with 4 meg of RAM http://everything2.com/title/25+MHz+386+running+Windows+95

Back in the time, there were even hacks to run Windows 95 in safe mode on 286 machines. 386 with 4 megs was the official minimal requirement.

What were the limitations and hacks involved in this? I mean, parts of W95 (certainly including explorer.exe) were 32-bit so either they had to be disabled/replaced or the kernel extended with an 80386 emulator.

Re: Linux on an 8-bit micro

#64
post #6

All that's left is that pesky 32-bit CPU & MMU requirement. Well the AVR has no MMU and is 8-bit. To conquer this obstacle, I wrote an ARM emulator. So technically it's Linux running on a 32-bit "macro", just one which happens to be implemented in some seriously inefficient manner. There are some real ports of Linux for "limited" architectures, like uClinux (supporting few 32-bit micros, including some MMU-less ones)…

I was impressed by it.

    This project is "only" a cool ARM emulator with
    software DRAM controller, which BTW proves again that
    Linux doesn't fit onto 8-bit micros.
But it does, for practical purposes. I'll try to put into context with a practical story -

There's a global apocalypse happening tomorrow.

There's a sealed bunker beneath my author's house that will survive. It contains one of these microcontrollers, a keyboard, specifications for a daisy wheel printer that hooks into the debug port and a big stack of paper, and a row of bicycles connected to a alternator to power it all.

There is a post-it note stuck to the controller that says "pwd; /usr/bin/ls; cd /; /usr/bin/ls; man man; man ls; man ed;".

Decades from now and by chance, Benedictine monks will build a monastery, and the bunker will be within its generous grounds. In time they will discover the bunker, and take turns getting fit while others they learn to use the system. They're a disciplined, careful bunch, particularly around commands like rm.

Out of concern for the reliability of storage media, one of the hackers will set up a RAM disk and migrate the system over to this. The abbot will declare that pedalling is a leisure activity so that they system will never again need to reboot.

Though their diligence, the art of unix hacking will live on.

A thousand years later, an opaque glass bottle will break free of the ocean, and wash up on a beach. Bizarrely, it will contain well-preserved code printouts from an entry in the 2013 7-day roguelike competition. It will be marked up in pen, to highlight the author's flamboyant use of obscure system calls, particularly those that are specific to the linux kernel. A convenient novelty of the game is that (unlike rogue) it is one-dimensional - a player can walk left or right on a line, and a new line prints out each time they move.

A copy of the source will eventually find its way to the monks - still pedaling furiously to keep their RAM disk alive - as they take an interest in anything that refers to linux. They will type in the code, and then throw it at a compiler. It will all work. This is the last computer left on the planet, and the reason that the code can be compiled to run on the computer with no modifications is because - for practical purposes - it's linux that's running on this 8-bit micro.

Re: Linux on an 8-bit micro

#65
post #64
post #6

All that's left is that pesky 32-bit CPU & MMU requirement. Well the AVR has no MMU and is 8-bit. To conquer this obstacle, I wrote an ARM emulator. So technically it's Linux running on a 32-bit "macro", just one which happens to be implemented in some seriously inefficient manner. There are some real ports of Linux for "limited" architectures, like uClinux (supporting few 32-bit micros, including some MMU-less ones)…

I was impressed by it. This project is "only" a cool ARM emulator with software DRAM controller, which BTW proves again that Linux doesn't fit onto 8-bit micros. But it does, for practical purposes. I'll try to put into context with a practical story - There's a global apocalypse happening tomorrow. There's a sealed bunker beneath my author's house that will survive. It contains one of these microcontrollers, a keybo…

[deleted]

Re: Linux on an 8-bit micro

#66
post #17
post #15

Earlier quoted context omitted.

> which BTW proves again that Linux doesn't fit onto 8-bit micros. How in the world does it "prove" that, when not only does it "fit", it fits in addition to an emulator? I don't see that it only runs _under_ an emulator proves any such thing. While this is obviously a "hah, you think it's impossible? I'll show you," type achievement, and running Linux on an 8-bit is never going to be more than a curiosity, it's a ne…

I meant the external DRAM thing - this chip would never be able to run Ubuntu without external RAM and bit-banging DRAM in software is more akin to "crawling" than "running" to be honest. But yes, in a sense, you can run Linux on 8-bit micro or even a sufficiently long Lego brick Turing Machine.

> I meant the external DRAM thing

So? It's not the first system to rely on software support for memory refresh. And many 8bit and even 16 bit systems relied on the CPU for other tasks that are usually offloaded to external chipset these days.

The ZX-81 ran the display. The C64 controlled the tape drive directly. The Amiga, which had a long list of support chips, still had the CPU directly handle decoding of data from the floppy.

It affects performance, sure, but if you're trying to shoehorn Linux onto an 8bit embedded CPU in the first place, you're not doing it for speed.

Re: Linux on an 8-bit micro

#67
post #6

All that's left is that pesky 32-bit CPU & MMU requirement. Well the AVR has no MMU and is 8-bit. To conquer this obstacle, I wrote an ARM emulator. So technically it's Linux running on a 32-bit "macro", just one which happens to be implemented in some seriously inefficient manner. There are some real ports of Linux for "limited" architectures, like uClinux (supporting few 32-bit micros, including some MMU-less ones)…

> There are some real ports of Linux for "limited" architectures, like uClinux reginaldo (a guy who posted his emulator (jslm32) last time this was on HN) actually uses uClinux on LatticeMico32. [1]: https://github.com/ubercomp/jslm32 I'm considering trying to get this to compile on Emscripten. It's so self-contained that I think it will be fairly unproblematic. Emscripten's 64-bit math emulation surely won't be need…

You can boot Linux in the browser already. Or do you have another interesting use specifically for an ARM emulator

Re: Linux on an 8-bit micro

#68
post #64
post #6

All that's left is that pesky 32-bit CPU & MMU requirement. Well the AVR has no MMU and is 8-bit. To conquer this obstacle, I wrote an ARM emulator. So technically it's Linux running on a 32-bit "macro", just one which happens to be implemented in some seriously inefficient manner. There are some real ports of Linux for "limited" architectures, like uClinux (supporting few 32-bit micros, including some MMU-less ones)…

I was impressed by it. This project is "only" a cool ARM emulator with software DRAM controller, which BTW proves again that Linux doesn't fit onto 8-bit micros. But it does, for practical purposes. I'll try to put into context with a practical story - There's a global apocalypse happening tomorrow. There's a sealed bunker beneath my author's house that will survive. It contains one of these microcontrollers, a keybo…

I think in the event of a global apocalypse you'll be wanting this gentleman[1] first... http://www.youtube.com/watch?v=EzyXMEpq4qw

[1] Claude Paillard, http://paillard.claude.free.fr/

Re: Linux on an 8-bit micro

#69
post #68
post #64

Earlier quoted context omitted.

I was impressed by it. This project is "only" a cool ARM emulator with software DRAM controller, which BTW proves again that Linux doesn't fit onto 8-bit micros. But it does, for practical purposes. I'll try to put into context with a practical story - There's a global apocalypse happening tomorrow. There's a sealed bunker beneath my author's house that will survive. It contains one of these microcontrollers, a keybo…

I think in the event of a global apocalypse you'll be wanting this gentleman[1] first... http://www.youtube.com/watch?v=EzyXMEpq4qw [1] Claude Paillard, http://paillard.claude.free.fr/

[deleted]

Re: Linux on an 8-bit micro

#70
post #67

Earlier quoted context omitted.

> There are some real ports of Linux for "limited" architectures, like uClinux reginaldo (a guy who posted his emulator (jslm32) last time this was on HN) actually uses uClinux on LatticeMico32. [1]: https://github.com/ubercomp/jslm32 I'm considering trying to get this to compile on Emscripten. It's so self-contained that I think it will be fairly unproblematic. Emscripten's 64-bit math emulation surely won't be need…

You can boot Linux in the browser already. Or do you have another interesting use specifically for an ARM emulator

if you can boot Linux in the browser, you can just run arm qemu or even bochs from it. 30 seconds from now you'll have an arm emulator in javascript.

use that i7 or i9 at 3 ghz, I say.

Post reply on HN