Live data from Hacker News

Linux on a Commodore 64

github.com

21–30 of 97 posts

Re: Linux on a Commodore 64

#23
post #8
post #4

So, I like Linux and I love my C64, but.. Linux are for computers too primitive to come with their own kernel and.... the C64 comes with a kernel and shell right from the factory :P

The Commodore 64 doesn't come with a mere kernel, it comes with a mighty KERNAL https://en.wikipedia.org/wiki/KERNAL > The KERNAL was known as kernel[6] inside of Commodore since the PET days, but in 1980 Robert Russell misspelled the word as kernal in his notebooks. When Commodore technical writers Neil Harris and Andy Finkel collected Russell's notes and used them as the basis for the VIC-20 programmer's manual, th…

The mighty KERNAL is how us mere mortals can JSR FFD2. (I think that's right)

Re: Linux on a Commodore 64

#26

This begs the question. What is the oldest hardware that can boot modern Linux but still be used as a daily driver?

The main "daily driver" constraint is probably the crypto required to access most modern websites. You can make the leanest and meanest system you can to run great on the slowest machine but the internet is nowadays an unforgiving place.

Re: Linux on a Commodore 64

#27
post #11

Earlier quoted context omitted.

The 6502 is a notoriously poor target for C compilation, especially C that hasn't been written with the 6502's limitations in mind. I'll bet if you wrote a RISC-V emulator in native 6502 you could get Linux booting on a real machine in a day instead of a week. Think about how many lives that'd save! https://www.folklore.org/StoryView.py?story=Saving_Lives.txt

Says you. llvm-mos generates surprisingly efficient 6502 code given its age and maturity. Don't take my word for it, try some experiments with it on godbolt.

Sure. Here's a couple of functions to iterate over an array of "Ball" objects, as you might do in a Breakout-style game that has a multi-ball powerup. I didn't do anything to make it particularly 6502-amenable; it's how I'd write it for a modern machine, probably. Even compiled with -O2: as expected, the code is slow and enormous - a single addition compiles to something like 30 instructions.

[0] https://godbolt.org/z/f6Ysv7nve

Re: Linux on a Commodore 64

#28

This begs the question. What is the oldest hardware that can boot modern Linux but still be used as a daily driver?

The bar for "daily driver" is different for different people's requirements. Would streaming Netflix be included? Running simple games?

Re: Linux on a Commodore 64

#29
post #11

Earlier quoted context omitted.

The 6502 is a notoriously poor target for C compilation, especially C that hasn't been written with the 6502's limitations in mind. I'll bet if you wrote a RISC-V emulator in native 6502 you could get Linux booting on a real machine in a day instead of a week. Think about how many lives that'd save! https://www.folklore.org/StoryView.py?story=Saving_Lives.txt

Says you. llvm-mos generates surprisingly efficient 6502 code given its age and maturity. Don't take my word for it, try some experiments with it on godbolt.

I've yet to see the 6502 C compiler that can beat good assembly code. I appreciate the convenience and llvm-mos has certainly improved greatly, but if you want speed on a 6502, there's no substitute.

Re: Linux on a Commodore 64

#30
Not Linux related, but I've been trying trying recent (at least to me..) C-64 accessories:

I've tried the "Kung Fu Flash"- it's a software defined cartridge that is cheap- just a single STM32 and can do pretty much everything. I bought this because I'm trying to duplicate the developer experience I see on "8-bit show and tell"- it can emulate the "super snapshot", but not the REU. It's a really nice way to quickly try a lot of C-64 software and games.

https://8bithardware.wixsite.com/website/post/kung-fu-flash

https://github.com/KimJorgensen/KungFuFlash

I also have an SD2IEC: what I've learned is that it would have been useful to get a variant with an extra DIN socket. It's nice but I was never a fan of C-64's DOS and this reinforces it. To mount a D64 disk image you have to: OPEN1,8,15,"CD:MYIMAGE.D64":CLOSE1... yuck..

JiffyDOS (replacement ROM for the C-64) improves this (it's faster and includes a permanent DOS wedge), I bought one- it's on the way. I'm curious to try it with the real 1541 drive.

What got me started on this recently is the "Penultimate +2" cartridge for the VIC-20:

https://www.youtube.com/watch?v=eNGyneXHKJQ

In this case, I basically bought a VIC-20 just to try out the cartridge.

Post reply on HN