Close

Building a CP/M System Disk

A project log for My CP/M Single Board Computer

A simple computer based on the CP/M OS and flash chips for disk drives

agp.cooperagp.cooper 10/20/2019 at 01:060 Comments

Building a CP/M System Disk

To avoid rewriting the assembler codes for ccp, bdos and cbios so that they can co-exist in the same file. I can append the i8hex files and remove the "end of file markers".

To make the hex file more readable I have changed the FSM (finite state machine) to be tolerant of illegal characters (so I can include comment lines). Just don't use ":" in any comments.

The emulator already has code to move an image directly to disk. Just call the hex file "system.hex" and later "Disk0.hex". I just need to shift all code except the boot code down from 0x6000 into the system area of the disk.

Successful boot (from disk using boot strap) but it still hangs on "E:". Need to find out why?

Bdos Err On E: Select

Well I tried two or three different ccp.asm files and no luck. Checked out the SIMH/AltairZ80 and same problem. Then I realised the source of the problem is in bdos.asm not ccp.asm! According to the manual, the error should wait for input (enter) before rebooting. I was also wondering why the copyright notice does not show?

As for as the Select error, a reboots need to reset the user/disk ids at 0x0004. So I ANDed the value with 0xf3 to limit the disk range to 0-3. I did not want to change the user id or disk id unnecessarily.

Next is to consider what I can fit on a 32k Flash Drive? Well not much! A change of track, I am writing a program to make a disk image (including directory structures and files) that I can upload to my Flash programmer. It will read program i8hex files one after another and save then to a disk image.

Update

Wrote some code to covert CPM-80 COM files into I8HEX files. Got the "makeDisk" code working to build the system, directory and normal files. The code needs a tidy up but otherwise it works. I have only set the directory UserCode to "0xE5" (means unused) rather than write "0xE5" to the whole disk (saves writing to the whole Flash ROM). Here is an example of a run proving it works:

my CP/M EMU Console (AlanCooper@StartMail.com)


my CP/M 2.2 (32k)

A>DIR
A: STAT     COM : PIP      COM
A>STAT
A: R/W, Space: 9k


A>B: 
B>A:STAT
A: R/W, Space: 9k
B: R/W, Space: 23k


B>A:
A>PIP B:=STAT.COM

A>B:
B>DIR
B: STAT     COM
B>A:
A>

So I am set to assemble the PCB and test it for real.

I have been playing around with the myCPM with mixed success. While some thins works, others (particularly exiting a program don't):

my CP/M EMU Console (AlanCooper@StartMail.com)


my CP/M 2.2 (32k)

A>STAT
A: R/W, Space: 10k


A>B:
B>STAT
STAT?

B>A:STAT
A: R/W, Space: 10k
B: R/W, Space: 8k


B>DIR
B: ASM      COM : DDT      COM : LOAD     COM
B>DDT
DDT VERS 2.2
-D
0100 01 BC 0F C3 3D 01 43 4F 50 59 52 49 47 48 54 20 ....=.COPYRIGHT 
0110 28 43 29 20 31 39 38 30 2C 20 44 49 47 49 54 41 (C) 1980, DIGITA
0120 4C 20 52 45 53 45 41 52 43 48 20 20 20 20 20 20 L RESEARCH      
0130 44 44 54 20 56 45 52 53 20 32 2E 32 24 31 00 02 DDT VERS 2.2$1..
0140 C5 C5 11 30 01 0E 09 CD 05 00 C1 21 07 00 7E 3D ...0.......!..~=
0150 90 57 1E 00 D5 21 00 02 78 B1 CA 65 01 0B 7E 12 .W...!..x..e..~.
0160 13 23 C3 58 01 D1 C1 E5 62 78 B1 CA 87 01 0B 7B .#.X....bx.....{
0170 E6 07 C2 7A 01 E3 7E 23 E3 6F 7D 17 6F D2 83 01 ...z..~#.o}.o...
0180 1A 84 12 13 C3 69 01 D1 2E 00 E9 0E 10 CD 05 00 .....i..........
0190 32 5F 1E C9 21 66 1E 70 2B 71 2A 65 1E EB 0E 11 2_..!f.p+q*e....
01A0 CD 05 00 32 5F 1E C9 11 00 00 0E 12 CD 05 00 32 ...2_..........2
01B0 5F 1E C9 21 68 1E 70 2B 71 2A 67 1E EB 0E 13 CD _..!h.p+q*g.....
-

Yes Okay but G0 or ^C crashes. It does not seem that DDT has overwritten CBIOS etc.
Anyway, I should move on and come back to this if it happens on real hardware.

AlanX 

Discussions