News: 0175151781

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

How I Booted Linux On an Intel 4004 from 1971 (dmitry.gr)

(Saturday September 28, 2024 @11:34PM (EditorDavid) from the 53-years-later dept.)


Long-time Slashdot reader [1]dmitrygr writes:

> Debian Linux booted on a 4-bit intel microprocessor from 1971 — the first microprocessor in the world — the 4004. It is not fast, but it is a real Linux kernel with a Debian [2]rootfs on a real board whose only CPU is a real intel 4004 from the 1970s.

There's [3]a detailed blog post about the experiment . (Its title? "Slowly booting full Linux on the intel 4004 for fun, art, and absolutely no profit.")

In the post [4]dmitrygr describes testing speed optimizations with an emulator where "my initial goal was to get the boot time under a week..."



[1] https://www.slashdot.org/~dmitrygr

[2] https://wiki.debian.org/rootfs

[3] https://dmitry.gr/?r=05.Projects&proj=35.%20Linux4004

[4] https://www.slashdot.org/~dmitrygr



And the funny thing is (Score:4, Funny)

by Rosco P. Coltrane ( 209368 )

It still feels faster than Windows 11 on a 5 year-old machine.

Seriously, why? (Score:2)

by kenh ( 9056 )

How modified was that kernel to boot on a 4 bit processor? It had 2K of ROM, 320 bytes of RAM - how did they squeeze a kernel into a 2K ROM?

Re: (Score:3)

by dmitrygr ( 736758 )

An unmodified kernel booting on an emulated MIPS R3000. The 4004 asm code is comprised of the MIPS R3000 emulator plus all the peripherals that make up the DECStation2100

Re: Seriously, why? (Score:2)

by kenh ( 9056 )

So he booted a MIPS3100 kernel on an emulator running on a 4004 chip surrounded by tech from 50 years after the 4004 entered the market?

The kernel code never touched the 4004, the /. Headline is misleading IMHO...

Re: Seriously, why? (Score:2)

by Compholio ( 770966 )

That laptop looks really familiar, but I can't quite place it. You mind sharing the model?

Re: Seriously, why? (Score:2)

by dmitrygr ( 736758 )

Think pad r40

Re: Seriously, why? (Score:2)

by Compholio ( 770966 )

Thanks, I think that was the first "real" laptop we had in the house - before that it was a "luggable" ;). I'll have to ask my dad if he remembers the model number.

Re: (Score:2)

by ls671 ( 1122017 )

qemu seems to only support the R4000, did you re-use any qemu code?

Re: Seriously, why? (Score:2)

by dmitrygr ( 736758 )

No. I wrote it all from scratch in 4004 assembly.

Re: (Score:2)

by bobby ( 109046 )

Incredible project, thank you for documenting it so well and sharing it. It's inspiring, shows what can be done with determination.

I'm sorry if I missed it in your article, what Linux kernel version did you run?

Re: (Score:2)

by pz ( 113803 )

He wrote a CPU emulator that ran on the 4004, emulating a more modern processor that then was used to boot linux. The article is an interesting read and has lots of details.

I couldn't find the eventual boot time, but he did appear to get it under 5 days.

Re: (Score:2)

by ls671 ( 1122017 )

qemu seems to only support the R4000, any insight if he re-used any qemu code?

Re: (Score:1)

by Auchmithie ( 7848440 )

Why? For fun, and learning.

Re: (Score:2)

by dfghjk ( 711126 )

Translated: "I don't know how it's done and not going to read the article, so instead I'm gonna take a big shit on /.".

Re: (Score:2)

by Tony Isaac ( 1301187 )

Because sometimes, a person gets this question stuck in their head, "I wonder if I could." And that leads to a journey that takes unexpected twists and turns. I personally am impressed, and I think it's cool that this guy even tried it.

Re: Os2 warp on 386 (Score:2)

by kenh ( 9056 )

OS/2 had a very productive life in several verticals - insurance and finance, as I recall. It just wasn't WinNT, and (as I recall) needed apps written specifically for it. When the applications were written in-house for internal applications, it was fairly well-regarded. If you hoped to sell your software to others, it was never gonna be successful.

Re: (Score:2)

by cusco ( 717999 )

It seemed to be quite stable as long as it was only doing one or two things, so it made a good dedicated machine for things like phone systems and ATMs (where I encountered it). Its security sucked and my own experience was that it didn't multitask well. NT 3.51 could run circles around it as a general purpose OS and was miles ahead in security when it was released, David Cutler and his team of DEC refugees did a great job on it.

Re: (Score:1)

by dfghjk ( 711126 )

OS/2 was bad compared to the alternatives at the time, just not compared to ALL the alternatives. IBM didn't "drop the ball on this one", it never had the ball to begin with.

4 bit? (Score:2)

by robi5 ( 1261542 )

How many bits does the microcontroller in the attached keyboard have?

Re: 4 bit? (Score:2)

by kenh ( 9056 )

At least 8, I suspect...

Cost (Score:2)

by phantomfive ( 622387 )

The 4004 chip costs $250. AMD now sells [1]a (different) 4004 for $150 [amd.com].

[1] https://www.amd.com/en/products/processors/server/epyc/4004-series.html

Well done, sir (Score:2)

by 93 Escort Wagon ( 326346 )

That's awesome! It's hilarious watching the hours blow by on the clock in between each individual notification during the boot sequence.

Linux kernel = bloatware (Score:1)

by Anonymous Coward

I couldn't help but think how bloated Linux must be to take days to boot.

Seriously long pauses, lots of patience (Score:2)

by Tony Isaac ( 1301187 )

In the video, parts of the loading sequence appear to do *nothing* at all for hours. I'm pretty sure I would have given up waiting and pulled the plug, thinking that nothing was happening. That's a serious level of patience and commitment.

> > But IANAL, of course.
>
> IANAL either. My son is, but if I asked him I might get an answer I
> wouldn't want to hear.

"Here's my invoice." ? =D