News for hackers. Stuff that matters.
Re:Linux on an 8-bit micro by jwr on Saturday April 20, 2013 @03:55PM (#5582580)
This is seriously awesome. I take special care to upvote these kinds of projects, as they embody the hacker spirit: hack something that has never been done before in an awesome way, and to hell with practical value!
Re:Linux on an 8-bit micro by DanBC on Saturday April 20, 2013 @01:30PM (#5582141)
That's impressive!

I remember when "getting linux working on a laptop" was thought to be tricky.[1]

ELKS was a linux distribution for old small machines. It was supposed to run on an 8086, and use just 512 KB (not MB) for ram. (http://web.archive.org/web/19990117003949/http://www.uk.linu...)

(http://en.wikipedia.org/wiki/Embeddable_Linux_Kernel_Subset)

Wow, still sort of live. (http://elks.sourceforge.net/)

[1] Here's a 2003 FAQ which gives some nice details of the problems people faced then. (http://www.faqs.org/docs/Linux-HOWTO/Laptop-HOWTO.html)

Re:Linux on an 8-bit micro by TheBoff on Saturday April 20, 2013 @02:31PM (#5582340)
Well, getting Linux working on a laptop was more a case of exciting driver wrangling, rather than performance limiting.
Re:Linux on an 8-bit micro by iso8859-1 on Saturday April 20, 2013 @05:28PM (#5582878)
What does ELKS have in common with Linux? Will it emulate 32-bit for the user-land? If not, I guess it's not binary compatible. So ELKS is not Linux itself (FAQ says so) and it won't run Linux apps? I don't see how they're related...
Re:Linux on an 8-bit micro by idupree on Saturday April 20, 2013 @02:16PM (#5582289)
The intro paragraph of that 2003 FAQ looks eerily like a comparison of smartphones/tablets to laptops might look today!
Re:Linux on an 8-bit micro by joelhaasnoot on Saturday April 20, 2013 @01:58PM (#5582226)
Tried running this on a Toshiba T1100 Plus [1], never did get it working...

[1] http://en.wikipedia.org/wiki/Toshiba_T1100

Re:Linux on an 8-bit micro by tmzt on Monday April 22, 2013 @01:52PM (#5590714)
Does anybody have a copy of the original ELKS homepage with the quote from Linus about Linux not being portable?

It seems not to be in IA.

Re:Linux on an 8-bit micro by qb45 on Saturday April 20, 2013 @01:20PM (#5582099)
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) and ELKS (for 16-bit x86 CPUs).

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.

Re:Linux on an 8-bit micro by vidarh on Saturday April 20, 2013 @02:11PM (#5582274)
> 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 neat proof of concept and could trivially be made much faster (through a hybrid approach: a lot of the Linux code could likely be ported quite easily, and a lot of it could probably also be jit'ed relatively easily (especially kernel-land - a special purpose jit whose only purpose is to jit the kernel would be vastly easier than a general purpose jit, not least because you can take a boatload of shortcuts (e.g. manual translation) in cases where a simple/trivial jit doesn't do well.

I think it's a fascinating solution - people have talked about doing ports to limited systems without MMU's etc. before, and it has usually meant severe tradeoffs that means lots of userland won't work (e.g. vfork instead of fork). This is a d'oh moment in that the "solution" if your goal is only to get a port running (rather than for it to be practically usable) has stared us in the face "forever" (there's been virtualization solutions using emulated CPU's since before Linux was around).

Re:Linux on an 8-bit micro by qb45 on Saturday April 20, 2013 @02:16PM (#5582291)
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.

Re:Linux on an 8-bit micro by vidarh on Sunday April 21, 2013 @07:40AM (#5584568)
> 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 by cturner on Sunday April 21, 2013 @07:26AM (#5584549)
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 by jrabone on Sunday April 21, 2013 @08:04AM (#5584602)
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 by iso8859-1 on Saturday April 20, 2013 @05:33PM (#5582889)
> 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 needed.

Does anyone know if a ARM emulator in JavaScript exists already?

Re:Linux on an 8-bit micro by danellis on Saturday April 20, 2013 @07:29PM (#5583228)
I started writing one in Dart a couple of days ago, but I know others already exist, including ones that port existing emulators (such as QEMU) using Emscripten.
Re:Linux on an 8-bit micro by iso8859-1 on Saturday April 20, 2013 @08:16PM (#5583322)
Will you open source it? :) Found you on Github, it's not there.
Re:Linux on an 8-bit micro by danellis on Sunday April 21, 2013 @12:27AM (#5583853)
Oh, absolutely. It's not like I'll use it for anything other than saying, "Hey, look at RISC OS running (slowly) in a browser!", which is the end goal.
Re:Linux on an 8-bit micro by iso8859-1 on Sunday April 21, 2013 @11:51AM (#5585208)
Did you consider using an existing platform like https://github.com/asmblah/jemul8 ? Would be nice with a multiple-CPU emulator in JavaScript.
Re:Linux on an 8-bit micro by danellis on Monday April 22, 2013 @12:29AM (#5587772)
I think it would be more trouble than it's worth to take an x86 emulator and try to make it do ARM as well, unless it was written with multiple CPU types in mind in the first place.

But more importantly, it's written in JavaScript -- this is an exercise in learning Dart.

I do refer to various C-based implementations from time to time, though.

Re:Linux on an 8-bit micro by vidarh on Sunday April 21, 2013 @07:41AM (#5584571)
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 by andthen22 on Sunday April 21, 2013 @08:34AM (#5584653)
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.

Re:Linux on an 8-bit micro by iso8859-1 on Sunday April 21, 2013 @04:55PM (#5586378)
jsLinux is not FOSS.
Re:Linux on an 8-bit micro by ippisl on Saturday April 20, 2013 @09:46PM (#5583532)
Microcontrollers currently supported by uClinux cost >$5.

One interesting option to reduce the cost is to use a new microcontroller , the psoc 4(starting $1, 32 bit) which includes programmable logic, which might enable implementing the dram interface in hardware and to achieve good memory performance.

Re:Linux on an 8-bit micro by theatrus2 on Sunday April 21, 2013 @01:17AM (#5583955)
But <$10 for an ARM926 in very low quantities. Add DRAM, NAND (or SD).
Re:Linux on an 8-bit micro by derleth on Saturday April 20, 2013 @11:28PM (#5583753)
> There are some real ports of Linux for "limited" architectures, like uClinux (supporting few 32-bit micros, including some MMU-less ones) and ELKS (for 16-bit x86 CPUs).

But is it actually Linux, or something that was based on Linux but is now so divergent as to be its own kind of thing?

"Oh, it's Linux. It doesn't have most of the APIs, including the ones 99+% of the application software depends on, most of the code is gone, what's left has been greatly re-written, and it will never contribute code back into the mainline kernel."

It's the Ship of Theseus: "This is the original ship. Every plank has been replaced at least once, the sails are all new, and all of the rope was replaced last month."

Re:Linux on an 8-bit micro by NewAccnt3 on Saturday April 20, 2013 @02:07PM (#5582258)
So you're saying you can't compile Linux to an 8-bit CPU, but you can run an emulator of a much larger chip on that CPU and run linux on that? Are you sure?
Re:Linux on an 8-bit micro by noselasd on Saturday April 20, 2013 @03:43PM (#5582551)
That's what the person here did, so yes indeed.
Re:Linux on an 8-bit micro by sigkill on Saturday April 20, 2013 @12:28PM (#5581865)
This guy is definitely a genius... or insane. It boots the full graphical desktop in around 6 hours.
Re:Linux on an 8-bit micro by danbruc on Saturday April 20, 2013 @01:27PM (#5582131)
Second this. And this probably also speaks a lot for Linux - okay, he emulated a supported system, but given the problems that one sometimes experience when trying to run the same application on different machines with slightly different hardware or software installed, I find it quite amazing that Linux actually boots on this device.
Re:Linux on an 8-bit micro by jmtame on Saturday April 20, 2013 @07:38PM (#5583251)
He's more on the side of genius, but less on the side of practical. I think he'd do really well if he tried a startup with someone who could help push him in the direction of building things with more practical use.
Re:Linux on an 8-bit micro by dmitrygr on Saturday April 20, 2013 @10:14PM (#5583602)
I've done plenty of practical things a while back (palmpowerups in PalmOS days) but nowadays I am relaxing (I work at Google and I fly planes for fun). I'll go back to doing practical things with a purpose in a year or two :)
Re:Linux on an 8-bit micro by jmtame on Saturday April 20, 2013 @11:19PM (#5583735)
Very much looking forward to seeing what happens if you venture out into startup land again :)

By any measure, Palm Powerups was very successful.

Re:Linux on an 8-bit micro by sigkill on Sunday April 21, 2013 @12:55PM (#5585409)
Things don't generally translate well on the internet, but be rest assured that when I said you were insane, I meant the good and awesome insane.
Re:Linux on an 8-bit micro by bigiain on Saturday April 20, 2013 @10:49PM (#5583665)
Or alternatively, I'd love to see hom hook up with some artists - and do "stupid shit" just for the fun of it.

If this guy's not already hooked up with people like Dorkbot or Survival Research Labs or Burningman, then someone should introduce them...

Re:Linux on an 8-bit micro by renanbirck on Saturday April 20, 2013 @01:33PM (#5582151)
It is not exactly Linux on an 8-bit micro; it's Linux on an ARM emulator on an 8-bit micro. Still good to see an use for ancient memory modules :)
Re:Linux on an 8-bit micro by jared314 on Saturday April 20, 2013 @02:16PM (#5582292)
Re:Linux on an 8-bit micro by iso8859-1 on Saturday April 20, 2013 @05:42PM (#5582920)
I put his sources on Github. Since there are no modifications, it does not violate the license.

[1]: https://github.com/ysangkok/linux-on-an-8-bit-microcontrolle...

Re:Linux on an 8-bit micro by icebraining on Saturday April 20, 2013 @12:40PM (#5581915)
Curiously enough, once booted, the system is somewhat usable. You can type a command and get a reply within a minute.
Re:Linux on an 8-bit micro by deweerdt on Saturday April 20, 2013 @01:04PM (#5582035)
It takes about 2 hours to boot to bash prompt ("init=/bin/bash" kernel command line). Then 4 more hours to boot up the entire Ubuntu ("exec init" and then login). Starting X takes a lot longer.
Re:Linux on an 8-bit micro by nsxwolf on Saturday April 20, 2013 @02:51PM (#5582405)
"You're usin' a 286? Don't make me laugh / Your Windows boots up what, in a day and a half?" - Weird Al
Re:Linux on an 8-bit micro by morganwilde on Saturday April 20, 2013 @03:49PM (#5582565)
http://www.youtube.com/watch?v=qpMvS1Q1sos - just to make it easy for others to appreciate this gem.
Re:Linux on an 8-bit micro by lelandbatey on Saturday April 20, 2013 @07:55PM (#5583281)
For the extremely lazy, the exact moment of the quote:

http://www.youtube.com/watch?feature=player_detailpage&v...

Re:Linux on an 8-bit micro by anonymous on Sunday April 21, 2013 @02:37AM (#5584092)
"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 by iso8859-1 on Saturday April 20, 2013 @04:21PM (#5582665)
Comments from Dimitri last time this was on HN: https://news.ycombinator.com/threads?id=dmitrygr
Re:Linux on an 8-bit micro by glabifrons on Saturday April 20, 2013 @03:06PM (#5582444)
Am I the only one who noticed his "clock" is an aircraft altimeter? This guy is awesome! :)
Re:Linux on an 8-bit micro by JulianMorrison on Sunday April 21, 2013 @07:04AM (#5584527)
Never underestimate the Portia[1] trick.

[1] http://www.rifters.com/real/2009/01/iterating-towards-bethle...

Re:Linux on an 8-bit micro by geon on Sunday April 21, 2013 @02:23AM (#5584070)
I was puzzled at first when I saw the license. Who would be interested in this commercially?

Then I realized the interesting thing isn't to run Linux, but some other more lightweight code that depends on the 32 bit arm architecture, but would run just fine on an 8-but micro, performance-wise.

Any idea what that use case might be?

Re:Linux on an 8-bit micro by afreak on Saturday April 20, 2013 @07:40PM (#5583256)
Reminds me of a fellow who got OS X to boot on an 680x0-based Mac: http://blog.makezine.com/2006/10/10/mac-os-x-panther-on-a-25...
Re:Linux on an 8-bit micro by signalsignal on Saturday April 20, 2013 @02:04PM (#5582250)
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
Re:Linux on an 8-bit micro by qb45 on Saturday April 20, 2013 @02:09PM (#5582269)
This is nothing unusual for W95.

http://support.microsoft.com/kb/138349

Re:Linux on an 8-bit micro by glabifrons on Saturday April 20, 2013 @03:07PM (#5582454)
Slightly closer to the original topic, here's Windows 95 running on a Nokia N900: http://www.youtube.com/watch?v=TxMYuCHxBgE
Re:Linux on an 8-bit micro by wazoox on Saturday April 20, 2013 @05:48PM (#5582938)
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.
Re:Linux on an 8-bit micro by qb45 on Sunday April 21, 2013 @04:56AM (#5584350)
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 by wazoox on Sunday April 21, 2013 @05:03PM (#5586398)
IIRC it may involve using some parts from Win 3.11 running on MS-DOS 7.0 and other windows 95 parts.
Re:Linux on an 8-bit micro by sigkill on Saturday April 20, 2013 @04:47PM (#5582755)
I personally remember running Windows 95 on a 33MHz laptop, although it had a Math Co-processor to be fair. :P
Re:Linux on an 8-bit micro by aquadrop on Saturday April 20, 2013 @04:38PM (#5582729)
This kind of things makes me shiver when I think how much awesomeness author injected in his project. I bet he also had tons of fun.
Re:Linux on an 8-bit micro by ams6110 on Saturday April 20, 2013 @06:39PM (#5583105)
Did Minix ever run on 8-bit? I remember running it on an 8088-based PC, which was sort of an 8/16 bit hybrid.
Re:Linux on an 8-bit micro by me2i81 on Saturday April 20, 2013 @10:06PM (#5583583)
An 8088 was a 16-bit cpu with an 8-bit bus, so it was slower (and cheaper) but ran exactly the same code.
Re:Linux on an 8-bit micro by D9u on Saturday April 20, 2013 @02:29PM (#5582334)
Awesomely cool project, but I was somewhat dismayed by the choice of GNOME, as GNOME is quite bloated and a smaller window manager, instead of a DE, seems to make more sense while not detracting from usability.
Re:Linux on an 8-bit micro by andthen22 on Sunday April 21, 2013 @08:40AM (#5584661)
hahaha, this comment is hilarious. The guy got an 8-bit tiny little 55 cent chip (8 bits means an isntruction is between 0-255) to slowly crawl its way through pretending to be a real mdoern CPU by pretending to execute a real modern desktop CPU instruction every few cycles.

He got it to starting up x in a day and you're like, "Cool project bro but I'm dsmayed by the choice of GNOME".

saying it, "detracts from usability." this is just hilarious.

Re:Linux on an 8-bit micro by blaabjerg on Sunday April 21, 2013 @11:10AM (#5585071)
I'm still confused as to whether he's being serious or trolling us hard.
Re:Linux on an 8-bit micro by D9u on Monday April 22, 2013 @11:49AM (#5589872)
I'm just a GNOME hater... Forgive my uninformed comments.
Re:Linux on an 8-bit micro by blaabjerg on Saturday April 20, 2013 @03:14PM (#5582477)
I don't think there's any graphical usability whatsoever, as the only output is a serial line. He only mentioned X and GNOME to emphasize the fact that it can be started.
Re:Linux on an 8-bit micro by dmitrygr on Saturday April 20, 2013 @10:15PM (#5583610)
Emulator supports framebuffer emulation, and I have run gnome on this. I have not tried KDE :)
Re:Linux on an 8-bit micro by D9u on Sunday April 21, 2013 @12:06AM (#5583806)
I suggest using a Window Manager, such as DWM, instead of a full Desktop Environment like GNOME/KDE/etc.
Re:Linux on an 8-bit micro by iso8859-1 on Saturday April 20, 2013 @05:14PM (#5582834)
I wish he'd use a proper license. I can't mix it with anything like this.
Re:Linux on an 8-bit micro by dmitrygr on Saturday April 20, 2013 @07:32PM (#5583237)
such as?

- dmitrygr

Re:Linux on an 8-bit micro by iso8859-1 on Saturday April 20, 2013 @08:05PM (#5583298)
Hi Dmitry.

I'd get rid of the non-commercial requirement, but I guess you have a reason for choosing it. But it causes incompatibilities with GPL'ed software for example, since the GPL requires commercial to be allowed.

I'd recommend one of the licences listed on http://opensource.org/licenses like the GPL.

Creative Commons has a nice license chooser, if you want a proper licence with the restrictions you currently have: http://creativecommons.org/choose/ For example the BY-NC-SA (attribution, non-commercial, share-alike) license is pretty much what you have currently. It is still GPL incompatible, however.

The Free Software Foundation has a list of licences too: http://www.gnu.org/licenses/license-list.html

Thanks for your patience.

Re:Linux on an 8-bit micro by dmitrygr on Saturday April 20, 2013 @10:14PM (#5583603)
I considered GPL, for a while, actually. I'll think of it some more
Re:Linux on an 8-bit micro by teeja on Sunday April 21, 2013 @12:18AM (#5583830)
Given a choice between the fun of 8-bit programming and the stodgy functionalism of a mere OS? hmmm... let me think. (1MHz @ 4 cycles/instruction = 250K instructions.)
Re:Linux on an 8-bit micro by iso8859-1 on Saturday April 20, 2013 @04:21PM (#5582669)
Video describing the boot process: http://www.youtube.com/watch?v=nm0POwEtiqE
Re:Linux on an 8-bit micro by weekends on Saturday April 20, 2013 @04:11PM (#5582624)
Next Challenge get this working on my Z80
Re:Linux on an 8-bit micro by sprash on Saturday April 20, 2013 @05:45PM (#5582925)
For that you have UZIX (http://uzix.sourceforge.net/) or the predecessor UZI.
Re:Linux on an 8-bit micro by dmitrygr on Saturday April 20, 2013 @10:16PM (#5583611)
just compile, hook up ram, and run :)