I recently did a port of CP/M to the 6502, and have just made it work on the X16, more or less. See https://github.com/davidgiven/cpm65.
There's currently no actual 6502 CP/M software, so it's of questionable utility, but it does work and it will run the same executables as on the BBC Micro and Commodore 64 ports (I want to add more). I haven't tested this on real hardware for obvious reasons but it runs on x16emu; although, it uses M mode file access and P to seek within them (the CP/M filesystem is stored in a big file), so I also had to patch in support for this in the host filesystem. There's a pull request outstanding at https://github.com/commanderx16/x16-emulator/pull/435. I think this is the easiest way to do it; raw sector access of an SD card partition would be cool but I don't think it'd be worth it. One annoyance is that you can't use 1541 drives from the C64 port on the X16 port. I suppose it'd be possible to detect the drive type and use different code paths, but at 300 bytes per second using a 1541 drive is an exercise for masochists anyway...
The OS is written in portable hand-tooled machine code, but it uses the llvm-mos toolchain so you get C support out of the box. (The STAT command shown in the screenshot is written in C.)
Does anyone know of any actually-open-source (i.e., with a license) command-line C64 software that it might be interesting to port? For example, assemblers and the like? I'm suspecting there's not much as the nature of the C64 is that it tends to encourage combined editor-assemblers, which aren't suitable for CP/M...
Oh, yeah. Is there any way to make the cursor blink?
![x16.png](https://github.com/davidgiven/cpm65/blob/master/doc/x16.png?raw=true)