CDOS Ver 0.20 on 8 inch disks

CDOS Ver 0.20 is available on the internet for systems with small (5″) floppy disks. However, 5″ systems are painfully small. STAT.COM will tell you a 5″ disk holds 83KB but that includes 2KB of directory entries, I have always thought of them as 81KB disks.

There’s not a lot you can fit in 81KB so I’d standardized on 8″ single-sided, single-density disks for everything – other than CDOS Ver 0.20. 8SSSD was the universally agreed format for interchangeability between CP/M systems at the time so it’s a good one to pick for emulators of computers of that time.

CDOS came on 8″ disks or 5″ disks. Later versions included CDOSGEN.COM which allowed you to reconfigure the operating system to work with different amounts of installed memory and different drive configurations. My guess is, Ver 0.20 preceded CDOSGEN. There doesn’t seem to be a way to reconfigure what you have for different systems. However, …

If you use DEBUG.COM (the Cromemco CDOS version of CP/M’s DDT.COM or ZSID.COM) to explore what CDOS ver 0.20 is doing during disk accesses, you’ll eventually find mention of FFF8. The sequence looks like:

CROMEMCO CDOS version 00.20

A.debug
DEBUG version 00.20
-l0
0000  JP   FC00
...
-lfc00
FC00  JP   F1EE
FC03  JP   FC51
FC06  JP   FC59
FC09  JP   FC6E
FC0C  JP   FCA1
FC0F  JP   FCC1
FC12  JP   FCCC
FC15  JP   FCD5
FC18  JP   FCF1
FC1B  JP   FCF6
FC1E  JP   FCFB
FC21  JP   FD00
FC24  JP   FD05
FC27  JP   FD39 ; goes to ...
FC2A  JP   F1EE
FC2D  JP   FCB9
-lfd39
FD39  CALL FD78
FD3C  RET  NZ
FD3D  CALL FDE8 ; goes to ...
FD40  ...
-lfde8
FDE8  LD   A,80
FDEA  CALL FDF4 ; goes to ...
FDED  ...
-lfdf4
FDF4  LD   C,A      ; C=80 for autowait, else 00
FDF5  LD   A,(FE69)
FDF8  LD   B,A      ; A=0-3 for Drive A-D
FDF9  INC  B
FDFA  SUB  A,A    ;\
FDFB  SCF         ; \
FDFC  RLA         ;  \
FDFD  DJNZ FDFC   ;   \ set drive bit B=1-4 => 0001, 0010, 0100, 1000
FDFF  LD   B,A
FE00  CALL FE0B
FE03  LD   A,(HL) ; get drive params 1
FE04  AND  A,10   ; set maxi bit if 8"
FE06  OR   A,20   ; motor on
FE08  OR   A,B    ; add in drive
FE09  OR   A,C    ; add in autowait
FE0A  RET
;
FE0B  LD   A,(FE69) ; drive 0-3 for A-D
FE0E  ADD  A,A      ; *=2
FE0F  LD   HL,FFF8  ; looks like FFF8 is drive size table
FE12  ADD  A,L
FE13  LD   L,A
FE14  RET  NC
FE15  INC  H
FE16  RET
;
-dmfff8s8
FFF8   28 09 28 00  28 00 28 00   (.(.(.(.
-


CDOS is getting a byte from a table at FFF8H and using bit 4 of that (FE04: AND A,10) to turn on the floppy disk controller’s MAXI bit (8″ disk instead of 5″ disk).

It should be more complicated than this; but it doesn’t seem to be.

Normally, we then go through all the trouble of noting that 5″ drives have 40 tracks and 18 sectors per track and a skew table of … but 8″ ones have …. However, it looks like CDOS handles all of that from this single bit. I know that’s how it is supposed to work in an ideal world; but it is rare to see that in the real world.

FFF8 is pretty high in memory so there’s a chance this gets initialized by some startup code. However, after looking, it’s just loaded from disk during bootup. Here’s how it looks:

-g0

A.wrtsys a:sysarea.sys=a:
WRTSYS version 00.09
System written and verified
A.dump sysarea.sys
DUMP version 00.05

        RECORD:  0
0000 3E 01 D3 40 3E 21 D3 34-21 00 EA 11 02 2C 3E 0F  >.S@>!S4!.j..,>.
0010 D3 30 DB 34 1F 30 FB DB-30 E6 98 20 E3 7B D3 32  S0[4.0{[0f. c{S2
0020 01 33 80 3E A1 D3 34 3E-88 D3 30 DB 34 1F 38 0A  .3.>!S4>.S0[4.8.
0030 ED A2 C2 AB 00 DB 34 1F-30 FB DB 30 E6 9C 20 C0  m"B+.[4.0{[0f. @
0040 15 CA 09 EA 1C 7B FE 13-38 D3 1E 01 3E 5F 18 C0  .J.j.{~.8S..>_.@
0050 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  ................
0060 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  ................
0070 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  ................

...
        RECORD:  44
1600 1B 19 5E C9 01 07 0D 13-19 05 0B 11 17 03 09 0F  ..^I............
1610 15 02 08 0E 14 1A 06 0C-12 18 04 0A 10 16 01 06  ................
1620 0B 10 03 08 0D 12 05 0A-0F 02 07 0C 11 04 09 0E  ................
1630 CD 22 FE CD 06 FC FE 03-CA 00 FC E6 5F FE 52 28  M"~M.|~.J.|f_~R(
1640 03 3E 01 C9 2A 84 FE E5-CD D5 FC E1 22 84 FE A7  .>.I*.~eMU|a".~'
1650 20 DE C9 00 00 09 AD 66-C0 80 88 AD 66 C0 C0 BD   ^I...-f@..-f@@=
1660 AD 66 00 CD F1 66 CD 7F-67 C3 F9 66 CD 7A 67 C3  -f.MqfM.gCyfMzgC
1670 F9 66 C9 FD 7E 00 E6 38-28 00 28 00 28 00 28 00  yfI}~.f8(.(.(.(.

...
A.


You can see the boot sector, and then the 4 entries of “28 00” at the end of “RECORD 44”.

Making changes

It shouldn’t be this easy but it is.

You need to change those four 28H bytes to 38H for a four by 8″ drive system.

Alright, it does need to be bootable too, so you do need to modify the boot sector to also work with an 8″ drive. This involves:

  • There are two “OUT (34),A” instructions in the boot sector that need the MAXI bit turned on in the “LD A,…” instruction that precedes them, and
  • A “LD A,E; CP 13H; JR C,…” sequence that checks for <=18 sectors per track needs to be changed to “CP 1BH” for <=26 sectors per track.

    Download a copy

    I’ve changed the four bytes and updated the boot sector for you. You can download a fully functional 8″ CDOS Ver 0.20 system from run-cdos0020-2.zip.

    You can use INIT.COM to create disks in drives B, C and/or D. You can use STAT.COM to check disk sizes. Everything seems to work as an 8″ system.

    Conclusions

    My guess is Cromemco wanted to make it easy for themselves to reconfigure. It’s nice that we can too.

    There are other bits in the “28H” byte. They probably serve some purpose but I haven’t found out what yet. They might control seek speeds or other aspects of the drive. Leaving them alone worked fine in my case.

    It is likely that the second byte (after the 28H – or 38H on 8″ systems) stores the current track number for each drive.

    It's only fair to share...Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedInShare on StumbleUponDigg thisPin on PinterestEmail this to someone

Leave a Reply

Your email address will not be published. Required fields are marked *