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).
The real question is can it play 8-bit games.
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.
It is possible to make it worse.
Just swap out the ATMegas built-in clock for a pushbutton.
Yes this is really awesome. Great job, Dmitry!
hilariously awesome
April fools
exactly
multicore! multicore!!!
:)
Hah! i was thinking the same thing! :D
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!
Debian on m86k on Alpha on SPARC on x86_64 on x86 on ARM on AVR on valve PC.
millihertz.
Drive the damn microcontroller using the Saturday clock https://hackaday.com/2017/03/21/saturday-clock-an-0-000011574hz-attiny85-clock/
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! :D
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 :P
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!
Not any Turing machine can emulate any other Turing machine. Any Universal Turing machine can emulate any other Turing Machine.
Given enough memory and time… :P Yeah, technically there are nonuniversal machines but who the heck uses them? If it supports a modern compiled language like C, then it pretty much [i]has[/i] to be universal. Loops, conditions, variables, and so on are based on the assumption that the targetted machine is universal. Sorry about not being more specific.
Obligatory XKCD: https://xkcd.com/505/
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.
I’m installing Linux on a K&E 10-inch slide-rule. So far it’s taken over five years to boot.
This is utterly pointless. And I love it.
I like to see Linux running in a Z80 machine, like a old Spectrum 48k :D
Or ever better, a Game Gear.
It will be nice a Z80 linux version. It could be awesome running in a old Spectrum 48k :D
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?