You can run Linux on a Commodore 64 if you really want to

The Commodore 64
(Image credit: Wikimedia commons)

Programming hobbyists love a challenge. Getting Linux to run on, well, anything is a challenge many find irresistible. The latest example involves getting it to run on the legendary Commodore 64. Getting it to run on a Mac is one thing, but doing the same on a 40 year old computer with 64KB of memory is quite another.

Developer Onno Kortmann (via Slashdot) used Semu, a light RISCV32 emulator, and cross-compiled it with llvm-mos, allowing the code to run on the C64's MOS Technologies 6502 processor. It needs to be pointed out that this was done via an emulator and not on real hardware, though it's only a matter of time before that happens.

Using the VICE Commodore emulator, Kortmann enabled "warp mode" which showed the first boot messages within a few minutes, though that will take much longer on a real machine. The screenshot below took a few hours with Warp mode, which means a real C64 will take a week or more to fully boot Linux.

The original Commodore 64 came with just 64KB of memory and running a lightweight OS is simply not possible without the use of a RAM Expansion Unit. Kortmann doesn't specify which REU he used, but C64 REUs were available with up to 512KB, or a whopping 0.5MB of memory. The C64's MOS Technology processor running at around 1MHz isn't what you'd call a speed demon either.

Kortmann believes there's a lot of room for improvement, saying a 10x speedup could be possible. Still, given the limitations of the C64 hardware, even with a 10x speedup, don't expect to go running much in the way of software once you do finish the boot sequence. This is the kind of thing that serves little purpose beyond proving it can be done. That doesn't make it any less cool, though.

Screenshot of Linux running on a Commodore 64

(Image credit: Onno Kortmann)

Should you wish to, the code and instructions can be found on Kortmann's Github page. I'm not sure any but the most masochistic or bored programmers would take up the challenge, but to those that do: Respect! 

Is Linux on a C64 practical? Not in the slightest. But it sure is an impressive feat and one that fans of one of the greatest computers of all time will appreciate.

Image


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

Chris Szewczyk
Hardware Writer

Chris' gaming experiences go back to the mid-nineties when he conned his parents into buying an 'educational PC' that was conveniently overpowered to play Doom and Tie Fighter. He developed a love of extreme overclocking that destroyed his savings despite the cheaper hardware on offer via his job at a PC store. To afford more LN2 he began moonlighting as a reviewer for VR-Zone before jumping the fence to work for MSI Australia. Since then, he's gone back to journalism, enthusiastically reviewing the latest and greatest components for PC & Tech Authority, PC Powerplay and currently Australian Personal Computer magazine and PC Gamer. Chris still puts far too many hours into Borderlands 3, always striving to become a more efficient killer.