Building the worst Linux PC ever

Linux is generally considered the go-to OS for under powered computers. Wanting to challenge the preconceived notion that Linux requires ‘a computer made in the last 20 years,’ [Dmitry] built the worst Linux PC ever around a simple 8-bit microcontroller.

The ATMega1284p [Dmitry] used doesn’t have a lot to offer as far as RAM and storage goes; just 16 kilobytes of SRAM and a paltry 128 kilobytes of Flash storage. While this may be voluminous in the embedded world, it’s peanuts compared to the gigabytes of RAM and hard drive space on even a low-end netbook. To solve this problem, [Dmitry] threw an antique 30-pin RAM SIMM at the problem. It’s wired up directly to the microcontroller, as is the 1 Gigabyte SD card that serves as the PC’s hard drive.

Linux requires a 32-bit CPU and a memory management unit, something the puny microcontroller doesn’t have. For [Dmitry], the best course of action was emulating an ARM processor on an AVR. We’re not sure if we’re dealing with genius or madness here, but it did prove to be a valuable learning exercise in writing a modular ARM emulator.

How fast is it? [Dmitry] tells us it takes two hours to boot up to a bash prompt, and four more to load up Ubuntu and login. If you want a Megahertz rating, good luck; the effective clock speed is about 6.5 kilohertz. While the worst Linux PC ever won’t win any races, its simple construction puts it within the reach of even the klutziest of hardware builders; the entire device is just a microcontroller, RAM, SD card, a few resistors, and some wire.

If you’d like to build your own worst Linux PC, [Dmitry] has the firmware and disk image available to download. If you want to watch the time-lapse of this thing booting, check out the video after the break.

[vimeo=39286771]

Comments

  1. Freax says:

    He should add a cooling system and overclock the ATMega for improved performance!

  2. HuB says:

    This IS hack a year! Mindblowing!

  3. FrankTheCat says:

    This is beautiful. Brofist.

  4. Neil Cherry says:

    It’s madness, it’s brilliant, but it does show what can be done with an 8 bit (and why it’s sometimes a good idea to use more powerful processors).

  5. Bertho says:

    Absolutely gorgeous!

    I’d like to see the ping statistics on this one. Give this board some wings and there is still time until April 1st to get RFC 1149 implemented.

  6. chippy says:

    WOW!
    awesome!

  7. Sam says:

    I would hardly call this the “worst Linux PC ever”.

    This is really very impressive.

    • Someone in Haiti says:

      Well, as far as performance goes, yes… it IS the worst linux pc ‘ever’ by todays standards.

      Brilliant, daring, crazy – yes. but it is without doubt the slowest thing you could make, and THAT gives it the right to be called the worst ever.

  8. svofski says:

    Yes this is really awesome. Great job, Dmitry!

  9. rasz says:

    hilariously awesome

  10. robint91 says:

    April fools

  11. rue_mohr says:

    multicore! multicore!!!
    🙂

  12. Riktw says:

    Wow, amazing work 🙂

  13. Dmitry Grinberg says:

    @robint91: No april fools. It works. See long video or build one to try

  14. Max says:

    1GB of disk storage. Wow that’s quite a lot.
    I used to run Linux on my 386SX with a 40MB hard disk and I think I had 2MB of RAM. Maybe only 640Kb.

    Its always best to only boot such beasts up to the command line. Going into X is normally a bit painful and with different virtual terminals on each F key and mouse/console integration, what do you need any sort of windows for anyway.
    If you must go graphical. OLWM or TWM, FVWM2 if you want to go crazy. No Gnome that’s for sure.

  15. @Max: for this demo I used jaunty-minimal which is 300mb or so, so a smaller card will do. You can use anything else (smaller or larger). I have xfce working too (emulator supports lcds, as you can see in code)

  16. Jeremy says:

    Amazing. Most people who would have considered something like this would have vetoed the idea immediately after conception, but this is a shining example of how nice it is to see “badness” in action.

    Stellar job, Dmitry!

    • Joe says:

      For good reason. “You’re solving the wrong problem.”

      It’s cool that it runs Linux, though. A better idea would be to run something like a BASIC prompt ala the old Commodore 64. You wouldn’t even need to shoehorn a SIMM module or kernel, although it would be wise to have a DOS. Just use a cheap 4GB SD card and you’re good to go for unlimited storage. 😉 Note: DOS doesn’t equal MS-DOS clone. Think of just file I/O support with program loading (bootstrapping).

  17. Willaim says:

    and to think that is the time lapse video haha

  18. Havel says:

    If Linus Torvalds was here to see this, he’d want to shake your hand Dmitry. There’s proof that you can boot Linux on just about anything. Now to attempt porting Linux to my Sony Clie. (With a 66MHz processor and 128MB of external storage, I’m sure it’d boot in a reasonable time. lol) Very nice work! 😀

  19. The video on vimeo is NOT a timelapse – it is the normal realtie video. The one on youtube is the video with useful parts only and sped up. see the writeup on my site for the youtube link

  20. agumonkey says:

    Please make a video of it running jslinux ! Pleeaase !

  21. Paul says:

    Small point. Linux does not require a MMU. The No-MMU variants were long ago merged into the main source tree.

  22. Well, ubuntu requires an MMU, as do all major distros. Plus without an MMU, you cannot really use swap very well, and then i’d need a while lot more memory than 16MB

  23. naturetm says:

    Lol, amazing! Seeing this made my day. I’ll have to remember it for inspiration when I tell myself something can’t be done. Thanks!

  24. dmcbeing says:

    Ok seriously , this has to be the best hack i have ever seen!(Or not since i cant access the web page 🙁 )

  25. Which page can you not access? My site seems to be up just fine

  26. rossum says:

    Delightful. Smart. Funny. This made my day.

  27. wetomelo says:

    That’s what i call a hack! +1: To “trim the cost” a bit more, power it with an array battery of discarded fruit, or saltwater & coins!

  28. mur1010 says:

    This is awesome.

    Next: Get some tubes, rebuild the ATmega with TTL (Tube-to-Tube Logic) and make it run at mains frequency. How many days for a bash prompt?

    But this project can be useful if you clock the AVR at 20MHz and use a text mode only TTY…

    Anyway I will try to port Linux to run on N8VEM. (First I must build my own N8VEM =P )

    • My AVR is running 24MHz (slight overclocking)

      • mur1010 says:

        Oh, I misunderstood the post. It says that the EFFECTIVE clock speed is 6.5kHz, I thought it was the REAL clock speed. Now, again, imagine some tubes running Linux at AC mains speed. It would take years to boot!

      • Dissy says:

        “Now, again, imagine some tubes running Linux at AC mains speed. It would take years to boot!”

        OK I had to do the math on this one.

        3.6khz takes 2 days. Scale that to 60hz (US Mains)

        3600/60*2 is 216.66 days, or just round up to 217 day periods.
        Strangely enough, 217 / 31 is exactly 7 roughly-months.

        This means the clock signal would need to be 15hz or less in order to break the 2 year mark, to deserve the “It takes years to boot” badge of (dis?)honor.

      • Sven says:

        Dissy, note that the real clock speed is probably 24MHz, the emulated clock speed is 3600Hz.

        If you scale down from 24MHz to 50Hz (since he is probably european) it would take 219 years instead of 4 hours 😛

  29. Hirudinea says:

    Linux on a C-64, Linux on a C-64!

    • boomlinde says:

      After seeing this I guess it’s not that farfetched with a 32 mb ram expansion unit and one of the sd card solutions available for the C64. The main problem will be that 6502 is a lot slower than the atmel processors, and that the clock speed of the C64 is already in the sub-mhz range 🙂

  30. Kevin Keith says:

    Ladies and Gentlemen,
    The Church-Turing Theorem

    Great job! I got into an argument awhile back with someone, who did not understand the distinction between “any turing machine can emulate another turing machine give enough memory” and “any turing machine can emulate another turning machine in a reasonable amount of time.” Little did he know he was implicity saying Church/Turing were wrong

    • Joe says:

      You would think this would be common sense… If they can simulate a machine on paper using simple rules… (designing it) Then you’d have to assume that it would apply to anything inbetween as well!

      But then again, most people’s training in state machines is limited to cases like: “how do I get it to defrost my frozen hamburger?” or “how do I shift gears?”
      That’s 2 systems that can’t really emulate much of anything without a lot of external hardware (not just an ‘unlimited tape’ AKA lots of data storage space). Tell them that a road system could be setup to emulate a simple computer assuming everyone followed the traffic laws most of the time and you had enough traffic to cover all cases, would blow their mind if they even believed you. Hell, most so-called computer scientists think that a state machine has to be 100% accurate (read: everyone follows rules and each case is done once and only once) to function properly. There are in fact computers based on many statistics. Heck, at some level, all digital switches are really only statistically correct. It’s possible to have error rates above 0 and still be able to use the PC for even sensative stuff like 3D games or running Prime95.

      See: https://en.wikipedia.org/wiki/Statistical_significance
      Essentially, a digital switch is trying to approximate 100% relationship to voltage thresholds (say, less than 0.8 and greater than 2.4V) at very high speeds that can cause errors to propagate. Digital != binary but this is where the term is conventionally applied.

      • Greenaum says:

        That’s interesting. We need to design a major city that can run Doom. Everyone go get jobs as architects!

  31. Ren says:

    Would Minix be better suited for 8-bit?

    • bare-metal coding is better suited for 8-bit. 🙂

      I was not aiming for practicality. In fact I am surprised it is as fast as it is, I was expecting to end up in the 500Hz range, and am happy I managed 7KHz

      • Joe says:

        An ENIAC had what, cycles/hour? Then again, those people wanted 32-bit machines with no caching or anything. 🙂

  32. xorpunk says:

    Get a socket and get a 333Mhz ARM(fastest non-BGA non-FPGA chip out there) and you have a more realistic solution on breadboard.

    This is pretty cool though, looks like something you’d see a demoscene coder doing instead of mediocre focused work like most people do..

    • Once again, this was done for fun, not for real computation. That being said, I did manage to use it for useful work a few times. In fact, I am adding save-state functionality, much like suspend-to-disk, so that I don’t have to wait the 2 hours every time to use it, even.

    • Plus, ARM chips never work by themselves enough to boot linux, you’ll also need RAM (almost never DIP package), a PMIC (usually needed are at least 2 supplies, almost never DIP package), ROM (for boot code), etc… 🙂

      • xorpunk says:

        Yeah I’ve researched it many times. Anything POP needs NDA legal stuff and bulk units, even if you don’t use their security API. No non-BGA POP exists though.

        The ROM is actually doable if you hsve a stencil kit.

        I think it’s all to keep market values up and competition down..

      • Joe says:

        High barriers to entry, xorpunk? Yeah, that’s old theory in economics under “how to maintain a monopoly to increase margins for a longer amount of time”. Pretty basic stuff, heh. Any information ‘out there’ can be used to bypass them – These companies sell the chips AND the software to program them so there’s a little left hand and right hand thing going on. It can also be used to find loopholes in their security like all the ‘vendor specific commands’ on ATA hard drives. Broadcom is awful at this. They assume that because the implementation is obscure, that no one will mess with it. Or that the documentation won’t get stolen/purchased by shells… Insane but hey, it’s their business. It just stinks as a hobbyist.

        BTW, the FCC is supposedly partially to blame? Ever try to find a scanner that does uncensored frequency blocks in the US? Repair manuals and schematics for ‘locked’ scanners?

        I went through this math before and an old Nintendo DS or GBA is perfect for this sort of stuff since it is even more hackeddocumented than the routers supported by DD-WRT. Just make a keyboard/serial port and library for your custom hardware and then any application can support keyboard entry and (optionally) a terminal. I have the GBA SP and it still has the functioning link port. Sadly, they ‘borrowed’ the link port to support the RTC and didn’t even run all the pins to the board from what I’ve read. Oddly, the port exists internally to the CPU die. The DS has WIFI, though so you can do a terminal over IP and not need some silly dongle!

      • Joe says:

        Sorry, meant to specify that the DS removed the link port. The GBA doesn’t have the RTC.

  33. Rob says:

    This is thoroughly coated in awesome sauce. Wow! Nicely done!

  34. joshua says:

    wait – how does it to boot to X without a framebuffer?

  35. George Dina says:

    Man, you’re awesome!

  36. Dave says:

    So, he created an IBM xt (Actually the xt ran 4.77mhz) and booted linux.

  37. @joshua. See source code. I support LCD emulation and even you can hook up an LCD to it easily.

  38. MrX says:

    A lot of time is done decompressing Linux, he shouldn’t have compressed the image..

  39. naugtur says:

    uClinux with microkernel would work on that much faster. It runs on picotux which up to now was the lowest-end machine I knew of.

    http://en.wikipedia.org/wiki/Picotux

  40. localroger says:

    Very cool!

    This reminds me of the ZiCog hack for the Parallax Propeller, emulating a Z80 in two of the 8 32-bit cogs it runs nearly as fast as an early Z80 machine and several people got CP/M running what used to be usable applications off SD cards with ca. 1980 CP/M disk images.

  41. Joe says:
  42. This is utterly pointless. And I love it.

  43. ZardoZ says:

    I like to see Linux running in a Z80 machine, like a old Spectrum 48k 😀

  44. ZardoZ says:

    It will be nice a Z80 linux version. It could be awesome running in a old Spectrum 48k 😀

  45. Rune K. Svendsen says:

    So what is the bottleneck? Have you done some profiling? Or is that a stupid question when using a CPU in the KHz range?

    • salec says:

      So what is the bottleneck? Have you done some profiling? Or is that a stupid question when using a CPU in the KHz range?

      Actually it is a very smart question! When everything is slowed down, bottlenecks are far more apparent as relative time differences are longer – lower the speed, higher the time resolution.

    • Daid says:

      I don’t see any crystal. So it must be running on 8Mhz internal clock. Boosting that to 20Mhz (or overclocking it to 32Mhz, which goes fine with most AVRs) will make it a lot faster.

      What’s the bottleneck in linux? Well, there are tools to measure that even on a normal system with very high accuracy.

  46. mrmajestic17 says:

    “We’re not sure if we’re dealing with genius or madness here…”

    I never knew there was a difference between the two 😉 In all seriousness though, this is a pretty awesome project.

  47. popeydc says:

    I want to see how badly this does Hugos Random Benchmark from my local LUG! http://www.hants.lug.org.uk/wiki/HugoRandomBenchmark

  48. Galane says:

    Can the same thing be done with a Propeller chip?

  49. Isaac says:

    I wouldn’t mind an MCU based SSH terminal…. hmmmm…

  50. I want to see a Turing Machine that can boot Linux…

  51. Valentin Angelovski says:

    Congratulations on your awesome effort Dimitry – no doubt this would have been an awful lot of fun for you!!! 🙂

    Most that I could achieve with my own 8-bit micro project (in this case, using a 150-MIPS 8052 to emulate an entire 16-bit x86 system) was getting it to boot minix 2.0.2 ..

    Link to my own ‘Flea86’ project:
    http://www.armchairarcade.com/neo/node/3810

    Regards,
    Valentin Angelovski

  52. warspigot says:

    This nothing! I did this with 3 transistors, a relay, 8 diodes and some toothpaste.

    But really, this is an awesome project. I think I’ve seen you’re name quite a few times on here before Dmitry. Actually just searched it. You’ve been on here LOTS of times.

  53. Alex B says:

    Wa Wa WiVa!!! I love it!!!
    This is as fast as my first Packard Bell pc.

  54. DeAuthThis says:

    Just freaking amazing Dmitry!

    I wonder though… what about finding or building a more light weight linux os? Perhaps getting it to boot faster..?

    Might I suggest minuetos?
    http://www.menuetos.net/

    idk how it’d work but you’ve proven just about anything is possible 🙂

  55. rrix says:

    “genius or madness?”

    having known dima for a while now, I can definitively say “both” 😛

    good stuff as always, you crazy sonnofagun.

  56. msr says:

    For you 8 bit fans, try
    http://nuttx.sourceforge.net/

  57. nedry says:

    but can it run crysis?

  58. lamer says:

    haha beautiful..

    this is one of those “dont ask” because you can things..

    except… he took it too far 😉

    /lamer

  59. tomppa says:

    What about TCP/IP? Can it do RFC 1149?

    • Ac says:

      If this could do tcp/ip it would multiply the awesomeness. I actually need a dirt ass cheap processor that does tcp/ip, for a custom cheap ddns client, and uses a Linux tool chain (it’s what I know).

  60. AlexF91 says:

    Great work!
    Now it’s possible to run simply any OS on an Atmega, just run it in a VM…

  61. Leo says:

    You misspelled “awesomest”.

  62. Josh says:

    Since when is being slow deserve to be called the ‘worst’. I think it is a very special pc linux pc 🙂

  63. daslive says:

    ftw!

  64. darkborn says:

    There was already LUnix, Commodore 64 port of L… Unix: not all *nix commands nor gui (as it is not in this case)… but there was obviously lower hardware dependency

    http://hld.c64.org/poldi/lunix/lunix.html

  65. radio says:

    but… will it blend?

    awesome!

  66. Malikaii says:

    This is the most amazing hack I’ve ever seen. I thought the relay-logic computers were the coolest, but this actually has GUI and everything. If you ever needed a benchmark for your competence, this is probably the best one you could manage. We are not worthy.

  67. Patrick says:

    See… Linux IS made for small devices 😉

    Now let’s wait for him to port Windows 7 (the 64 bit edition, of course 😉 to the AVR…

  68. Dawg says:

    God level porting

  69. ashirviskas says:

    Hey !
    I want to ask you 🙂 is this could be even somehow possible, to add RAM to arduino MEGA ?
    Thanks 😉

  70. cr8s says:

    Part of the reason that this build is taking forever to boot and running like garbage (forgive me for saying so) is because you’re trying to run Ubuntu Jaunty on it.

    Maybe see what kind of mileage you could get with your 8-bit ARM microprocessor and, say, BasLin/DSL/TCL or something to that effect.

    Now, I’ve seen some just plain ridiculously refactored code done in assembler (like, absolutely SILLY amounts of graphics rendering in under 64kb) so I’m thinking it might be possible to actually code an entire Linux distro in asm and come up with something that actually RUNS on this tiny computer.

    If we do THAT, I have a feeling it would have a significant impact on computing in general. We have these beasts of machines and tap barely 1% of their potential by stacking clumsy and kludgy code on top of even clumsier code.

Speak Your Mind

*

Related Hacks in Microcontrollers

  • Accessing an SD card through a parallel port, just because
  • Morse Code interpreter
  • One wire reads the keypad from the APRS radio mic
  • Level conversion with plenty of options
  • Music visualization generator with a Propeller