PDA

View Full Version : compiling software for CP/M machines



Roland Huisman
December 30th, 2012, 11:40 AM
It's well known, most CP/M software is specific compiled for a model machine.

But how was this done? Did you buy pre built software on a specific disk for
your machine? Or was it a universal disk which every CP/M machine could read?

Compiling for an specific machine means that your compiler needs exactly the
specifications for this machine. If I compare it to C you need an iostream.h or
something like that. Did the manufacturer ship an extra file with the computer?
Or maybe a special compiler which contains all machine specific information?
In these days there were also more compilers so this would also not be very compatible...

Regards, Roland

Chuck(G)
December 30th, 2012, 11:52 AM
Everyone that I knew of used generic software for program development. Standard CP/M functions (BDOS and CBIOS) were present in I/O libraries, so there was a certain degree of independence there.

If you really had to access the hardware on a specific machine, you wrote code to do it. Accommodation to a wide range of machines was possible, but not easy. Look, for example, at Kermit and how it dealt with the bewildering variety of hardware on CP/M systems.

Understand that most CP/M programs were text-based, not graphical, which made generalization easier.

krebizfan
December 30th, 2012, 12:14 PM
Chuck(G) covered the compilation issue.

For disk formats, one had to request the specific format that worked on the computer. Some software was sold by the computer's manufacturers and thus was provided on the proper disk. Some software had customizable features in case systems had unusual keyboards or the like. If you want a long description of the classic techniques to handle CP/M, InfoWorld March 2, 1981 covers the MS Softcard with a side article covering the changes required to get WordStar to run on the Softcard on an Apple II. See pages 20, 21 and 32 for plenty of fun details.

CP/M User
December 30th, 2012, 12:33 PM
I was compiling programs using Turbo Pascal 3 for my own system which was producing CP/M ".COM" files. However they were system specific (only accessible through CP/M 2.2) using a specific "CALL" which allowed me to Enter the Machines Firmware to access many of the features - Graphics, Screen or Text Related Functions, they also allowed Disk Functions though I wasn't using them cause I didn't see the point while I was in CP/M.


With that kind accessibility I could do all sorts of things and make Turbo Pascal more like the BASIC is that you get on Bootup, though because Turbo Pascal can compile programs there's the extra benefit of Speed that you get when you compile a program when compared to an Interpreted Language, which the computer needs to translate as it executes the program, thus slowing the process down.


Unfortunately I'm drawing this to a close, and will be focusing more on the platform I should be writing routines for because I've annoyed many people who want CP/M programs. I'm just as annoyed because Turbo Pascal won't compile for the other platform and Decoding the Library is a Nightmare and don't have the Patience to Decode it. :(
The other Pascal Compiler I'm using for the other system is fine, and is good in some areas because it handles some more of the capabilities of my machine, though it doesn't support constant arrays, no Byte Variable Type and no String Type, one has to Setup an Array of type Char. I just managed to write a program last night which can pass a string onto my Variable which wasn't easy. I will need to do this if I'm to be able to transfer my Specific Machine programs into this other System.

Ok, I'll answer your questions :)


But how was this done?

For the machine I had the first machine didn't have a Disk Drive as standard, if you brought the machine and got a Disk Drive for it you would get CP/M 2.2 along with the package as well as Disk Based Operating System for you to access Disk Operations when the computer is in BASIC mode. Later computers came with a Disk Drive as standard and came bundled with CP/M with the machine and because the later machine had 128k it came with CP/M Plus as well as CP/M 2.2 (for compatibility). My system had it own specific disks and disk drive, other CP/M systems used 5.25" Disks or 8" Disks, though for my system it had 3" Disks.


Did you buy pre built software on a specific disk for your machine?

Not sure what you mean, CP/M had a vast number of Public Domain programs which I think was accessible through Bulletin Board Serviced (BBS), though software was also made commercially for CP/M - Turbo Pascal was written by Borland for example, in terms the versions of TP out there, there was more generically available versions of TP I think which must of been for Systems which had 5.25" Disk Drives. To setup the program you would go through a process of working out which Terminal Emulation you'd need to get it working properly or you could select from a vast range of computers and it would automatically setup for the correct system, so that it would appear properly when you ran the main program. On my system though it was specifically custom made for the system, and if you wanted to run it on CP/M Plus, you would have to do some additional setup for it to work in CP/M Plus.


Or was it a universal disk which every CP/M machine could read?

I think I answered this in the last question, though for our system it had it's own Custom Made Disk Drive which was specific for our range of machines. The same company built some Business machines which had CP/M as standard with the same Disk Drives which some of the programs games had some compatibility with the 128k machine, though I think that was about as far as the compatibility went.

MikeS
December 30th, 2012, 02:12 PM
I thought the whole point of CP/M (and most OSes) was to make the applications more or less hardware-independent (once you got the software on the particular system's disks and configured it for your particular terminal/display).

Chuck(G)
December 30th, 2012, 02:48 PM
Indeed, it's perfectly possible to write a system-independent disk copy utility without paying any attention to the nicities of the disk hardware--CP/M reduces all disk sectors, regardless of their physical size to 128 bytes. So toss together some CBIOS calls and you've got a disk copy utility.

The generic CP/M had no provisions for disk [b]formatting[]/b; however. Any formatting utility that you might see has been provided by the OEM,not by DRI. Indeed, some early systems required that the user purchase pre-formatted floppies. It's not unusual for me to see 8" CP/M data floppies with the 3740 VOL label still intact (in EBCIDIC). I believe that the DEC Rainbow 100 was initially sold without a formatting program--you had to buy your RX50 disks preformatted.

krebizfan
December 30th, 2012, 02:58 PM
But getting the software onto the specific system disk and modifying it for the specific display was sometimes the hard part. I have been looking at old WordStar articles and most systems could run the same executable after it got placed on the correct disk format. TSR-80 and Heath H-89 needed specialized modifications. The article for the Softcard suggested making many hacks because the Apple II didn't pass all the keystrokes to the Z-80 system correctly. Changing timing delays just to get the keys to appear in the correct order is perhaps slightly more work than many users were eager to do.

CP/M User
December 30th, 2012, 03:47 PM
I cannot talk about all the Systems which had CP/M on it, though there were systems which didn't have the support for Graphics, other systems which had Graphical Capabilities had GSX in some form available for it. On my Computer the 64k CP/M 2.2 for example didn't have GSX and included on the system disk is a copy of DR Logo. The version which accompanied that version of CP/M is using Specific Hardware to produce the Turtle Graphics, however it was a limited form of Logo compared to the one which accompanied CP/M Plus. That particular version of DR Logo was using GSX, though the advantage with that is you had 128k available.
Different forms of GSX appeared on different systems and even different platforms like the 16bit versions of CP/M, I think the only setback with that version was the limited amount of video card support. GSX was perhaps more significant if you had an 8bit system with Graphical Abilities because it meant there was some support for applications which graphics was available across different computers, I think that was why there was a push for the support for applications across numerous systems using CP/M.

In terms of writing Hardware specific applications, I think in some circumstances if a Machine was solely using CP/M on bootup and you wanted to make some Arcade style games, then you have no choice but to write hardware specific programs. The Amstrad PCW is an example of a machine where some Commercial Games were written targeting those machines, though because it was a machine which booted up CP/M, a number of programs were written in CP/M COM files. I guess if one really wanted to make it bypass CP/M it could by simply making a Bootup game disk. Games like the Classic Alley Cat which IBM made was originally on a Bootup Disk even though it was a DOS bootup Disk, the game never really make it possible to return to DOS easily. I think the early Windmill Software Digger game was another example of a game which came on a Bootup Disk.

Chuck(G)
December 30th, 2012, 04:05 PM
To give you an idea of the "ideal" CP/M system in the mind of Gary Kildall was the Intel MDS-800. OEM distro disks for all 8-bit CP/M products came on SSSD 8" MDS-readable media. Preconfigured CP/M (and MP/M) for system boot came configured to run on that configuration. If you buttonholed Gary and asked him, his story was always "8" Single-sided single-density for an Intel MDS) is DRI's standard distribution medium.

So, if it runs on an MDS-800 and 8-bit, it's pretty much what Gary had in mind. I tend not to think of CP/M as a hardware abstraction, but rather as a simple file manager.

I'm sure that many will disagree.

CP/M User
December 30th, 2012, 05:29 PM
Interesting reading about the Intellec series:

http://www.old-computers.com/museum/computer.asp?st=1&c=754

it didn't mention anything about CP/M and in terms of Operating System is had ISIS operating system, though it would be difficult not to consider CP/M for the MDS system.

CP/M could be considered as a simple file manager which became grew in popularity though the growth of programming languages which resulted in a demand for applications. :D

Chuck(G)
December 30th, 2012, 06:48 PM
No, but it was the MDS/Intellec that Gary did his development on and OEM kits were shipped to boot from it. After all, you needed to boot CP/M or MP/M to get the files from the distro disks to work with...

I was surprised to discover that MP/M was even configured as a 2-console system to boot on an MDS-800. The second console drove the current-loop output of the MDS!

CP/M User
December 30th, 2012, 11:52 PM
No, but it was the MDS/Intellec that Gary did his development on and OEM kits were shipped to boot from it. After all, you needed to boot CP/M or MP/M to get the files from the distro disks to work with...

Yes. :D


I was surprised to discover that MP/M was even configured as a 2-console system to boot on an MDS-800. The second console drove the current-loop output of the MDS!

I don't quite follow, but then I never have understood MP/M, was it designed for simple Multi-tasking operations or something of that nature? If so, do you know how well that system performed using MP/M?

Tor
December 31st, 2012, 02:02 AM
I don't quite follow, but then I never have understood MP/M, was it designed for simple Multi-tasking operations or something of that nature? If so, do you know how well that system performed using MP/M?
Multi-user rather than multi-tasking. But you could "multi-task" by running multiple applications at the same time as different users.. back in the day (and I only ever saw one setup, in an accountant's office) there would have been different terminals for each user, but recently I ran MP/M on an SBC with a propeller chip and there I could run multiple users in a single terminal window - and have some kind of multi-tasking. I don't know if that was something you could always do back then, maybe it's simply a question of having a BIOS that could use a single terminal.

-Tor

CP/M User
December 31st, 2012, 12:00 PM
Multi-user rather than multi-tasking. But you could "multi-task" by running multiple applications at the same time as different users.. back in the day (and I only ever saw one setup, in an accountant's office) there would have been different terminals for each user, but recently I ran MP/M on an SBC with a propeller chip and there I could run multiple users in a single terminal window - and have some kind of multi-tasking. I don't know if that was something you could always do back then, maybe it's simply a question of having a BIOS that could use a single terminal.

-Tor

Oh that makes sense then. :D

Chuck(G)
December 31st, 2012, 12:04 PM
I don't quite follow, but then I never have understood MP/M, was it designed for simple Multi-tasking operations or something of that nature? If so, do you know how well that system performed using MP/M?

As has been said, multi-user, not just multi-tasking.

Pretty well for what it was. MP/M I was a bit flakey, but MP/M II was better. It was initially limited to running one standard .COM application with one .PRL--or two .PRLs. The BIOS (actually a CBIOS with an XIOS) was a bear to get right. DRI leveraged most of the XIOS to CP/M 3.0.

CP/M User
December 31st, 2012, 12:25 PM
As has been said, multi-user, not just multi-tasking.

Pretty well for what it was. MP/M I was a bit flakey, but MP/M II was better. It was initially limited to running one standard .COM application with one .PRL--or two .PRLs. The BIOS (actually a CBIOS with an XIOS) was a bear to get right. DRI leveraged most of the XIOS to CP/M 3.0.

I wasn't aware there was a MP/M II and the book I've got only talks about MP/M-80 & MP/M-86 followed by Concurrent CP/M-86. The Multi-user setup I'm imagining that MP/M had was to have a central machine allocating resources for a bunch of users on Dummy Terminals, was that the arrangement?

Chuck(G)
December 31st, 2012, 02:35 PM
I've got both MP/M I and MP/M II, the latter in OEM distro format. Yes, usually dumb terminals, such as the WY-50. However, I've heard of multiprocessor versions of MP/M as well, though I don't know how they were configured.

MP/M-86 came after MP/M II, I think (I'll have to check) and eventually morphed into Concurrent CP/M, then Concurrent DOS.

CP/M User
January 1st, 2013, 01:18 AM
I had a read about MP/M on Wikipedia (http://en.wikipedia.org/wiki/MP/M) but there's not a lot there as you probably know. It seems as though if MP/M was using Bank Switching for moving applications around, a similar process would be used later for CP/M Plus.

Roland Huisman
January 1st, 2013, 02:29 AM
wow what a lot of information for my topic!
Thanks a lot! It covers more than I could ask :-)

If I read the whole story I can hear developers scream for compatibility :-)
Was the A1 disk format a format which you can use at all systems?
You have to start somewhere putting your files on the computer.

These days you don't need a range of computers for software development.
Although, I thought Microsoft has a huge range of computer setups to test their OS of course.

Regards, Roland

Chuck(G)
January 1st, 2013, 09:13 AM
I had a read about MP/M on Wikipedia (http://en.wikipedia.org/wiki/MP/M) but there's not a lot there as you probably know. It seems as though if MP/M was using Bank Switching for moving applications around, a similar process would be used later for CP/M Plus.

Oddly, the version of MP/M that ships for bootup on the MDS doesn't use bankswitching, as the MDS-800 doesn't use it. As I mentioned, CP/M 3.0 was built on the MP/M XIOS. For running applications in non-switchable space, you could use PRLs (page relocatable executables), which are pretty much COM files, but with a map of locations containing relocatable addresses (relocated to 100h boundaries) appended. This was a system used by MOVCPM for changing the system size since the earliest days of CP/M. The way you'd create a PRL was to compile/assemble a program twice at locations offset by 100h. A program would then compare the binaries and generate the map. Later devtools, such as RMAC got rid of the need for a second compile.

CP/M User
January 1st, 2013, 02:20 PM
wow what a lot of information for my topic!
Thanks a lot! It covers more than I could ask :-)

If I read the whole story I can hear developers scream for compatibility :-)
Was the A1 disk format a format which you can use at all systems?
You have to start somewhere putting your files on the computer.

These days you don't need a range of computers for software development.
Although, I thought Microsoft has a huge range of computer setups to test their OS of course.

Regards, Roland

I'm unsure about your question regarding the A1 disk format, I think in the likelihood that CP/M came on a range of Disk Sizes I think it's likely that there was no standardised format for computers to read, though I could be mistaking. On my System a CP/M disk was booted up on a System Format Disk, called System because the other being Data had an extra 9k. The missing 9k was the boot sector for CP/M. My computer which had a built-in Disk Drive had an additional 2 x 5.25" Disk Drives which CP/M Plus could use (I brought the machine second hand and the previous owner had done a lot of CP/M based stuff), though when I got the machine they were telling me that one Disk Drive was Single Density and the other Double Density so certain disks could only go into the appropriate drive.

So in terms of Disk Formats, I think CP/M was different across an range of platforms which is why there are programs like 22DISK, though to have compatible programs which could run across a range of systems, people would of been using Bulletin Boards Services to download the software.