GNU/Linux Running On An 8-Bit Processor
dartttt writes, quoting Ubuntu Vibe: "Dmitry Grinberg has successfully booted Ubuntu 9.04 on an 8 bit micro machine with 6.5 KHz CPU and 16 MB RAM. Grinberg did this experiment on a ATmega1284p, 8-bit RISC microcontroller clocked at 24MHz and equipped with 16KB of SRAM and 128KB of flash storage. Since the RAM was too low, he added 30-pin 16MB SIMM to the machine and a 1 GB SD card to host Ubuntu image. ... To get the world's slowest Linux Computer running, he had to write an ARMv5 emulator which supports a 32bit processor and MMU. A similar machine can be made very easily and everything should come in about $20."
There is source code available, but it's under a non-commercial use only license. Just how slow is it? "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. The effective emulated CPU speed is about 6.5KHz, which is on par with what you'd expect emulating a 32-bit CPU & MMU on a measly 8-bit micro. Curiously enough, once booted, the system is somewhat usable. You can type a command and get a reply within a minute." If you like watching a whole lot of nothing, there's a video of the boot process below the fold.
We booted an OS nobody uses on hardware nobody uses. WE ARE SO COOL!
Why?
And the law of "linux runs on everything and if it doesn't, it will" persists.
They'll submit "FIRST POST"
Have gnu, will travel.
Posted from a 8 bit micro machine with 6.4 KHz CPU and 16 MB RAM
Waste of time for anyone with anything important to do. Like watch TV.
Boot time: 17 days
But was there a point to this?
What political party do you join when you don't like Bible-thumpers *or* hippies?
well.. my record is running debian testing on od 286 processor 75 MHz with 16MB RAM. It was quite usable in X with PWM window manager.
#
#\ @ ? Colonize Mars
#
On one level this shows just how clever Dmitry is and it shows excellent problem solving skills. However, I would be more impressed if he could do something interesting with more modern technology. The technical challenges of booting a modern OS on dinosaur hardware are amazing and if he could take his innovation ability and apply it to state of the art technology, image what he could achieve.
Nice trick. However, let me point out that in 1990 Geoworks GEOS was capable of running a preemptive multitasking GUI looking much like QT but with better automatic widget layout, on an 8 MHz 8088. I will just heave a great sigh in the name of the lost art of tight coding. No, Linux is not tightly coded. I should know. The best you can say about it is, the other guys are worse.
Have you got your LWN subscription yet?
god bless you man!
It's probably one of the most expensive capacity/$ solution out there.
...until we get a joke about running Java on it.
This whole project, while seemingly pointless, seems pretty damn interesting to me.
Question for Linux hackers: is there a reason why the Linux kernel would not be portable to an Atmel AVR microcontroller?
"The agriculture ministry is not in charge of Gundam" - Japanese ministry official.
An ARM emulator running on an 8-bit microcontroller.
Alan Turing strikes again!
No version of windows ever ran on an 8-bit processor. Windows 1.0-3.0 would run on an 8086, but that is still 16-bit, and Windows 3.1 won't even run on that, it needs a 286 or higher.
I'm kind of surprised that he chose to use ARM emulation for this, and not try to use the bare AVR ISA. There is no MMU, but as far as I know, the rest of the AVR architecture is a pretty normal RISC machine with decent GCC support. Could uC Linux not be ported to 8-bit AVR?
I guess it must come down to required 16-bit and 32-bit sizes assumed by Linux.
Maybe this would be a hell of a lot more work, but it would probably run faster.
So what the article is basically saying is that this runs better than Windows 98ME?
The emulator is cool, but for $40 he could have bought a Rasberry Pi
Can it play Crysis ?
...oh wait, I see what you did there.
coding is life
Let me guess, the DMV ordered 1000 copies..?
"slowest Linux Computer running"...
I beat that score by a large margin. Years ago I took an old 386 Laptop that ran at 25Mhz, I don't recall how much ram it had, but I am going to go with "not much", and booted DSL (Damn Small Linux) in just over 21 hours. Which is over 10x as slow as the one in the article! So technically I think I had the "slowest Linux computer".
Why did it boot so slow? Well it was also the reason I used DSL, because it was less than 50MB, and I could fit it on a Zip drive. Attached via a parallel cable. It did work, and it did eventually boot, however I had to leave it over night (I thought it would eventually just crash), but it worked its way through. Also on a fun note, when typing and executing commands it was like telneting to the moon, there was like a 4-5 second delay between typing any command hitting execute, and any sort of result. I really just wanted to see if it was possible to install and run an OS on a zip drive connected via a parallel port. The answer is yes, but not very well.
When can I expect a Commodore 64 port?
Any insufficiently advanced magic is indistinguishable from technology.
was a 75 mhz, 8 meg ram, had a 4x cdrom (hence the cd supreme) it came with windows 3.11 on it and used trumpet winsock to get online.
I formatted it and installed Slackware Linux I got from a CD inside a book at "Waldenbooks" store I had bought on linux. I think it was somewhere around 2.0.20 - 2.0.29 era linux kernel.
Anyhow slackware on a 75mhz/8 meg ram was much much more fun and easier getting online than dealing with win 3.11 and trumpet winsock. I was shocked that slackware recognized the on board modem and the cdrom since the cdrom in that thing connected to a funky riser card.
Tsk... you're doing it wrong, son!
Use Tiny Core, not Ubuntu.
What's with people these days? Complaining Linux is heavy because Ubuntu is heavy... what gives?
That's how this is best thought of. In effect, he used an AVR chip as the microengine for a vertically-microcoded implementation of ARMv5, with some extensions. It's not as if Linux is running natively on an 8-bit architecture; that's be like saying, for example, that when OS/360 was running on a 90-bit-instruction/32-bit data VLIWish Harvard architecture machine when it's running on a System/360 Model 50.
You forgot to add M$, most of the people in 1995 wrote this with M$.
I've worked as a logic monkey building CPUs in the past - this is SOP in our world - we'd boot linux on our hardware on the verilog simulator as part of our QA - 2 hours is nothing .....
It's not even a new idea 20 years ago I used to port Unix for a living (no linux yet), when the early RISCs came out they came with architectural simulators, while waiting for real silicon we'd spend the time bringing the kernel (and compiler) up
Dang! Wonder what it would do on my AMD quad-core FX system with 8GB?
Emulators are not microcode.
Does it run netBSD?
-
Next will be a single-bit CPU running Linux 3.4, just to show off its capabilities. Boot time - 1 month.
Wut a piece of shit. Cant even do number bigger then 15. This faget should get a better computer, then he wood have something useful. I dont no wut this proves execept that some faget can install shitty linux on shitty computer.
He built an ARMv5 emulator for an 8-bit AVR.
OK, it's tedious, and a lot of work, but it's not the amazing feat that everyone here seems to think it is... he didn't port Linux to run on an 8-bit micro. He instead built a PXA255 SOC system emulator, that runs on AVR.
A skilled programmer can build an emulator for any architecture they are intimately familiar with.
OK, it's an amazing feat. Dimity, certainly has the skills.
But if I knew ARM as well as he does (which I don't) then I can write an ARM emulator for my Altair 8800b. (Yes, I still have one). After that, my Altair can run Linux too. What I am familiar with is SPARC v8, MIPs, and POWERPC. I developed on SPARC processors in the 90's, and I have written a PPC emulator myself, and I have been part of the PearPC project too in it's past. So perhaps from my background I am less impressed than most others here seem to be.
However, good on him.. :) It's still an accomplished feat. I just think that everyone here is praising too much, and perhaps its not what they think it is.
And yes, I admit I'm a little jelly because I don't blog about what I do now or what I have accomplished in the past, but I see myself on the same or better skill level than those who do blog and get all the coverage. :) I'm old school.. I don't blog anything.
-- cheers!
Emulators are not microcode.
So how exactly is a processor running a program to implement another instruction set architecture, with the main memory used by the implemented ISA being accessed by special operations, and with the program and its internal data existing in a separate block of memory, different from, say, a (vertical) microcode engine, running microcode to implement another instruction set architecture, with the main memory used by the implemented ISA being accessed by special microcode operations, and with the microprogram and its internal data existing in a separate block of memory?
No wonder it took so long to boot. Did they actually mean 6.5 MHz? Hell the Vic-20 was 1Mhz.
And what 8 bit processor can address 16MB of RAM? An 8 bit processor can only address 64K at a time, unless they had some bank switching going on..
I would RTFA, but it's slashdotted...
Visit the Arcade Restoration Workshop @ http://www.arcaderestoration.com
Linux isn't cross-platform and fast enough until you can throw a few switches, compile it for this hardware, and have it run at speeds comparable to existing OSs that are designed for the hardware.
What was done (from the summary) was to run an ARMv5 (32-bit) emulator on the 8-bit processor. Then run Ubuntu on the emulator. Not to take anything away from the accomplishment, but that is not the same as porting / running Ubuntu on the same processor.
And what 8 bit processor can address 16MB of RAM? An 8 bit processor can only address 64K at a time, unless they had some bank switching going on..
We had MMUs ... very old concept you know. Back in 87 I had a 6809 box with 512K of ram and a MMU running OS-9 level 2 with a serial terminal hooked up to it and everything. Excellent basic, pretty good c compiler... It was 1993 before I had software and OS that technologically advanced on a IBM PC.
"Science flies us to the moon. Religion flies us into buildings." - Victor Stenger
1. the emulated cpu *effective clockspeed* averages 6.5 KHz in released code (10KHz with better RAM code, that i am releasing later today)
2. Site is still up (it occasionally hic-ups with a 4xx ot 5xx HTTP error, but mostly it is still up
3. the linux ram is a 30-pin SIMM of 16MB capacity, the interface to which (incl. refresh) I bit-banged using 3 8-bit IO ports. The AVR's internal RAM is used for emulator SoC state, AVR stack, and the icache
-------
1. Enjoy your job
2. Make lots of money
3. Work within the law
Choose any two.
And where is the editor?
Really? It runs "GNU/Linux"? Let it go, already; it's called Linux.
... this comment apears I already dead.
... install Linux on a '486 system with a mere 16MB of RAM? I still recall how POed I was when I needed to borrow RAM frmo another system to install Red Hat because the new Anaconda required 32MB. (Because, you know, all that additional memory was required for that slide show showing you all the cool features that you were probably going to be too lazy to read about.)
CUR ALLOC 20195.....5804M
I liked it when DOS would just suddenly reboot before you could save your file.
Also fun was menus for selecting different config.sys options so you could use different programs. If you wanted to switch programs you sometimes needed to reboot to have enough conventional memory free, or to boot without a memory manager installed because the lame game had a built-in one that wouldn't co-exist with emm386.
Yes, it is slow, but if you could get the same chip running at modern speeds (say 4GHz) you would get bash after 30s (assuming 10MHz effective 32bit speed as claimed after the latest update) which is not bad!
Imagine... a whole Beowulf cluster of these !!!
C|N>K
A few years back, some uber-geek crammed UNIX v5 onto a Gameboy. Guess he got bored or something. Slashdot article here: http://tech.slashdot.org/story/04/09/08/1225208/running-ancient-unix-on-nintendo-gameboy
C|N>K
if I wanted to watch a computer boot for hours on end, I'd install Microsoft Windows.
So how exactly is a processor running a program to implement another instruction set architecture, with the main memory used by the implemented ISA being accessed by special operations, and with the program and its internal data existing in a separate block of memory, different from, say, a (vertical) microcode engine, running microcode to implement another instruction set architecture, with the main memory used by the implemented ISA being accessed by special microcode operations, and with the microprogram and its internal data existing in a separate block of memory?
Each would be granted a separate patent?
-=Lothsahn=-
AMAZING WORK!!!!!
So, was that a SWTPC? I remember loading BASIC on one of those via Kansas City Format (14 minutes.) It had both A$ and B$! Not that there were any string operations, but you could input and print them.
It was still better than the high school "computer", a DECwriter II with a 300 baud acoustic modem to the uni computer on the other side of the state. Ah, the days of making obscene teletype calls.
-- I have a private email server in my basement.
So are you down to a 2.6hr boot time? Or there-abouts?
moox. for a new generation.
Main engine fuse blew out, I was 60 miles from anywhere, and for whatever reason, had a cheap ass fork in my car. Bent up the middle two tines, shoved the outer tines in the fuse holder, taped the hell out of it to prevent shorting and away I went.
Also, don't try this at home, if the fuse blew, there's probably a reason, etc, etc, etc.
I never knew you had Slashdot UID!
Donte Alistair Anderson Roberts - hi son!
Karma: Chameleon
Well, technically it's a a combination of GNU software with the Linux kernel.
Realize that Linux is just a kernel, and the GNU packages create the distribution in whatever iteration that distribution manufacturer puts them together.
I realize you were trying to be a douche, but I had to toss that out there.
-- This space for lease, low setup fee, inquire within!
from a generation that hand built their own computers, I am truly impressed that you tried, and succeeded.
There was an unknown error in the submission.
Four hours to boot.. How long did it take to debug this?
Well, 10KHz doesn't sound that bad if you manage to cool it to nanokelvin or so..
I dream of a CPU that fast. :) When developing our new CPUs we run them in RTL-simulators. At a realtime speed of about 100Hz. Yes, no Kilo and no Mega. Herz is what we got. Linux takes about a month to boot to init at that speed. After removing the (at 100Hz) almost eternal bogomips loop that is... Needless to say Linux is a useless ancient behemoth at that speed so we write our own OS for running in simulator.
... and try to play a round of crysis 2. that will be a useful setup.
If you can get the java working on your 1284p you could run Avora to simulate an internal 1284p. It's faster than real time because it goes by events rather than single cycle emulation, on my desktop it is actually 5x faster. Run your system on the simulated MCU and you're up to 50KHz. A couple more iterations of Avrora might give over a MHz! Probably would hit a memory limitation at some point though...
And I hold in high regard anyone who would spend so much of his lifetime bringing computing to the autistic.
E Proelio Veritas.
So this is a bit late.
To have a right to do a thing is not at all the same as to be right in doing it
I've used two Parallax Propellers, working in lockstep, to speak directly (via general purporse I/O -- GPIO pins) to gigabyte DDR3 sticks. The latter run fine even if you clock them at a couple MHz. The Prop cannot really "address" anything besides the built-in cog and hub memories! You don't have to use the CPU's native bus to address memory -- heck, many MCUs these days do not expose internal busses at all, the pins are only GPIO. The Propeller has 512 32-bit words of cog memory, and 64 kbytes of hub memory (half ROM, half RAM). I've found that when designing for consumer RAM, it pays to use the most recent spec -- it's usually the cheapest.
A successful API design takes a mixture of software design and pedagogy.
you now have the skills to make your own ARM processor.
Yeah, except the key skill of negotiating with ARM for a patent license.
You could do better than that with a Tandy color computer and BASIC09. for a BASIC, it was pretty nice..
"Science flies us to the moon. Religion flies us into buildings." - Victor Stenger
The first thing that came to my mind before I read the headline fully.
Wow 16MB 30-PIN SIMM! Never did managed to find anything bigger than 4mb which I used for several years after their eol with a Sound Blaster 32 (SB32). To note I also paid $400CDN for each 1MB SIMM ($1600 for 4mb or ram)
I'm ready to excuse myself and go masturbate.
So you expect a virtual AVR running on Java running on a real ARM to be a 5x speedup over native code, even though your massively more powerful PC could barely manage 5x real time speed emulating the same AVR?
Sorry, that's not how it works.
Although it is theoretically possible for a very optimized emulator/dynamic translator to be faster at running poorly optimized native code on the same CPU than the actual CPU itself (by optimizing it), I'm not aware of any circumstances where something like this has actually been used in practice and been useful. And certainly not anything written in Java. The closest thing I've heard of were x86 emulators for Itanium beating the Itanium's built-in x86 support, but the emulators were of course translating to IA64, not to x86, so it doesn't count.
Why is the kernel timing information wrong? The numbers prepended to every line by printk() should show the seconds/microseconds since the machine was booted, but after two hours, the machine has only counted a couple of seconds. Does the emulator not emulate an RTC at actual speed?
But can it run crysis?
This was a few years before the COCO, even before the TRS-80 Model I.
-- I have a private email server in my basement.
Using a smaller linux distro, (ie; any derivative of Puppy linux, minimal Gentoo) would make this a bit more feasable. Ubuntu 9 is a slow boot even on an early Athlon machine...
It is a very interesting and nice experiment. It show GNU/Linux and your/our mind is jumping above limits! Go, GNU/Linux, go!!!
It works on almost everything!
Whoosh