[micro.cpm] CP/M Disk Formats

mjg@ecsvax.UUCP (01/12/84)

Help wanted on compiling CPM disk format data !
-----------------------------------------------

This is a follow up to my last follow up requesting help on
compiling a data base of cp/m disk formats. Because of the minimal
of response I wonder just how many CP/M users really KNOW what
their own disk format is. I am still trying to compile information
and have got quite a lot from other sources. So far I am up to
about 30 formats and am willing to share this with anyone who can
make a positive contribution.

I need information in one of the following forms:

1) A freshly formatted disk with a single reasonably sized text
   file on it. The file must be large enough to span at least 2
   tracks. This is sufficient to extract all the parameters below.
   After analyzing I will return the original untarnished!.

2) The alternative, if you can provide it is to provide me with
   the following data:

Computer Make and Model No.
Disk Size, 5 or 8 (or 3 1/4 or 3 1/2!) inch
Is the format one or two side
Single or Double Density?
No of tracks, e.g. 35,40,77,80 etc.
Sector Size in Bytes.
Physical sector sequence on the disk. This is needed for
    optimum formatting. 8 inch SS,SD for instance has the
    sectors numbered 1,2,3,4,5........26.
Sector translate table. This tells the bios when you ask
    for a given sector number what actual sector to give.
    8 inch SS,SD has a table that starts 1,7,13,.....
Directory offset. This tells CPM what track the directory is on.
Directory size in sectors, bytes and number of files.
Sectors per track.

Some of the above information is contained in a standard CP/M
DPB table in your BIOS in the following format, ( I will give the
numbers for standard SS,SD 8 inch as an example):

SPT 1A00  (no of equivalent 128 byte sectors/track)
BSH 03    (Block Shift = Log base 2 of block size in sectors)
BLM 07    (Block mask = no of 128 bytes in block - 1)
EXM 00    (Extent mask, relates disk size and block size)
DSM F200  (Highest block number on disk - 1 )
DRM 3F00  (No of entries in directory -1 )
ALO C000  (Each bit set in ALO represents 1 block in the directory)
CKS 1000  (No of 128 byte sectors in directory )
OFF 0200  (Directory offset in tracks)

>From the above the block size is 8 128 byte sectors or 1k, the directory
2 and occupies 16 sectors or 2 blocks with 64 entries max.
Note that 2 byte values are expressed least significant byte first.

If you dont know how to determine the parameters of your cpm
format here is a simple way using DDT or SID:

Run DDT or SID and enter the following:

         DDT                      SID
A100                       A100
100  MVI C,1F              100   LD  C,1F
102  CALL 5                102   CALL 5
105  RST 7                 105   RST 38

then type a period (.) to get out of the Assembler mode. What
you have just done is create a small CPM program which will
use your CP/M to find its own DPB (device parameter block). Run
the program by typing G100 and display the CPU registers by
typing X. The address of the DPB is in the HL register pair.
Type D and the address to display the contents of memory starting
at the beginning of the DPB and read off the first 15 bytes which
is the DPB for the currently selected drive.


Please reply to me here at ecsvax!mjg by computer mail, or
Mike Gingell, PO Box 51155, Raleigh, NC 27609 or by phone (out of
work hours 919-847-4779).

Regards to all CPM users out there wherever you are,

               Mike Gingell,
                   PO Box 51155
                      Raleigh NC 27609

                       ....ecsvax!mjg