• Please review our updated Terms and Rules here

Autoexec.bat for cpm?

Ok, I'm working through the process and am on the system. The transient apps don't include getsys, putsys, movcpm, and sysgen. Grant did provide a version of putsys that is used before cpm is up and running. I assume that I can assemble that to a com file. I assume that getsys is the "reverse" of putsys and can be created from the template in the 2.2 manual.

Are movcpm and sysgen system independant and rely on get/putsys? Where do I find those binaries, or asm files?

len


len
 
SYSGEN and MOVCPM are the standard commands outlined by DRI, provided with the 8" SDSS floppy version of CP/M, but for any other type of disk they need to be customized. I'm not sure about Grant's utilities, but "PUTSYS" is usually the equivalent of the SYSGEN with the "from memory, to disk" option. I don't know enough about Grant's system, but depending on how PUTSYS was written it might compile into a working COM file. But you still need to give the system image to PUTSYS somehow.
 
Ok, I'm working through the process and am on the system. The transient apps don't include getsys, putsys, movcpm, and sysgen. Grant did provide a version of putsys that is used before cpm is up and running. I assume that I can assemble that to a com file. I assume that getsys is the "reverse" of putsys and can be created from the template in the 2.2 manual.

Are movcpm and sysgen system independant and rely on get/putsys? Where do I find those binaries, or asm files?

len


len

I took a quick look at PUTSYS, there isn't much there. it is standalone and so does not call CP/M at all. You probably can't return to CP/M after running it. It looks like all it does is write the contents of memory from 0D000H through 0FFFFH onto the first sectors of the disk (CF card). So, you must get CP/M loaded into memory first. The HEX files all specify addresses, so if there is a load function (in the ROM) that will put each HEX file into it's specified address in memory, then you should be able to load the three CP/M HEX files (CCP, BDOS, BIOS), then load PUTSYS and run it. But I'm guessing here - someone that's actually done it would be better to answer.
 
i'm going to set up an emulator. There are a few of things thngs I need to get working first. I don't think Grant expected anyone to modify the cpm install.
 
I think the PUTSYS method is just how Grant did modifications to the CP/M install. I'm not sure if you are using all of his code, but his monitor ROM code will automatically download (load into memory) any HEX files that are pasted to the console serial port. Assuming you have some sort of terminal emulator window open on the main serial port, and you see the '>' monitor prompt, you should be able to just paste the HEX files into that window one by one. How you get each one into your clipboard will depend on what OS you are running on your host computer. So, I think the procedure is (order is significant!):

1) start Z80 and get monitor prompt ">"
2) copy CPM22.HEX to the clipboard, paste into Z80 terminal window
3) copy CBIOSxxx.HEX to the clipboard, paste into Z80 terminal window
4) copy PUTSYS.HEX to the clipboard, paste into Z80 terminal window
5) enter monitor command "G5000" to run PUTSYS

Hopefully, someone familiar with Grant's code can confirm this.
 
I think the PUTSYS method is just how Grant did modifications to the CP/M install. I'm not sure if you are using all of his code, but his monitor ROM code will automatically download (load into memory) any HEX files that are pasted to the console serial port. Assuming you have some sort of terminal emulator window open on the main serial port, and you see the '>' monitor prompt, you should be able to just paste the HEX files into that window one by one. How you get each one into your clipboard will depend on what OS you are running on your host computer. So, I think the procedure is (order is significant!):

1) start Z80 and get monitor prompt ">"
2) copy CPM22.HEX to the clipboard, paste into Z80 terminal window
3) copy CBIOSxxx.HEX to the clipboard, paste into Z80 terminal window
4) copy PUTSYS.HEX to the clipboard, paste into Z80 terminal window
5) enter monitor command "G5000" to run PUTSYS

Hopefully, someone familiar with Grant's code can confirm this.

I will still need to modify the input buffer for the ccp, right?

Tonight I tried running movcpm, I got a copy from the ver 2.2 cpm of the z80pack, and it hung. I used ddt to remove the serialization checks, no luck either.

I did email Grant to see if he can help with the utilities.

Len
 
Arggg.... Rewatching Mikes video on using ddt I now realize I probably didn't patch movcmp to ignore the serial check. I just changed it in memory.

So can I assume that when I load and modify a file in memory the I have to exit to cpm. Go0. Then I have to do a save command to get it back to disk?

Len
 
I will still need to modify the input buffer for the ccp, right?

Tonight I tried running movcpm, I got a copy from the ver 2.2 cpm of the z80pack, and it hung. I used ddt to remove the serialization checks, no luck either.

I did email Grant to see if he can help with the utilities.

Len

The problem with MOVCPM is that the image of CP/M 2.2 is actually embedded in MOVCPM. So by taking MOVCPM from z80pack you got the wrong BIOS and probably the wrong load addresses. Grant's CP/M is not setup for MOVCPM, as far as I can tell.

So, stepping back a bit, it looks like Grant's CP/M is not setup to use MOVCPM or SYSGEN (since neither is provided). It looks like there is really only one direction for the "sysgen" process: from HEX file to PUTSYS to CF card. Given that, it seems the two methods for patching the CCP is to either patch the boot sectors of the CF card directly, or to patch the HEX file CPM22.HEX before you "sysgen" that onto the CF card. Note that I'm using lower-case "sysgen process" rather than upper-case SYSGEN command.

Patching a HEX file is not really practical, and there appear to be no tools to reconstruct CPM22.HEX from a binary format. DDT will load HEX files, but I don't see any way to write/save that out to a HEX file.

There also does not exist a program to patch the CF card directly, either. I could figure out a way using Linux tools, but you'd have to plug the CF card into your host computer.

I haven't looked at the URL(s) talked about earlier, for that program to stuff a command into the CCP boot sectors, to see if it might work in this environment. I guess that's the next step. I also wrote a "disk patch" program that I used for such things, but would have to dust that off and convert it to whatever terminal type your terminal emulator runs... Actually, I could probably write a simple program to put a command into the CCP on the CF card for you, that would probably be easier than a general-purpose disk patch utility.
 
Why can’t you just upload your modified cbios.hex file as detailed in step 2 of PUTSYS of Grant’s procdure at http://searle.hostei.com/grant/cpm/index.html#InstallingCPM ?

Mike

I can, and will try soon. Although I also need to put the command line in the cpp buffer, right?

I also need to update the boot rom not to pause, or at least have a time out and then load.

In the mean time I have been reading up on the internals of cpm. I am interested in knowing the why's and how's.

Len
 
This evening I will throw together a program to update a command into the CCP. But you should be able to run the new BIOS even without that.
 
Here is a new version of an AUTO.COM program to stuff a command into the CCP on the CF card of a system based on Grant Searle's CP/M. I tested this on a simulation I have for another project, but it is also based on Grant's code. This system does not have the "CCP warm start" patch, so I was able to see the behavior in that case.

View attachment auto_ccp.zip

This command works like that one in the URL, but I wrote this one from scratch so I don't expect it to be bug-for-bug compatible. The basic syntax is the same:

Code:
AUTO [command]

Where "command" is optional, and represents whatever command you want to run when CCP cold starts. With no command (i.e. an empty command) it will disable any auto-run command in the CCP.

Be sure to test this with an innocuous, builtin, command such as "DIR" first, or else you risk getting into an infinite loop as previously discussed (in case the BIOS patch is not there, or not working as expected).

Note that, as also previously discussed, whether or not the auto-command is triggered when running without the BIOS patch will depend on how the particular command runs and exits. Commands like "DIR" are builtin and never cause a warm boot. Some COM file commands, like STAT.COM, also don't ordinarily do a warm boot and so are "safe" (but annoying) without the BIOS patch.

Here's a quick example, again run on a system without the BIOS patch:

Code:
A>auto dir
AUTO - set command in CCP
Updated CCP command to "DIR"
A: ASM      COM : COPY     COM : DDT      COM : DUMP     COM
A: ED       COM : CCP      COM : LOAD     COM : PIP      COM
A: STAT     COM : SUBMIT   COM : XKILL    COM : XSUB     COM
A: CPMLDR   COM : RESET    ASM : CPM3     SYS : RESET    PRN
A: RESET    HEX : RESET    REL : RESET    SYM : RESET    COM
A: TERMXT   ASM : EDIT     COM : TERMXT   PRN : TERMXT   HEX
A: TERMXT   SYM : DOWNLOAD COM : AUTO     COM : DOWNLOAD HEX
A:          PRN :          HEX
A>stat
A: R/W, Space: 7980k


A>asm
CP/M ASSEMBLER - v2.01
NO SOURCE FILE PRESENT

A: ASM      COM : COPY     COM : DDT      COM : DUMP     COM
A: ED       COM : CCP      COM : LOAD     COM : PIP      COM
A: STAT     COM : SUBMIT   COM : XKILL    COM : XSUB     COM
A: CPMLDR   COM : RESET    ASM : CPM3     SYS : RESET    PRN
A: RESET    HEX : RESET    REL : RESET    SYM : RESET    COM
A: TERMXT   ASM : EDIT     COM : TERMXT   PRN : TERMXT   HEX
A: TERMXT   SYM : DOWNLOAD COM : AUTO     COM : DOWNLOAD HEX
A:          PRN :          HEX
A>auto
AUTO - set command in CCP
Updated CCP command to ""
A>asm
CP/M ASSEMBLER - v2.01
NO SOURCE FILE PRESENT

A>

Note how the ASM.COM command will always do a warm boot via jump to 0000h, and this always triggers (in this system) a re-run of the CCP command. On your system, with the BIOS patch, the command would/should not get executed until you actually do a cold boot.

also note, in CP/M 2.2, the auto-run command is not echoed nor is a CP/M prompt printed.
 
Hi,

I'm making some progress. I didn't have too much time today, but after spending the last few days reading the Programmers cp/m book things are making sense. I added a drive parameter definition to the cpmtools running under linux and can see files and such on the drive image. I wrote a utility so I can rebuild the system on the disk file from the stock files. Tomorrow I will build it with the new bios and give it a test.

Len
 
UPDATE!!!

I got the modified CBIOS patched in and tested. Appears to work perfectly.

Next I copied over your new AUTO command. Ran it, and it works perfectly as well!!! Very cool, thank you.

Cold boot runs the program defined in the CPP command buffer. Warm start just goes to a command prompt.

Now I can go play with Grants ROM code.

Thank you everyone! This was a fun learning experience.

len
 
Here is a new version of an AUTO.COM program to stuff a command into the CCP on the CF card of a system based on Grant Searle's CP/M. I tested this on a simulation I have for another project, but it is also based on Grant's code. This system does not have the "CCP warm start" patch, so I was able to see the behavior in that case.

This command works like that one in the URL, but I wrote this one from scratch so I don't expect it to be bug-for-bug compatible. The basic syntax is the same:

Just a minor fix for AUTO.COM. The select disk code is currently testing register A.
Code:
    ld    a,seldsk
    call    bios
    or    a,a
    jp    nz,error

However, a select disk failure should return HL as zero.
Code:
    ld    a,seldsk
    call    bios
    ld    a,l
    or    h
    jp    z,error

Only spotted it as I, err, pinched it, for use with my own CBIOS. ;)
 
Back
Top