Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×
Intel Linux

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

Long-time Slashdot reader 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 rootfs on a real board whose only CPU is a real intel 4004 from the 1970s.
There's 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 dmitrygr describes testing speed optimizations with an emulator where "my initial goal was to get the boot time under a week..."

How I Booted Linux On an Intel 4004 from 1971

Comments Filter:
  • by Rosco P. Coltrane ( 209368 ) on Saturday September 28, 2024 @07:42PM (#64824837)

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

    • by Anonymous Coward

      I don't think Windows 11 will even run at all on a 5 year old machine.

      • by ncc74656 ( 45571 ) *

        I don't think Windows 11 will even run at all on a 5 year old machine.

        You can coax it into running on older hardware. It might not even run halfway badly (by Windows standards, at least) on older hardware that was at least somewhat cutting-edge when new.

        Recently, I've set up some Win11 VMs for testing purposes. They're running on Proxmox on a server that's probably somewhere around 12-13 years old...a pair of Opteron 6272s, IIRC. I didn't do anything special to the image to get it to run. QEMU emulates

  • 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:Seriously, why? (Score:5, Informative)

      by dmitrygr ( 736758 ) <dmitrygr@gmail.com> on Saturday September 28, 2024 @07:55PM (#64824865) Homepage
      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
    • 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.

      • by ls671 ( 1122017 )

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

        • by tlhIngan ( 30335 )

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

          Nope, because the 4004 only has one instruction. And it's coded in that one instruction.

          The 4004 only has a 12K mask ROM and something like 256 byte RAM modules.

          The emulated machine RAM would have to be an external memory chip as well as storage, so you're probably looking at dozens of cycles just to access a byte of emulated memory. And for a chip running at 768kHz, that's probably a huge part of the lack of speed - accessing mem

    • Why? For fun, and learning.
    • 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:Seriously, why? (Score:5, Insightful)

      by Tony Isaac ( 1301187 ) on Saturday September 28, 2024 @11:15PM (#64825163) Homepage

      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.

      • by Anonymous Coward

        Sure but emulating a foreign CPU architecture on a 4 bit machine seems hella crazy slow.

        What you want is to ask ChatGPT to design a 32 bit extension to the 4004, emit Verilog, prototype it on a FPGA running many times faster than the original hardware from 1971. LLVM then can bootstrap a c compiler and from there you get Qemu environment in 32bit 4004 FPGA capable of booting the original 4004. Then a reverse JIT can output multi-stage pipelined native 4-bit 4004 instructions to bootstrap the 32 bit Linux en

  • I got my hands on an install set of floppy disks for os2 warp way back when and figured I'd give it a go.

    I spent a good part of the weekend swapping disks but eventually I did get through and it booted up. Took about 45 minutes from off to the Home Screen (or whatever they called it).

    Os2 wasn't bad especially compared to the alternatives at the time but I was poor and couldn't afford more than the minimum hardware it required. Too bad IBM dropped the ball so hard on this one. It was way better than windo

    • 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.

      • 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.

    • 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.

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

  • by phantomfive ( 622387 ) on Saturday September 28, 2024 @09:07PM (#64824965) Journal
    The 4004 chip costs $250. AMD now sells a (different) 4004 for $150 [amd.com].
  • Well done, sir (Score:5, Interesting)

    by 93 Escort Wagon ( 326346 ) on Saturday September 28, 2024 @09:26PM (#64825007)

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

    • I am more impressed in the fact that the guy typed ls into the console and finally got the directory listing up 20 hours later.

  • by Anonymous Coward

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

  • 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.

  • by thegarbz ( 1787294 ) on Sunday September 29, 2024 @04:32AM (#64825529)

    It took three hours between typing "uptime" and the uptime being displayed. I'm very curious at what point the uptime was actually calculated.

  • An acquaintance of mine once told me he was working on a similar(?) project. Emulating DEC PDP-8 with SIMH emulator on a modern computer, then emulating some Linux-supporting machine on the virtual PDP-8, then running Linux on that.

    I guess the performance of that Linux would be comparable to what we're talking about in this thread, with the added benefit of not requiring any special hardware. OTOH, if you DO have a real i4004, what better way to make use of it? :)

  • Imagine⦠(Score:3, Funny)

    by gatzke ( 2977 ) on Sunday September 29, 2024 @07:45AM (#64825801) Homepage Journal

    Imagine a Beowulf cluster of these things.

    Does it run Doom?

  • I like the subtle reference to the US postal service :-)

  • Obviously a very smart person that couldn't find a better use of his free time.

    You can* run linux on that 1bit paper and pen machine too, if you had the patience of tectonic plates. What I want to convey is that sooner or later we will have to give up on trying to run this or that (linux and DOOM) on hardware that should run appliances or have been obsolete for decades.

    I wish one superrich supervillain would kidnap all these stupid smart people, put them on an secluded island and tell them they will get rel

    • You want to control others, even by kidnapping and imprisoning them. You imagine yourself as a judge of others worth and works.

      People like you are the problem and the threat to humanity.

      • Yes. (to the second line).

        And maybe you wish to tell others what they want.
        Couldn't you tell that my comment was satire when I used an obvious trigger word like "supervillain"?

        • they say jokes are half meant.

          It turns out people who seem to spend their time on complex pointless things have advanced humanity.

          Imagine a patent clerk frittering away his free time for 3 years, after looking at devices and procedures for syncing remote locks, about the nature of time.

  • HP-65? A programmable calculator?

  • But can it run Lin... Oh, wait.

If it's worth doing, it's worth doing for money.

Working...