
Linux on an 8-bit micro - sigkill
http://dmitry.gr/index.php?r=05.Projects&proj=07.%20Linux%20on%208bit
======
jwr
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!

------
DanBC
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://web.archive.org/web/19990117003949/http://www.uk.linux.org/ELKS-
Home/index.html))

(<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>)

~~~
TheBoff
Well, getting Linux working on a laptop was more a case of exciting driver
wrangling, rather than performance limiting.

------
qb45
_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.

~~~
cturner
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.

~~~
jrabone
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/>

------
sigkill
This guy is definitely a genius... or insane. It boots the full graphical
desktop in around 6 hours.

~~~
jmtame
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.

~~~
dmitrygr
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 :)

~~~
jmtame
Very much looking forward to seeing what happens if you venture out into
startup land again :)

By any measure, Palm Powerups was very successful.

------
renanbirck
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 :)

------
jared314
Previous Discussion:

<https://news.ycombinator.com/item?id=3767410>

------
iso8859-1
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...](https://github.com/ysangkok/linux-on-an-8-bit-
microcontroller)

------
icebraining
_Curiously enough, once booted, the system is somewhat usable. You can type a
command and get a reply within a minute._

~~~
deweerdt
_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._

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

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

~~~
lelandbatey
For the extremely lazy, the exact moment of the quote:

[http://www.youtube.com/watch?feature=player_detailpage&v...](http://www.youtube.com/watch?feature=player_detailpage&v=qpMvS1Q1sos#t=75s)

------
iso8859-1
Comments from Dimitri last time this was on HN:
<https://news.ycombinator.com/threads?id=dmitrygr>

------
glabifrons
Am I the only one who noticed his "clock" is an aircraft altimeter? This guy
is awesome! :)

------
JulianMorrison
Never underestimate the Portia[1] trick.

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

------
geon
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?

------
afreak
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...](http://blog.makezine.com/2006/10/10/mac-os-x-panther-on-a-25m/)

------
signalsignal
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>

~~~
wazoox
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.

~~~
qb45
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.

~~~
wazoox
IIRC it may involve using some parts from Win 3.11 running on MS-DOS 7.0 and
other windows 95 parts.

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

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

~~~
me2i81
An 8088 was a 16-bit cpu with an 8-bit bus, so it was slower (and cheaper) but
ran exactly the same code.

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

~~~
andthen22
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.

~~~
blaabjerg
I'm still confused as to whether he's being serious or trolling us hard.

~~~
D9u
I'm just a GNOME hater... Forgive my uninformed comments.

------
iso8859-1
I wish he'd use a proper license. I can't mix it with anything like this.

~~~
dmitrygr
such as?

\- dmitrygr

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

~~~
dmitrygr
I considered GPL, for a while, actually. I'll think of it some more

------
teeja
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.)

------
iso8859-1
Video describing the boot process:
<http://www.youtube.com/watch?v=nm0POwEtiqE>

------
weekends
Next Challenge get this working on my Z80

~~~
sprash
For that you have UZIX (<http://uzix.sourceforge.net/>) or the predecessor
UZI.

