Linux On A Commodore 64

We are used to seeing Linux running on almost everything, but we were a bit taken aback to see [semu-c64] running Linux on a Commodore 64. But between the checked-out user name and the caveat that: “it runs extremely slowly and it needs a RAM Expansion Unit”, one can already start piecing together what’s happening here.

The machine running Linux is really a RISC-V32. It just so happens that the CPU is virtual, with the C64 pretending it is a bigger machine. The boot-up appears to take hours, so this is in no way practical, even though the comment is that optimization might be able to get a 10X speed up. It would still be about as slow as you can imagine.

To further add a layer of abstraction, the code hasn’t run yet on real Commodore hardware. Instead, it is running on an emulator. The emulator has “warp” mode to run faster than a real machine, and it is still slow. So think about that before you rush out to volunteer to boot this on your real hardware.

Tricks like this fall into the talking dog category. If a dog can talk, it isn’t that you think it will have something important to say. You just marvel that it can do it at all. Still, we get it. We spend a lot of time doing things at least as pointless. But at least it is fun!

Maybe emulate the whole thing in VR? Or maybe write some virtualization code for the C64 so you can emulate a Linux box and a quantum computer simultaneously.

31 thoughts on “Linux On A Commodore 64

  1. Why wouldn’t you just run serial terminal to external machine running Linux? Because that is basically the same as in this article: linux is not ran on actual Commodore 64.

      1. Interestingly enough the relationship between DOS and Unix is closer than most people know.
        Around the time Microsoft developed DOS 2.x (Which is arguably the first version of DOS that MS developed themselves) Things like NT or Windows where far into the future, but Microsoft DID have a ‘bigger iron’ OS they sold for larger commercial use, and it was a version of Xenox or a licensed flavor of Unix.
        At that time, Microsoft’s marketing was selling Xenox as the Commerical Multi User OS and DOS would be the ‘Single User’ entry OS.
        So for a short period of Time, DOS acquired a number Unix like features, which DOS 1.x did not have, examples were the ANSI.SYS driver, the use a ‘>’ and ‘<' for file redirection and Directory structures. (DOS 1.x had a flat filesystem)

        But then MS hired from Digital Equipment Corporation a new VP and he was already on record of 'disliking' Unix in favor or DEC's VMS so most of these efforts to bring DOS and Unix together were abandoned.
        Had they not hired him, I suspect that by the time of DOS 3.x or maybe 4.x there would have been at least at the text mode applications some sort of multitasking and some type of Unix like shell in DOS. It WOULD NOT have been as Unix like as Linux, but I suspect with 286 and 386's it would have acted more Unix like than DOS ever did.

        1. Your dream “with 286 and 386 it would have acted more Unix like than DOS” does not need any imagination. It existed for real : it was MICROSOFT OS/2
          Preemptive multitasking, MMU, long filenames (not “8.3”), multithreaded window manager, top-notch DOS emulation, Win3.1 emulation. Even MSExcel and MSWord were ported to OS/2 officially.
          Therefore, Gates had not 2 but 3 operating systems in the market at the same time, and 2 of those were preemptive multitasking from day one. However, when Jobs presented the first NextStep beta at the end of the 1980s, Gates hired Dave Cutler as you said, because he feared not owning a multiuser multitasking OS. Indeed, Xenix legally belonged to AT&T and OS/2 legally belonged to IBM. Therefore he got rid of both OS/2 and Xenix and pushed for NT that officially belonged to MSFT instead.

        1. Not ported; it was developed specifically for the 6809, which many considered to be the ultimate 8-bit microprocessor. Quickly eclipsed by 16-bit processors like the 68000, which OS9 was ported to.

  2. I can see that many are going to miss the point here. It’s an impressive feat because the C64 is not only running Linux, but it’s doing so by emulating a RISC CPU. No, there’s no physical RISC CPU tacked-on to produce an illusion such as we see with the endless stream of [antique machine] runs ChatGPT stories. The RISC CPU is emulated on the 6502 (6510). And, for those aching to get in a comment about alternative *nix operating systems that have long existed, double check your address bar. Sometimes the stories are interesting because of the subject’s utility. As often, they’re fascinating because of the (sometimes arbitrary) obstacles overcome.

  3. Running Unix on a virtual RISC-V running in a 6502 emulation in this simulation that we call the Universe, in an xterm window on a Unix machine… It’s turtles all the way down.

  4. This amuses me greatly but if you think about it, it’s like how modern microcoded CPU’s like a Core i9 or Ryzen are implemented: a simpler processor running software to implement a much more complex CPU. Of course, microcode engines are much, much faster and efficient and don’t emulate the entire system.

    It also reminds me of XKCD 505: https://xkcd.com/505/

    1. I don’t think that’s a faithful representation of what modern CPUs do. They do not actual simulate a more complex CPU, they just pre-process incoming instructions and split them into more manageable parts.

  5. What makes you think a dog doesn’t have something valuable to say.
    In fact, they have and they do, we’re just not smart and patient enough to understand their language.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.