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]
He should add a cooling system and overclock the ATMega for improved performance!
This IS hack a year! Mindblowing!
This is beautiful. Brofist.
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).
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.
WOW!
awesome!
I would hardly call this the “worst Linux PC ever”.
This is really very impressive.
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.
Yes this is really awesome. Great job, Dmitry!
hilariously awesome
April fools
exactly
multicore! multicore!!!
🙂
Hah! i was thinking the same thing! 😀
Wow, amazing work 🙂
@robint91: No april fools. It works. See long video or build one to try
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.
Hmm… I’m sure there is an x86 emulator which could run on the Arm emulator…
Yo dawg! I heard you like emulators?
go with an 64-bit on the x86. take the clock down to the Hertz!
It’s actually hard to get an SD card smaller than 1GB these days unless you look in trash bins or shop on ebay. Normal stores don’t carry them.
@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)
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!
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).
and to think that is the time lapse video haha
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! 😀
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
Please make a video of it running jslinux ! Pleeaase !
Small point. Linux does not require a MMU. The No-MMU variants were long ago merged into the main source tree.
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
Now see if you can get an X session to boot up in time for xmas.
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!
Ok seriously , this has to be the best hack i have ever seen!(Or not since i cant access the web page 🙁 )
Which page can you not access? My site seems to be up just fine
Delightful. Smart. Funny. This made my day.
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!
Given the power draw is about 40mA @ 5V, I just might do this 🙂
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)
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!
“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.
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 😛
Linux on a C-64, Linux on a C-64!
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 🙂
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
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.
That’s interesting. We need to design a major city that can run Doom. Everyone go get jobs as architects!
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
An ENIAC had what, cycles/hour? Then again, those people wanted 32-bit machines with no caching or anything. 🙂
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… 🙂
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..
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!Sorry, meant to specify that the DS removed the link port. The GBA doesn’t have the RTC.
This is thoroughly coated in awesome sauce. Wow! Nicely done!
wait – how does it to boot to X without a framebuffer?
Man, you’re awesome!
So, he created an IBM xt (Actually the xt ran 4.77mhz) and booted linux.
@joshua. See source code. I support LCD emulation and even you can hook up an LCD to it easily.
A lot of time is done decompressing Linux, he shouldn’t have compressed the image..
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
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.
reminds me of this article. lol.
http://www.bbspot.com/news/2008/12/linux-on-a-potato.html
A potato would be the perfect case. Natural cooling and all that.
This is utterly pointless. And I love it.
I like to see Linux running in a Z80 machine, like a old Spectrum 48k 😀
Or ever better, a Game Gear.
It will be nice a Z80 linux version. It could be awesome running in a old Spectrum 48k 😀
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.
right now the bottleneck is cpu
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.
The 24MHz crystal is hidden beneath the AVR (the socket gives enough vertical clearance to do that).
“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.
I want to see how badly this does Hugos Random Benchmark from my local LUG! http://www.hants.lug.org.uk/wiki/HugoRandomBenchmark
Can the same thing be done with a Propeller chip?
Why not?
I wouldn’t mind an MCU based SSH terminal…. hmmmm…
I want to see a Turing Machine that can boot Linux…
I want to see a non-Turing machine that can run Linux. Is that even possible?
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
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.
Wa Wa WiVa!!! I love it!!!
This is as fast as my first Packard Bell pc.
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 🙂
“genius or madness?”
having known dima for a while now, I can definitively say “both” 😛
good stuff as always, you crazy sonnofagun.
For you 8 bit fans, try
http://nuttx.sourceforge.net/
but can it run crysis?
haha beautiful..
this is one of those “dont ask” because you can things..
except… he took it too far 😉
/lamer
What about TCP/IP? Can it do RFC 1149?
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).
Great work!
Now it’s possible to run simply any OS on an Atmega, just run it in a VM…
You misspelled “awesomest”.
Since when is being slow deserve to be called the ‘worst’. I think it is a very special pc linux pc 🙂
ftw!
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
but… will it blend?
awesome!
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.
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…
God level porting
Hey !
I want to ask you 🙂 is this could be even somehow possible, to add RAM to arduino MEGA ?
Thanks 😉
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.