CP/M 68k

GFA, ASM, STOS, ...

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

rabindranath72
Captain Atari
Captain Atari
Posts: 253
Joined: Tue Feb 15, 2011 3:59 pm

CP/M 68k

Post by rabindranath72 »

Dear all,
I'd like to port CP/M 68k to the Atari ST. I have managed to get a full distribution of v1.1 disk images, and full documentation, including a system guide which shows which calls must be implemented to build a suitable BIOS.
I used cpmtools on Windows to export the CP/M disk images into folders, and put them on my Atari ST hard disk. I can read all the files, the ar utility correctly shows and extracts the contents of the archives, so everything is ready.
Now, before I embark on this project, has anyone already done something similar? (well, apart from the original plan at Atari to use CP/M 68k, but I haven't been able to find anything about this.)

Thanks,
Antonio
User avatar
Eero Tamminen
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3896
Joined: Sun Jul 31, 2011 1:11 pm

Re: CP/M 68k

Post by Eero Tamminen »

You could consider doing most of the development work in emulator like STeem or Hatari (STeem is nicer on Windows and has builtin GUI debugger, Hatari has other advantages like builtin profiler). Using an emulator has a lot of advantages when you're messing with lower level stuff and they have options to run faster than real machine.
User avatar
1st1
Atari God
Atari God
Posts: 1333
Joined: Mon May 07, 2012 11:48 am

Re: CP/M 68k

Post by 1st1 »

I remember that there was a fully workin CP/M 68K for the Atari ST back in 1985. Currently I search the disk images of it.
Power without the Price. It's not a bug. It's a feature. _/|\_ATARI

1040STFM in PC-Tower (PAK68/2, OvrScn, 4 MB, 1GB SCSI, CD-ROM...) * 3x Falcon 030 * 3x TT030 * many 260 /520/1040ST(F)(M)(+) * 520/1040STE * many Mega ST * 2x Mega STE * Stacy * STBook * 2x SLM605 * 3x SLM804 * SMM804 * SH 204/205 * Megafile 30/44/60 * SF314 * SF354 * 5x Pofo * PC2 * PC3 * PC4M * ABC286 * ...
User avatar
AdamK
Captain Atari
Captain Atari
Posts: 455
Joined: Wed Aug 21, 2013 8:44 am

Re: CP/M 68k

Post by AdamK »

CP/M 68k was in fact the first DOS for ST. First shows of ST, before commercial release had it running CP/M 68k. It was replaced by GEMDOS before ST was released.
Atari: FireBee, Falcon030 + CT60e + SuperVidel + SvEthlana, TT, 520ST + 4MB ST RAM + 8MB TT RAM + CosmosEx + SC1435, 1040STFM + UltraSatan + SM124, 1040STE 4MB ST RAM + 8MB TT RAM + CosmosEx + NetUSBee + SM144 + SC1224, 65XE + U1MB + VBXE + SIDE2, Jaguar, Lynx II, 2 x Portfolio (HPC-006)

Adam Klobukowski [adamklobukowski@gmail.com]
User avatar
thothy
Hatari Developer
Hatari Developer
Posts: 448
Joined: Fri Jul 25, 2003 9:36 am
Location: Germany
Contact:

Re: CP/M 68k

Post by thothy »

Have you seen the CP/M archives here:

http://www.retroarchive.org/cpm/archive ... ource.html

There is a cpm68k.zip there which is said to contain the sources for CP/M68k version 1.2.
Dal
Administrator
Administrator
Posts: 4219
Joined: Tue Jan 18, 2011 12:31 am
Location: Cheltenham, UK
Contact:

Re: CP/M 68k

Post by Dal »

I have found the CP/M emulator (v2.2) on a disk here. I'm missing the Utilities disk, but I have successfully just run the emulator itself on a STacy.
STE: Desktopper case, IDE interface, UltraSatan (8GB + 512Mb) + HXC floppy emulator. Plus some STE's/STFM's
User avatar
rondc
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 115
Joined: Tue Apr 30, 2019 9:59 pm
Location: Spain
Contact:

Re: CP/M 68k

Post by rondc »

I would like to share that we already have a version of CP/M68K (V.1.2) working on all STs, mono and color.
enmarcha01.jpg
We continue working on it, more details in:http://www.retrowiki.es/viewtopic.php?f ... p200175782
Regards, ron.
You do not have the required permissions to view the files attached to this post.
User avatar
rondc
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 115
Joined: Tue Apr 30, 2019 9:59 pm
Location: Spain
Contact:

Re: CP/M 68k

Post by rondc »

First test release has been published:

BootLoader: 0.4
Bios: 0.4

http://retrowiki.es/viewtopic.php?f=4&t ... p200176189

Enjoy.
User avatar
chronicthehedgehog
Captain Atari
Captain Atari
Posts: 271
Joined: Sun May 08, 2022 5:24 pm
Location: The Midlands

Re: CP/M 68k

Post by chronicthehedgehog »

:cheers:
Mgi
Atari freak
Atari freak
Posts: 71
Joined: Sun Mar 14, 2021 7:15 am
Location: West Sussex

Re: CP/M 68k

Post by Mgi »

I just tried on my Atari TT and it works :)
Now I need to try some software...
simonsunnyboy
Moderator
Moderator
Posts: 5772
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: CP/M 68k

Post by simonsunnyboy »

rondc wrote: Tue Oct 24, 2023 7:50 pm First test release has been published:

BootLoader: 0.4
Bios: 0.4

http://retrowiki.es/viewtopic.php?f=4&t ... p200176189

Enjoy.
I would really like to check this out. Is there a chance for documentation in English?
Simon Sunnyboy/Paradize - http://paradize.atari.org/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee
elliot
Captain Atari
Captain Atari
Posts: 354
Joined: Tue Mar 17, 2009 2:00 pm

Re: CP/M 68k

Post by elliot »

I remember there being an getting CP/M as part of a bundle with the machine (I think).
Falcon with CT60 in rack mountable case. Two STFMs, one upgraded lots. My original STE from when I was a teen with Switchable TOS, 1.44Mb drive, 4MB RAM, Supra Hard Drive and very very yellow case. Mega STE with (currently none working) Crazy Dots 2. Atari 2600 and a Jag. And a mountain of commercial software and lots of hardware addons.
User avatar
crashman
Captain Atari
Captain Atari
Posts: 244
Joined: Sat May 29, 2010 2:23 am
Location: Vilanova i la Geltrú - Barcelona
Contact:

Re: CP/M 68k

Post by crashman »

simonsunnyboy wrote: Wed Oct 25, 2023 3:26 pm
rondc wrote: Tue Oct 24, 2023 7:50 pm First test release has been published:

BootLoader: 0.4
Bios: 0.4

http://retrowiki.es/viewtopic.php?f=4&t ... p200176189

Enjoy.
I would really like to check this out. Is there a chance for documentation in English?
Here:

https://github.com/teiram/atari-st-cpm
260ST, 520ST, 520ST+, 520STFM, 1040STE, 4160STE, STACY 2, MEGA ST2, MEGA ST4, MEGA STE, TT030, FALCON030, FALCON030 with Centurbo 2rB, Firebee
SH204, Megafile 30, Megafile 60, Megafile 44
SM124, SM125, SM146, SC1224, SC1435
Satandisk, Ultrasatan, HxC SD, Hxc SD Slim, NetUSBee, CosmosEX, Gotek HxC, MicroCosmos
2600VCS, LYNX, LYNX II, JAGUAR
User avatar
JezC
Atari User
Atari User
Posts: 35
Joined: Sat Jul 18, 2020 10:46 pm

Re: CP/M 68k

Post by JezC »

elliot wrote: Wed Oct 25, 2023 4:47 pm I remember there being an getting CP/M as part of a bundle with the machine (I think).
Yes, I had a CPM 68k disc with my Atari 1040STF (back in 1987) - still have the discs somewhere...but not used in many years :(
User avatar
rondc
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 115
Joined: Tue Apr 30, 2019 9:59 pm
Location: Spain
Contact:

Re: CP/M 68k

Post by rondc »

JezC wrote: Wed Oct 25, 2023 8:15 pm
elliot wrote: Wed Oct 25, 2023 4:47 pm I remember there being an getting CP/M as part of a bundle with the machine (I think).
Yes, I had a CPM 68k disc with my Atari 1040STF (back in 1987) - still have the discs somewhere...but not used in many years :(
Hello !
I spent years looking for that specific disc. I knew of its existence but no one had it, no one kept it.

Could you please share an image of it to study it and check our version?
User avatar
Estrayk
Captain Atari
Captain Atari
Posts: 348
Joined: Mon Nov 23, 2015 2:52 pm
Location: Spain

Re: CP/M 68k

Post by Estrayk »

Tested in MegaSTE and it works like a charm! good work guys!
・Falcon ct60e・Atari MegaSTE ・Atari STe ・
User avatar
troed
Atari God
Atari God
Posts: 1769
Joined: Mon Apr 30, 2012 6:20 pm
Location: Sweden

Re: CP/M 68k

Post by troed »

Most of 68K executables you may find around won't work. Seems to be because they are expected to be loaded into a lower TPA than available (around $400 or $600) and BDOS fails to load them. REL executables may work or also 68K executables you generate after them using the RELOC utility (I normally relocate to $A900)
(I know nothing about CP/M)

Is this a major issue such that it would be very beneficial to move TOS away from low mem? The other alternative, although not at all what the project has done, would be to not use TOS but to re-implement the functions needed from BDOS.
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3328
Joined: Sun Aug 03, 2014 5:54 pm

Re: CP/M 68k

Post by ThorstenOtto »

troed wrote: Thu Oct 26, 2023 3:17 pm I normally relocate to $A900
Where was that quote from? I can't see it here.

Anyway, just for info, TOS might need even more of the low memory. The reference values are:

Code: Select all

MEMBOT_TOS100 = 0x0000a100
MEMBOT_TOS102 = 0x0000ca00
MEMBOT_TOS104 = 0x0000a84e
MEMBOT_TOS162 = 0x0000a892
MEMBOT_TOS206 = 0x0000ccb2
MEMBOT_TOS306 = 0x0000e6fc
MEMBOT_TOS404 = 0x0000f99c
When using EmuTOS, this will actually vary, and is typically a up to 13KB more than equivalent TOS versions because of added functionality.
User avatar
rondc
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 115
Joined: Tue Apr 30, 2019 9:59 pm
Location: Spain
Contact:

Re: CP/M 68k

Post by rondc »

Anyway, keep in mind that CP/M68K does not start as a program under the control of the operating system ( at least not the TOS ), we take control from an executable bootloader and never return control to the TOS.

The idea is to correctly calculate a safe address to place the TPA, but it seems that the BIOS call getmpb gives a very high address, and it is not clear to us why it does not give access to memory between $600 and $a84e which at least with the TOS that we try is what brings we back.

The fact is that it is about supplanting the operating system. It would be required in a certain way to run CP/M68K as if it were a GEMDOS application (using a pexec call or similar).

CP/M68K is also not relocatable, its absolute position is defined when the binary is generated, so the idea is to steal as much memory as possible, without affecting the functionality offered by BIOS/XBIOS and being very clear that TOS does not is going to be executed.

We will continue to investigate a safe way to maximize the memory we can monopolize.
unaprueba.png
You may suffer some video problems running on machines with 512K RAM, TOS 1.0 does not work fine, the rest goes like a charm. Tested also with EmuTOS 1.2.1 working really nice. And tested with Slingshot's MiSTery ST core on fpga too.

And this is why it is important for us to locate a preserved working version of CP/M68K. We started researching in April 2018 and five years later we finally have a working BIOS. At least, something is something.

Best Regards
ron
You do not have the required permissions to view the files attached to this post.
User avatar
troed
Atari God
Atari God
Posts: 1769
Joined: Mon Apr 30, 2012 6:20 pm
Location: Sweden

Re: CP/M 68k

Post by troed »

ThorstenOtto wrote: Thu Oct 26, 2023 4:04 pm Where was that quote from? I can't see it here.
The Github page.
rondc wrote: Thu Oct 26, 2023 5:10 pm CP/M68K is also not relocatable, its absolute position is defined when the binary is generated, so the idea is to steal as much memory as possible, without affecting the functionality offered by BIOS/XBIOS and being very clear that TOS does not is going to be executed.
Ok. Well. BIOS/XBIOS are part of TOS so what you're really saying is that you're not giving control to the GEM desktop, but you're still using TOS. Replacing TOS completely was what I meant with implementing the CP/M BIOS towards hardware instead of TOS BIOS.

As to how much of low mem those parts of TOS use is another question. Definitely the TPA is in low mem - but Thorsten knows this better than I do.
User avatar
JezC
Atari User
Atari User
Posts: 35
Joined: Sat Jul 18, 2020 10:46 pm

Re: CP/M 68k

Post by JezC »

rondc wrote: Thu Oct 26, 2023 1:46 pm
JezC wrote: Wed Oct 25, 2023 8:15 pm
elliot wrote: Wed Oct 25, 2023 4:47 pm I remember there being an getting CP/M as part of a bundle with the machine (I think).
Yes, I had a CPM 68k disc with my Atari 1040STF (back in 1987) - still have the discs somewhere...but not used in many years :(
Hello !
I spent years looking for that specific disc. I knew of its existence but no one had it, no one kept it.

Could you please share an image of it to study it and check our version?
Hi,

I'll try to look through the disc boxes that I have to hand over the weekend...if it's not in those then it will take a bit longer (I'll have to find the boxes in storage in my garage which hold the other disc boxes).

It's a very long time since I used it (and it was effectively a 'bonus' disc that came with my first ST) but let's hope it is what you are after.

Anyway, please leave it with me & I will report back once I find it...

Best regards,
Jez
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3328
Joined: Sun Aug 03, 2014 5:54 pm

Re: CP/M 68k

Post by ThorstenOtto »

rondc wrote: Thu Oct 26, 2023 5:10 pm Anyway, keep in mind that CP/M68K does not start as a program under the control of the operating system ( at least not the TOS ), we take control from an executable bootloader and never return control to the TOS.
You may not return to TOS, but you are using its BIOS functions, and those will use the memory up to memtop.
call getmpb gives a very high address, and it is not clear to us why it does not give access to memory between $600 and $a84e which at least with the TOS that we try is what brings we back.
getmbp gives you the addresses that are later maintained by GEMDOS Malloc() call. That will be the same memory areas that are usable by CPM. Also remember that memory areas between $0-$800 are supervisor accessible only on Atari.
The fact is that it is about supplanting the operating system. It would be required in a certain way to run CP/M68K as if it were a GEMDOS application (using a pexec call or similar).
No, you could do the same as before and load CPM with your bootlader. Only the bootloader will be a GEMDOS application, but once it has loaded the CPM kernel, and that kernel does not call BIOS anymore,
you have access to all remaining memory.

BTW. the C compiler that CP/M uses is practically identical to that what Atari calls "Alcyon-C" in their developer sdk. In https://github.com/th-otto/tos3x you will find binaries that can be used as a cross-compiler on linux/win32/atari. Maybe that will be useful during developing.
simonsunnyboy
Moderator
Moderator
Posts: 5772
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: CP/M 68k

Post by simonsunnyboy »

Question: I found some CP/M68K user documentation online which tells us that BDOS is accessed via trap #2.
In the sources I saw trap #3, how is that meant to work?

Am I missing something?
Simon Sunnyboy/Paradize - http://paradize.atari.org/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3328
Joined: Sun Aug 03, 2014 5:54 pm

Re: CP/M 68k

Post by ThorstenOtto »

simonsunnyboy wrote: Fri Oct 27, 2023 4:00 pm Question: I found some CP/M68K user documentation online which tells us that BDOS is accessed via trap #2.
In the sources I saw trap #3, how is that meant to work?

Am I missing something?
Trap #2 is used for BDOS calls (similar to GEMDOS). Trap #3 is used for BIOS calls.
simonsunnyboy
Moderator
Moderator
Posts: 5772
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: CP/M 68k

Post by simonsunnyboy »

Thank you for clarification!
Simon Sunnyboy/Paradize - http://paradize.atari.org/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee
Post Reply

Return to “Coding”