Hacking wizard gets Linux to run on a 1971 processor, though it takes almost 5 days to boot the kernel

Linux/4004 - YouTube Linux/4004 - YouTube
Watch On

Here's a question for you: How do you get an operating system that first appeared 33 years ago to run on a processor that's almost two decades older, from 1971? Well, it turns out the answer is to make the ancient chip emulate something that's only 36 years old, strip the software down to its bare essentials, and then just wait almost five days for the kernel to boot.

While the project itself serves no obvious practical purpose, the work of Dmitry Grinberg (via Ars Technica) deserves genuine admiration. If you're a regular reader of our hardware news, then the name might be familiar—it's the same hacking wizard that created the firmware for a Def Con attendee badge that ultimately got used to run a Doom port.

But that project pales in comparison to Grinberg's latest one. In short, he managed to get the kernel of Debian Linux to boot on a 4-bit Intel 4004 processor, the first ever commercially manufactured microprocessor. Even by the standards of the 1970s, the 4004 is as basic as it gets.

With just 2,600 transistors to work with, the number of operations it can handle is extremely limited (mostly just add and subtract, and no logic ops whatsoever) and while it has a surprising number of registers (16 in total), it doesn't support hardware interrupts making any kind of multitasking somewhat of a challenge!

In fact, it's far too basic a chip to run Linux and this is where Grinberg got really creative. With a RAM target of just 4 kB, he coded up a program to emulate a MIPS R3000 processor on the 4004. That particular chip is from the same era as the original version of Linux so it was a natural choice for the emulation task, though it was far from easy to achieve.

But with some additional hardware emulation and a raft of period-correct components, Grinberg put together a custom circuit board with a basic display to prove that Linux was indeed firing up to a command prompt. The only real issue with it all is a matter of speed.

Even with a 5% overclock, the 790 kHz clock speed of the 4004 (yes that's kilohertz, not mega or giga) is desperately slow. Initial projections of how long it would take to boot the kernel (the fundamental core of the operating system) produced a figure of just under nine days! Cue much tweaking and neat little tricks, and Grinberg got it all the way down to 4.76 days.

If you watch the above video, you can see the laptop's clock whizzing along—the video recording of Linux loading up and running is sped up considerably, as even if YouTube allowed videos to have a runtime of several days, I don't think anyone could manage to watch it all the way through in real time!

The whole project is one heck of an achievement. Sure, it has absolutely no practical use but who cares? It's a tribute to the sheer ingenuity and determination of a talented and hardworking engineer. I suspect the only problem Grinberg has now is how on Earth does one top this. Oh, I know—it has to be Doom, of course. I wonder if he can get it to run at 30 fpm (frames per month)?

Best gaming PCBest gaming laptop


Best gaming PC: The top pre-built machines.
Best gaming laptop: Great devices for mobile gaming.

Nick Evanson
Hardware Writer

Nick, gaming, and computers all first met in 1981, with the love affair starting on a Sinclair ZX81 in kit form and a book on ZX Basic. He ended up becoming a physics and IT teacher, but by the late 1990s decided it was time to cut his teeth writing for a long defunct UK tech site. He went on to do the same at Madonion, helping to write the help files for 3DMark and PCMark. After a short stint working at Beyond3D.com, Nick joined Futuremark (MadOnion rebranded) full-time, as editor-in-chief for its gaming and hardware section, YouGamers. After the site shutdown, he became an engineering and computing lecturer for many years, but missed the writing bug. Cue four years at TechSpot.com and over 100 long articles on anything and everything. He freely admits to being far too obsessed with GPUs and open world grindy RPGs, but who isn't these days? 

TOPICS