CP/M on the X16

If you have feature requests, this is the place to post them. Please note your idea may already be something we have already discussed and decided against, or something we are working on privately, and we cannot be held responsible for any similarities in such instance. Whilst we cannot respond to every suggestion, your idea will be read and responded to where possible. Thank you for your input!
ZeroCool32
Posts: 7
Joined: Fri Sep 27, 2024 6:38 pm

CP/M on the X16

Post by ZeroCool32 »

I'm not sure if this feature is even necessary, but can (in theory, with a expansion card) the Commander X16 run CP/M, in order to run some business software for CP/M, or even write new software for CP/M? This question seems stupid, but I'm just asking.
User avatar
ahenry3068
Posts: 1136
Joined: Tue Apr 04, 2023 9:57 pm

Re: CP/M on the X16

Post by ahenry3068 »

ZeroCool32 wrote: Fri Sep 27, 2024 6:58 pm I'm not sure if this feature is even necessary, but can (in theory, with a expansion card) the Commander X16 run CP/M, in order to run some business software for CP/M, or even write new software for CP/M? This question seems stupid, but I'm just asking.
It probably could if some creates the expansion card. I don't know of anyone working on such a thing though.
Edmond D
Posts: 489
Joined: Thu Aug 19, 2021 1:42 am

Re: CP/M on the X16

Post by Edmond D »

I post-date the CPM era, never having to use or understand it. Given it was ported to many different hardware platforms, I don't see a requirement for an expansion card. From my limited knowledge, it should be portable to the X16 hardware, but might encounter/require some adaptations because the basic OS for the X16 is baked in. Others may have more insight on the hardware & OS side and hopefully chime in.

I started to poke around the net and this seems to be a good starting point - http://www.cpm.z80.de

This topic doesn't seem stupid to me, the X16 is a retro system and CP/M to me seems to be even more retro (ancient?) than the Commodore Basic OS.
Ser Olmy
Posts: 39
Joined: Thu Aug 18, 2022 8:20 pm

Re: CP/M on the X16

Post by Ser Olmy »

Edmond D wrote: Fri Sep 27, 2024 9:23 pmI started to poke around the net and this seems to be a good starting point - http://www.cpm.z80.de
As the URL indicates, CP/M was written for the Z80 (originally the 8080) CPU. It was since ported to the 8086, but as with other operating systems that can run under different CPU architectures (Linux, Windows), all software needs to be compiled to support every architecture.

On modern computers you can get away with running non-native software using emulation, but that's not really feasible on 8-bit or even 16-bit systems. In order to run native CP/M 2.2 or 3.0 on the Commander X16, a Z80 CPU would be required. Hence the need for an expansion card.
Edmond D wrote: Fri Sep 27, 2024 9:23 pmThis topic doesn't seem stupid to me, the X16 is a retro system and CP/M to me seems to be even more retro (ancient?) than the Commodore Basic OS.
And someone seems to agree with you, as a 6502 port of CP/M already exists: CP/M-65

The Commander X16 is even officially supported, but as mentioned you'd still have to obtain the source code for any CP/M programs you'd like to run in order to recompile them.
TomXP411
Posts: 1781
Joined: Tue May 19, 2020 8:49 pm

Re: CP/M on the X16

Post by TomXP411 »

ZeroCool32 wrote: Fri Sep 27, 2024 6:58 pm I'm not sure if this feature is even necessary, but can (in theory, with a expansion card) the Commander X16 run CP/M, in order to run some business software for CP/M, or even write new software for CP/M? This question seems stupid, but I'm just asking.
We've been talking about that there, on and off.

Since the Z80 is no longer in production, the way to do so would be a Z80 based microcontroller, which runs Z80 instructions and provides multiple I/O interfaces and GPIO connections.

Essentially, the X16 would end up being a terminal for the Z80, and you would not have much benefit doing it this way over simply using the X16 as a serial terminal, via the serial/network card.

You can also emulate an 8080 or Z80 environment, or a complete CP/M computer, on an Arduino Due, Grand Central, ESP32, or several of the Teensy series of microcontrollers.
  • RunCPM runs on just about anything with enough CPU horsepower and an SD card.
  • Z80Pack runs on the ESP32 as part of the IMSAI 8080 Replica project. It could likely be modified to run standalone, but you'd want to reach out to Udo Monk about that.
  • The Altair-Duino is a complete, stand-alone Altair emulator, with 8080 and Z80 emulation. It would take some minor modifications to run the AD firmware without a front panel, but the changes are actually very minor - mostly, it involves having 3 momentary switches accessible to the user.
Ser Olmy
Posts: 39
Joined: Thu Aug 18, 2022 8:20 pm

Re: CP/M on the X16

Post by Ser Olmy »

TomXP411 wrote: Fri Sep 27, 2024 11:53 pmSince the Z80 is no longer in production, the way to do so would be a Z80 based microcontroller, which runs Z80 instructions and provides multiple I/O interfaces and GPIO connections.
The Z80 is still being made. Only the 40-pin DIP version was discontinued.
ZeroCool32
Posts: 7
Joined: Fri Sep 27, 2024 6:38 pm

Re: CP/M on the X16

Post by ZeroCool32 »

Ser Olmy wrote: Fri Sep 27, 2024 11:45 pm
Edmond D wrote: Fri Sep 27, 2024 9:23 pmI started to poke around the net and this seems to be a good starting point - http://www.cpm.z80.de
As the URL indicates, CP/M was written for the Z80 (originally the 8080) CPU. It was since ported to the 8086, but as with other operating systems that can run under different CPU architectures (Linux, Windows), all software needs to be compiled to support every architecture.

On modern computers you can get away with running non-native software using emulation, but that's not really feasible on 8-bit or even 16-bit systems. In order to run native CP/M 2.2 or 3.0 on the Commander X16, a Z80 CPU would be required. Hence the need for an expansion card.
Edmond D wrote: Fri Sep 27, 2024 9:23 pmThis topic doesn't seem stupid to me, the X16 is a retro system and CP/M to me seems to be even more retro (ancient?) than the Commodore Basic OS.
And someone seems to agree with you, as a 6502 port of CP/M already exists: CP/M-65

The Commander X16 is even officially supported, but as mentioned you'd still have to obtain the source code for any CP/M programs you'd like to run in order to recompile them.
The reason that I wanted to use a expansion card is to run CP/M software, without the need to port them or reverse engineer them (the vast majority of the software targeted for it). Without a Z80, even if there is a port of CP/M for the Commander X16, porting is a crucial task, if you don't want your project to be taken as a proof of concept.
Edmond D
Posts: 489
Joined: Thu Aug 19, 2021 1:42 am

Re: CP/M on the X16

Post by Edmond D »

Well, wiser and more informed community members have spoken with more depth than I can provide. However, as a Canadian I'll put in my two (more) cents, since the penny has been eliminated here....
ZeroCool32 wrote: Sat Sep 28, 2024 4:34 pm The reason that I wanted to use a expansion card is to run CP/M software, without the need to port them or reverse engineer them (the vast majority of the software targeted for it). Without a Z80, even if there is a port of CP/M for the Commander X16, porting is a crucial task, if you don't want your project to be taken as a proof of concept.
Avoiding having to find source code and being able to run existing binaries makes sense, and probably be less of an uphill battle.

While the Zilog Site https://zilog.com/index.php?option=com_ ... &Itemid=59 states that all Z80 devices are End of Life now and no longer supported, the Z180 processors look like they may be a solution. Now someone designing and developing a Z180 card would be a task/challenge. There are many hardware and software projects here done by various talented people, perhaps one of them pines for a X16 CP/M capable machine.

As a side note, I actually own a couple new-old stock Z8 and Z80 support chips. I really should move them on, as someday I'll be dead and the chips most likely will go to a dumpster :-(
ZeroCool32
Posts: 7
Joined: Fri Sep 27, 2024 6:38 pm

Re: CP/M on the X16

Post by ZeroCool32 »

Here is a screenshot of a very primitive CP/M bootloader that I wrote:
BOOT65 early development (2024-09-29)
BOOT65 early development (2024-09-29)
2024-09-29_10-02.png (9.7 KiB) Viewed 595 times
Right now, it performs a placeholder comparison at address $9F60 (first expansion card slot).
The bootloader should work on release builds of the ROM too, I tested from the latest commit (c921a17).

If anyone is intrested for the source code for this program, (it currently doesn't work) here it is: https://github.com/calmsacibis995/x16-cpm
Last edited by ZeroCool32 on Mon Sep 30, 2024 7:23 pm, edited 1 time in total.
Edmond D
Posts: 489
Joined: Thu Aug 19, 2021 1:42 am

Re: CP/M on the X16

Post by Edmond D »

An informative video on the Z80 microprocessor - https://www.youtube.com/watch?v=cbMdq8Dsz6Y
Post Reply