🚀 Linux 🐧 on a Commodore 64 💾 : The Impossible Becomes Real ✨

Опубликовано: 05 Август 2026
на канале: projectCD.Chronicles
421
25

Project Milestones

1. Goal: Run Linux on a Commodore 64
The project demonstrates that the question "Can the C64 run Linux?" can finally be answered: yes, albeit with extreme speed and memory limitations.

2. Use of a RISC-V emulator written for the 6510
The C64 does not run Linux natively.
The author has ported semu, a small RISC-V32 emulator, to the C64's 6510 processor.
Linux therefore runs as a RISC-V guest, not as 6502 code.

3. Need for a REU RAM Expansion Unit
The C64's 64 KiB are insufficient.
A 16 MiB REU is needed to contain the kernel, initramfs, and VM state.
The REU is mapped as the emulated system's main memory.

4 Virtual Memory and MMU
The emulator implements an MMU and even a form of virtual memory, which is incredible on a C64.
This allows the Linux kernel to function as if it had modern memory.

5 First Real Boot on C64 Hardware
On August 31, 2023, thanks to external testing, a real Commodore 64 successfully booted Linux for the first time.
This is a historic achievement, albeit with some crashes due to the fragile hardware and enormous execution times.

6 Boot Times and Optimizations
A complete boot requires hundreds of millions of RISC-V instructions, which on the 6510 equates to days of runtime.
Subsequent optimizations (cramfs, XIP, -O3, LLVM-MOS improvements, and zero-page usage) have reduced the estimated time to about 1.5 days.
The author believes an improvement of up to 10x is possible with further optimizations.

7 Fast Boot State Persistence
A persistence feature has been added:
the state of the RISC-V CPU and peripherals is saved in REU;
you can reload Linux "almost booted," skipping days of boot time.
The `buildroot login:` prompt appears immediately upon boot.

8 System Build
Compile with mos-c64-clang.
A Makefile allows you to choose between x86_64 and 6502 builds.
A `mk_linux_reu.py` script assembles the kernel, initrd, and state into a REU file to be loaded into VICE or onto real hardware.

9 Execution
In VICE:
enable the 16 MiB REU,
load `SEMU`,
boot and wait or use warp mode.
Boot is deterministic until the first keyboard input.

10 Future Perspectives
Possible 6502 core optimizations.
Improved MMU cache.
Simplified JIT.
Pre-calculated checkpoints on PC for instant boot.
Even a glimpse of X11 in 320x200 on the VIC-II.

Link: https://github.com/onnokort/semu-c64

#Commodore64 #LinuxOnC64 #RetroComputing #RISCVE emulator #C64Project #VintageHardware #TechExperiment #Homebrew