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.
Why?
You mean, you bought the latest nokia?
Reminder: this is /. , all people will want to know is: but does it run linux. Since your nokia apparently is unable to do so, this article proves the 8-bit processor superior.
Have a nice day.
They'll submit "FIRST POST"
Have gnu, will travel.
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?
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.
What 286 ran at 75Mhz? Only 486 cpus ran at those speeds. And AFAIK Debian never had a kernel for non 386 80x86 CPUs.
That's simply not true. Those little 8-bit microcontrollers are used all over the place. You probably have several in your desktop, some in your monitor, more in your TV, a whole bunch in your car. You just never see anyone trying to run one as the primary CPU on an interactive computer these days.
Question for Linux hackers: is there a reason why the Linux kernel would not be portable to an Atmel AVR microcontroller?
Linux requires MMU and AVRs don't have it. Memory limitations will kick in as well (the most powerful AVR has 256 kB of flash ans 32 kB of RAM, so external storage will be required)
...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.
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.
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.
If your hobby is 'waiting for stuff to happen', then this is a great project to undertake.
A witty saying proves you are wittier than the next guy.
To this project or to this discovery? To the project, probably no. Well, other than being excellent practice in problem-solving. To the discovery, probably yes. There have long been arguments over the minimum complexity requirements for a general-purpose OS, which is an important problem to solve as complexity is a governor of many things (cost, durability, power requirements, heat generation, etc). We already know from Turing that any CPU can run any software for any other CPU, provided the memory is available and the CPUs are Turing Machine equivalents. What we've been less clear on is what this means in practice, how to exploit it, and whether architectural limitations violate the Turing Machine equivalency requirement. We now have numbers to work with, a case study, and a proof by example that equivalency is satisfied.
It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
I design musical synthesizers using Atmega MCUs. They work really well as controllers in price-sensitive consumer applications, but booting linux on one is about as sensible as fixing your car with a spoon.
I don't use a SIMM for the JVM project - but I am going to release a fully working(threads, synchronization, exceptions, interfaces, all the datatypes, etc) JVM for AVRs soon
-------
1. Enjoy your job
2. Make lots of money
3. Work within the law
Choose any two.
You mean we're supposed to use a fork??
You can mod your friends, you can mod your nose, but you can't mod your friend's nose.
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.
An awful lot of stuff doesn't need that kind of compute power.
And AVR chips actually pack a massive amount of power. 24mhz is faster than a 486 and when you are reading sensors and similar things thats tons.
Its only 6.5khz if you try emulating a ARM chip on it.
... 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
You're forgetting about 486 DX4 75mhz. Clock trippled baby.
486 came in a DX model which ran at 33/66Mhz. The 1st Pentiums came in at 75Mhz. The only 286 i remember was a Unisys 8 or 10Mhz. I'm just sayin.
The 486DX4s ran at 75Mhz (with a 25Mhz bus, since despite the name, they only had a 3x multiplier. The DX4-100 had a 33Mhz FSB.). The first Pentiums were 60 or 66Mhz, with no multiplier (i.e. the CPU and FSB were clocked the same). The 75Mhz Pentiums came a year later and ran on a 50Mhz FSB (at 1.5x), and were cheaper (or at least the same price) compared to the 66Mhz model (since you had a faster CPU, but slower bus), if I recall correctly.
Also of note, AVR and PIC chips are available in a lot of prototype and home lab friendly packages. Many (most?) of the ARM chips are in xQFP, and you can use those at home, but it's quite imposing.
I actually have fixed a car with a fork once.
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 needed a sig so people would know who I am, but I was too drunk to make something witty, so you get this instead.
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=-
I feel ya there. I started using Linux for the first time on my brand new 386dx/40 with 5MB ram. (Slackware, 1994 I think)
I remember X/Window (without the s...) being such a memory hog and requiring 8MB of memory which I didn't have. I learned Linux the right way then, because of that memory problem. Remember, Linux had a target of being a server platform back then. X/Window was never meant to be a point-and-click interface, it was meant to be a GUI interface for graphical context. (or just multiple terminals open at once)
Nowadays, nearly everything is just 'pop the disk in, let it run, pop it out, reboot, do what you need to do'.
Linux is competitive in what it's for, being a server platform with an optional GUI attached. What I do is just pop 'wmaker' into the .xinitrc after I install WindowMaker and I'm done. Oh, and changing the /etc/inittab to make the default runlevel "3" so X/Window doesn't pop up.
-- This space for lease, low setup fee, inquire within!