Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CP/M 3 project restart

114 views
Skip to first unread message

bbel...@gmail.com

unread,
Dec 19, 2018, 2:45:17 PM12/19/18
to
Good afternoon, S-100 and CP/M experts.
(I am now cross-posting on S100Computers and comp.os.cpm)

After a few weeks off to attend to some other things, I have re-started my project to get CP/M 3 running on my S100 machines. I have embraced the suggestions by several to temporarily abandon multi-format support and concentrate on just a single disk format - standard IBM SSSD 128 b/s.

In the last few days, I have been able to accomplish much. The code is significantly simpler, so the nearly complete re-write of my main BIOS and a new CPMLDR bios went rather quickly. The only modules salvaged from my previous attempt (which started out as my old CP/M 2.2 BIOS) were my Console I/O routines and the low-level floppy disk drivers.

So now I have a CPMLDR.COM file that loads CPM3.SYS. My CPM3.SYS file seems to be operational now too, but here is where I am stuck again and hope someone has some advice. Here is my sequence of loading at this point, since I have not yet written anything to the system tracks, as I think I still need to have CPM3.SYS running in a debugger:

1. Boot CP/M 2.2 on Drive A:
2. ZSID CPMLDR.COM [to load CPMLDR]
3. I$B [to set breakpoint at completion of CPM3.SYS load]
4. G0100 [to run CPMLDR, which loads CPM3.SYS]
CPM3.SYS loads and displays the load map:
BIOS3 9A00H 0600H
BDOS3 7B00H 1F00H
TPA 30K
5. P9A00 [set a passpoint at the start of the cold boot loader]
6. G9A00 [execute into the start of cold boot and break]
7. G,9B88 [Execute cold boot to the instruction just before transfer to CCP @ 0100]
Console displays Cold Boot Sign-on message as expected.
Console displays message that CCP is loading from data tracks as expected.
Program breaks at 9B88.
Examining return code from cold boot CCP load routines shows success.
Code at 0100 appears to be CCP.COM.
Executing from here causes the drive A: head to load and the system hangs.
With some debug code running in my BIOS, I can see that it is continuously looping through calls to SELDSK, SETTRK, SECTRN, SETSEC, SETDMA and READ with an occassional MOVE called as well. It seems to be reading the disk directory on track 2 over and over again.

Up to this point, I have tried to avoid digging into the guts of BDOS or CCP. However, in order to attemtp to understand what is happening and why, I thought I would take a shot at CCP. But right off the bat, I am having problems understanding some things.

I have a copy of the source code for CCP3, and I assembled it with DR MAC. The assembler threw a bunch of Phase warnings that I am note sure are okay or not.

Then I tried to compare the assembled code in the PRN file to the CCP.COM file I am loading and trying to run. Ultimately, with a correct PRN file, I can Trace execution of CCP using ZSID and hopefully find out what it is doing to cause the looping I described above. However, the assembled code is not matching a dump of the CCP.COM file. The very first instruction in the COM file is a JUMP to 040A. I'm sure the jump was put there as a result of the ORG statement in the source. But the ORG statement in my copy of the source is to 041A. Further,m it seems all addresses further in the file are off by a factor of 10H. Without being able to explain or understand this discrepency, I am not confident that I can use the PRN file to help trace through my CCP.COM file.

Is it possible that there may be more than one version of CCP.COM for CPM3?
At one point weeks ago, I had checked my CCP.COM file against a new download and they matched, so I don't suspect corruption in the file I am using. Further, file corruption probably would look much more random and not just addresses skewed by 10H.
Is there something else I should be looking for?

Any help, advice or tips would be much appreciated!

Bob Bell

Udo Munk

unread,
Dec 19, 2018, 6:18:59 PM12/19/18
to
On Wednesday, December 19, 2018 at 8:45:17 PM UTC+1, bbel...@gmail.com wrote:

> I have a copy of the source code for CCP3, and I assembled it with DR MAC. The assembler threw
> a bunch of Phase warnings that I am note sure are okay or not.

Also reading the source helps. The phase errors are intentional, so that one can make
sure ccp and loader modules match:

title 'CP/M 3 - Console Command Processor - November 1982'
; version 3.00 Nov 30 1982 - Doug Huskey


; Copyright (C) 1982
; Digital Research
; P.O. Box 579
; Pacific Grove, CA 93950

; Revised: John Elliott, 25-5-1998, to include DRI patches and multiple
; error checking ability:
;
; If the sequence
; COMMAND
; :C1
; :C2
;
; was executed under DRI's CCP, and COMMAND returned an error,
; then C1 would not be executed but C2 would. Under this CCP
; C2 would not be.
;
; ****************************************************
; ***** The following equates must be set to 100H ***
; ***** + the addresses specified in LOADER.PRN ***
; ***** ***
equ1 equ rsxstart ;does this adr match loader's?
equ2 equ fixchain ;does this adr match loader's?
equ3 equ fixchain1 ;does this adr match loader's?
equ4 equ fixchain2 ;does this adr match loader's?
equ5 equ rsx$chain ;does this adr match loader's?
equ6 equ reloc ;does this adr match loader's?
equ7 equ calcdest ;does this adr match loader's?
equ8 equ scbaddr ;does this adr match loader's?
equ9 equ banked ;does this adr match loader's?
equ10 equ rsxend ;does this adr match loader's?
equ11 equ ccporg ;does this adr match loader's?
equ12 equ ccpend ;This should be 0D80h
rsxstart equ 0100h
fixchain equ 01D0h
fixchain1 equ 01EBh
fixchain2 equ 01F0h
rsx$chain equ 0200h
reloc equ 02CAh
calcdest equ 030Fh
scbaddr equ 038Dh
banked equ 038Fh
rsxend equ 0394h
ccporg equ 040Ah ;[JCE] was 041Ah, but reduced
; to incorporate patches
; ****************************************************

> Then I tried to compare the assembled code in the PRN file to the CCP.COM file I am loading and
> trying to run. Ultimately, with a correct PRN file, I can Trace execution of CCP using ZSID and
> hopefully find out what it is doing to cause the looping I described above. However, the assembled
> code is not matching a dump of the CCP.COM file.

You are using a patched ccp.com but the unpatched source from DRI, comments in above
source sniped explain the difference.

> The very first instruction in the COM file is a JUMP to 040A. I'm sure the jump was put there as a
> result of the ORG statement in the source.

Of course the jump is put there by the loader in front of the ccp:

title 'CP/M 3 - PROGRAM LOADER RSX - November 1982'
; version 3.0b Nov 04 1982 - Kathy Strutynski
; version 3.0c Nov 23 1982 - Doug Huskey
; Dec 22 1982 - Bruce Skidmore
;
;
; copyright (c) 1982
; digital research
; box 579
; pacific grove, ca.
; 93950
;
****************************************************
***** The following values must be placed in ***
***** equates at the front of CCP3.ASM. ***
***** ***
***** Note: Due to placement at the front these ***
***** equates cause PHASE errors which can be ***
***** ignored. ***
equ1 equ rsxstart +0100h ;set this equate in the CCP
equ2 equ fixchain +0100h ;set this equate in the CCP
equ3 equ fixchain1+0100h ;set this equate in the CCP
equ4 equ fixchain2+0100h ;set this equate in the CCP
equ5 equ rsx$chain+0100h ;set this equate in the CCP
equ6 equ reloc +0100h ;set this equate in the CCP
equ7 equ calcdest +0100h ;set this equate in the CCP
equ8 equ scbaddr +0100h ;set this equate in the CCP
equ9 equ banked +0100h ;set this equate in the CCP
equ10 equ rsxend +0100h ;set this equate in the CCP
ccporg equ CCP ;set origin to this in CCP
patch equ patcharea+0100h ;LOADER patch area

CCP equ 40Ah ;ORIGIN OF CCP3.ASM

...
...
...

cseg
;
;
; ********* LOADER RSX HEADER ***********
;
rsxstart:
jmp ccp ;the ccp will move this loader to
db 0,0,0 ;high memory, these first 6 bytes
;will receive the serial number from
;the 6 bytes prior to the BDOS entry
;point
tojump:
jmp begin
next db 0c3h ;jump to next module
nextjmp dw 06
prevjmp dw 07
db 0 ;warm start flag
db 0 ;bank flag
db 'LOADER ' ;RSX name
db 0ffh ;end of RSX chain flag
db 0 ;reserved
db 0 ;patch version number


> Is it possible that there may be more than one version of CCP.COM for CPM3?

Of course.

bbel...@gmail.com

unread,
Dec 19, 2018, 9:45:25 PM12/19/18
to
Thank you, Udo for your help.
So if I understand correctly now, I should not be concerned with the phase errors.
I do not have the patched source code that you reference, with the line commented as "[JCE] was 041AH, but reduced to incorporate patches", so I had no way of knowing this was the reason for the 10H difference. Now that you have pointed it out, I see I need a newer/patched copy of the source and my suspicions that there are different versions is correct. So do you know where I can find the source for the patched version? Perhaps since you could paste a snip of it to the forum, you might have or know where I can get the John Elliot 1998 patched version that will match my current CCP.COM file?

Bob Bell

bbel...@gmail.com

unread,
Dec 19, 2018, 10:22:59 PM12/19/18
to
Udo, I found the CCP source file you are referring to on cpm.z80.de.

Bob Bell

0 new messages