Page 1 of 2
CP/M on the X16
Posted: Fri Sep 27, 2024 6:58 pm
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.
Re: CP/M on the X16
Posted: Fri Sep 27, 2024 9:07 pm
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.
Re: CP/M on the X16
Posted: Fri Sep 27, 2024 9:23 pm
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.
Re: CP/M on the X16
Posted: Fri Sep 27, 2024 11:45 pm
by Ser Olmy
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.
Re: CP/M on the X16
Posted: Fri Sep 27, 2024 11:53 pm
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.
Re: CP/M on the X16
Posted: Sat Sep 28, 2024 1:33 am
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.
Re: CP/M on the X16
Posted: Sat Sep 28, 2024 4:34 pm
by ZeroCool32
Ser Olmy wrote: ↑Fri Sep 27, 2024 11:45 pm
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.
Re: CP/M on the X16
Posted: Sun Sep 29, 2024 2:54 am
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
Re: CP/M on the X16
Posted: Sun Sep 29, 2024 7:48 am
by ZeroCool32
Here is a screenshot of a very primitive CP/M bootloader that I wrote:
- BOOT65 early development (2024-09-29)
- 2024-09-29_10-02.png (9.7 KiB) Viewed 451 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
Re: CP/M on the X16
Posted: Mon Sep 30, 2024 4:32 pm
by Edmond D
An informative video on the Z80 microprocessor -
https://www.youtube.com/watch?v=cbMdq8Dsz6Y