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.
I think that would be Haiku on Sega Saturn, but that would be way easier.
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.
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?
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?
...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.
286 is 16bit I believe? I believe this is the first time anyone has actually run the linux kernel on less than 16bit which is the base the first linux was designed to run on.
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.
So what the article is basically saying is that this runs better than Windows 98ME?
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.
Wasn't that a pretty typical system back when Debian first came out? And just where in the hell did you get a 75MHz 286?
...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?
Back in the days of dial-up and time-outs I had a co-worker running linux on two stripped down 386 machines. They didn't do anything but run ping periodically to keep the connection open. Still... it's nice to know you can still do it if you have such a limited needs as that.
I think you mean 486.
286 is 16bit I believe? I believe this is the first time anyone has actually run the linux kernel on less than 16bit which is the base the first linux was designed to run on.
From the summary, Linux is actually running on an emulated 32-bit ARM, it just so happens that the emulator is running on an 8-bit CPU.
What part of "shall not be infringed" is so hard to understand?
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?
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.
Next goal - make Linux run on an 8085 or an 8051.
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!
That's not hard, if you're living on Titan.
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)
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
Unlike posting on /., which is obviously Serious Business (tm).
Dilbert RSS feed
I have somewhere a Toshiba laptop with a 25Mhz 386, that runs Slackware 4.0 with X and stuffs. It worked surprisingly well and was very usable as a devel machine (not for browsing the web though).
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.
Probably a pentium 75, which was fairly popular and 16 megs sounds about right for the mid/late 90s.
In the early 90s I ran SLS on a 386dx/40 with 4 megs of ram, squeezing in another meg using 4 256K sims cut the kernel compile time by something like a factor of 5. Also it enabled the use of early x windows. Well, early on linux, it was "old stuff" in on the sunos (not yet solaris) boxes at school.
"Science flies us to the moon. Religion flies us into buildings." - Victor Stenger
I wonder how many people are using them in new designs, though? 32-bit ARM Cortex-M microcontrollers seem to be around the same price these days and obviously have a lot more compute power.
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.
The AVR architecture is Harvard rather than von Neumann - it has completely seperate address spaces for code and data, and the address space for code generally doesn't contain any RAM into which you can load programs. So there's really no way to run Linux on one without emulation.
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
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.
I prefer elephant miles, but that works to
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.
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.
Wrong, you can write a program to flash from a program. Any bootloader does that. Arduino, by example, is based on this.
No, no... a spork!
... 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.
sorry, my bad. I got those specs wrong. Though I am too lazy to dig it out from the closet and check. I'm sure it had 16MB RAM. And very likely it had 75 MHz. But indeed it couldn't be 286. So probably 386 or 486.
#
#\ @ ? Colonize Mars
#
486 came in a DX model which ran at 33/66Mhz. The 1st Pentiums came in at 60Mhz. The only 286 i remember was a Unisys 8 or 10Mhz. I'm just sayin.
FTFY
Jesus was all right but his disciples were thick and ordinary. -John Lennon
ELKS is a subset of the Linux kernel that can run on 286 chips.
http://elks.sourceforge.net/
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.
Many 486s ran faster than that, like 33mhz, and performed 32 bit operations (and even 16 bit operations), where the AVR mostly only works on byte operands. Which, as you probably know, require more clocks to scale up to multibyte data.
The comparison is not so cut and dried. It depends on the application, really.
First Pentiums came in at 60 and 66 MHz actually, not 75 MHz.
http://en.wikipedia.org/wiki/List_of_Intel_Pentium_microprocessors#P5_based_Pentiums
I know this because I had a 66 MHz processor with the infamous FDIV floating point bug!
http://en.wikipedia.org/wiki/Pentium_Bug
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
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=-
Probably anyone who cares about things like power usage - for example something that's expected to run for a while on a pair of AA batteries.
Back in the mid-90s I loaded Linux (Yggdrasil or Slackware, IIRC) on a 40MHz 386. I got Xwindows running in 8MB of RAM, which is half what the guy in the article needed. It was pretty useless.
Every couple of years I try Linux again, and it never seems to get any better - bad documentation, crappy programming, 20 different alternative programs for anything one might want to do, none of which works right. It's gotten prettier over the years, but ever more bloated and irritating. If you want to actually get some work done on a desktop or laptop instead of screwing around forever with drivers and configuration and sadistically incompetent interfaces, Linux is not competitive.
"Is life so dear, or peace so sweet, as to be purchased at the price of chains and slavery?" - Patrick Henry
It's probably a Pentium, if anything. Never was a 75Mhz 386, and while there was a 75Mhz 486DX4 those were pretty rare. The Pentium 75 was an extremely common chip back in the day.
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.
My Nokia N900 does run Linux actually.
So are you down to a 2.6hr boot time? Or there-abouts?
moox. for a new generation.
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!
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
How do you figure an AVR at 24 MHz is faster than a 486 when the latter was offered at 20, 25, 33, 40, 50, 66, 75, 90, and 100 MHz, and I don't think the 20's were sold in any major numbers.
As does my N9.
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!
So what you're really saying is Linux IS cross-platform.
-- 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.
Yeah, for servers, it can be good, though I found the Sun/Naviscore stuff nicer for big network management.
(Big, as in: "don't click that - you'll take down Florida".
"But I suppose there's a downside?"
"Hmm, I see what you mean, but yes, for YOU there would be a downside".).
"Is life so dear, or peace so sweet, as to be purchased at the price of chains and slavery?" - Patrick Henry
It doesn't actually run Linux though, it runs a (very slow!) ARM emulator and then boots the ARM version of Linux. I saw a much more impressive demo a few months ago - a guy in Cambridge had ported 2BSD to run on a 32-bit PIC with 128KB of RAM. It was responsive and ran things like man very fast. It had enough memory to run the C preprocessor and the assembler, but he hadn't quite managed to fit the compiler on, so it wasn't quite self hosting (although a version with 256KB of RAM would have been).
I am TheRaven on Soylent News
Clock speed is not an accurate measure when comparing different architectures, or even different generations. I don't know about AVR, but a modern ARM core at 24MHz will easily outperform a 66MHz 486 and probably a 100MHz one. Especially if you're doing anything that can take advantage of NEON - the vector unit in the ARM chip will trample all over the 487 in terms of floating point performance.
I am TheRaven on Soylent News
I have run linux from scratch on a vortex 386sx, and let me tell you that is painful. The lack of the math co-processor rules out debian or pretty much anything else you didn't hand roll. Never again.
Back in the mid-90s I loaded Linux (Yggdrasil or Slackware, IIRC) on a 40MHz 386. I got Xwindows running in 8MB of RAM, which is half what the guy in the article needed. It was pretty useless.
In 1996, I installed Slackware on a similar machine. Far from useless, it was liberating. Finally, I had a UNIX-like operating system on my home machine.
To each his own, I guess, but I made the switch from DOS/Win 3.1 to Linux and never looked back. (I had some experience with a then-girlfriend's Windows 95, but it didn't tempt me in the least.)
Phiwum's law: anyone that names an obvious law after himself and then puts it in his own sig is just pathetic.
... 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.
No, a fork(2).
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
Hmm, in 1993 I had Linux running on a 386SX25 with 6Mb of memory and a 128MB Hard drive. Works fine still... Just booted it :-) in 20s and to X11 in 35. Runs X11 just fine - with twm. Crawled running 3.11fWg.
Regards
W.
The first thing that came to my mind before I read the headline fully.
I have one that was labelled as a 486VX.
I'm not really sure how a "VX" compared to an SX (no math-co) or DX (math-co), but it was clocked @ 100Mhz.
It ran "Doom" quite nicely. It even ran Quake... sorta (if I turned the screen size down to a very small window and set the detail level to crap)
Fastest 286 I saw was about 33Mhz... with a turbo button. Sometimes I miss the turbo button
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.
An AVR is not to be seriously compared to an ARM.
I have no idea how you keep old hardware running. My experience is that when I put a box or laptop aside for several months and then start it again, something goes wrong.
Phiwum's law: anyone that names an obvious law after himself and then puts it in his own sig is just pathetic.