Developer Onno Kortmann has introduced Linux to a tool few would have imagined able to working it: the eight-bit Commodore 64, launched almost a decade earlier than Linus Torvalds’ groundbreaking kernel.
“‘However does it run Linux?’ can now be lastly and affirmatively answered for the Commodore C64,” Kortmann writes of his work. “There’s a catch (slightly: a pair) in fact: it runs extraordinarily slowly and it wants a RAM Growth Unit (REU), as there isn’t any likelihood to suit all of it into simply 64KiB.”
Watch in surprise as an emulated Commodore 64 boots Linux, by itself emulating a 32-bit RISC-V chip. (📹: Otto Kortmann)
The Commodore 64 launched in 1982 as an reasonably priced but fairly highly effective house laptop for the plenty. Boasting coloration graphics, an eight-bit MOS 6502 processor, and the long-lasting Sound Interface Gadget (SID) chip, the Commodore 64’s ROM got here pre-loaded with Commodore BASIC — a custom-made model of Microsoft BASIC. What it undoubtedly did not include was a duplicate of the Linux kernel: Linus Torvalds would not write that for an additional 9 years.
Regardless of that hole, and the actual fact Linux was initially written for x86 techniques, the worlds of the Commodore 64 and Linux have collided in Kortmann’s mission. The trick: semu
, a compact emulator which implements a 32-bit model of the free and open-source RISC-V structure. It has been used prior to now to deliver Linux to a variety of resource-constrained platforms, together with microcontrollers — however the Commodore 64 is one thing else solely.
Utilizing his Commodore 64 port of semu
, together with a 16MB reminiscence growth on high of the Commodore 64’s unique 64kB of inner reminiscence, Kortmann was capable of get the eight-bit MOS 6502 processor to emulate each a 32-bit RISC-V chip and a reminiscence administration unit — albeit extraordinarily slowly.
The efficiency is understandably weak, with an actual unaccelerated Commodore 64 anticipated to take round every week besides. (📷: Otto Kortmann)
“The screenshots took VICE [a Commodore 64 emulator] a pair hours in ‘warp mode’ (activate it with Alt-W) to generate,” Kortmann admits. “So, as is, an actual C64 ought to be capable to boot Linux inside every week or so. The compiled 6502 code just isn’t actually optimized but, and it could be reasonable to squeeze an element 10x of efficiency out of this.”
Kortmann’s semu
fork, with directions for working it in an emulator, is on the market on GitHub beneath the permissive MIT license. “I’ve not examined it on actual {hardware} but, that is the subsequent problem… for you,” Kormann writes. “So please ship me a hyperlink to a timelapse video of an unique [Commodore 64] unit with REU booting Linux.”