This howto document describes how to read disks with non-standard low level formats using fdutils. It applies to disk which use different sector sizes, non standard densities, a different number of cylindrers (CP/M disks, Commodore disks). It does not apply to disks which merely have a different filesystem (high level format).
The most useful program for exploring disks is
First, you need to find out the data transfer rate (roughly the density: high, double, single).
For this, you try out fdrawcmd readid 0
rate=x
, where x is 0, 1, 2, 3 If no rate is
supplied, rate=0
|
The first 3 output bytes are error codes. The first byte should be below 7 (i.e. the example above succeeded). The last four bytes is a sector header. Byte 3 is the cylinder (here: 0), byte 4 is the head (here: 0). Byte 5 is the sector number (here: 1) of the sector which happened to be near the R/W head when the command was issued. Byte 6 is the sector size code. Size code 0 means 128 bytes per sector, size code 1 means 256 bytes per sector, size code 2 means 512 bytes per sector, etc (i.e. size doubles with each increment).
So, you try out all 4 rates until you get one that succeeds (byte 0 <= 7). If none matches, try adding the FM keyword (to use FM coding instead of MFM).Example:
|
If none of the eight combinations (4 rates with fm, 4 rates without fm) doesn't work, then the disk probably is not readable on PC hardware. Remember: the controller plays a role that is as important, if not more, than the drive. So the fact that a device uses a normal PC drive is not necessarily indicative that disks written by that device can be read on a PC.
On the other hand, if one combination matches, we have some good chance to get at the contents of that disk. Use the same fm/rate combination with all fdrawcmd's shown below.
|
|
For this, seek to physical cylinder 2, and do again a readid.
|
Carefully watch byte 3 (logical cylinder). If this is 1, then we have a disk with only one logical track per two physical tracks. This is for instance the case with double density 5 1/4 disks. If on the other hand byte 3 is 2, then we have a normal disk, where one logical track corresponds exactly to one physical track. Let's call this a disk with doublespaced tracks.
Again, if byte 0 is greater than 7, we have an error. A different density might be used on track 2 and it might be worthwhile to try out all 8 rate/fm combinations.
Same exercise with the number of cylinders. Seek to track 81, 80, 79, 78, 77 until you can read the track. Use the rate/fm combination from track 2: no nead to try out all 8 combinations here, it is very rare that density changes again after the first track. N.B. If you have a disk with double spaced tracks, try only the even numbers:
|
For the next step, we have to determine the sector numbering scheme. Calling fdrawcmd several times in a row gives a good sampling of the sectors which can occur on a track. You can also attempt reading particular sectors if you want to probe for their existence:
|
The next 4 parameters are the sector header of the sector to be read, just as in the last 4 return bytes of the readid command
|
This command attempts to read 10240 bytes starting at sector 1/0/2/2 (track 1, head 0, number 2, size 512) on physical track 1, and physical head 0.
The system returns an error, and says 1024 bytes remain to be read (remainging=). This means that there are 18 sectors on that track (20 - 2).
Remember: on disks with doublespaced tracks, the physical cylinder has to be the double of the logical cylinder.
It might also be interesting to probe for sector 0.
Some CP/M systems have highly unusual numbering conventions, so don't
be discouraged if you see them:
If the disk is not too unusal, you can configure your finding into the floppy driver using setfdprm, and can then use dd or cat to read the disk.
Example:
|
If the format is unusual enough, you unfortunately have to read the disk track by track using the above-mentioned fdrawcmd commands.
Once you have access to the disk, you can read the
raw data from your disk. You do not yet have access to the individual
files. For this, you need a filesystem-level utility, such as
Cmptools needs the
|
You can still compile the tools by replacing the following line in the Makefile:
|
|
With the cpmtools, you can either work directly on
the floppy disk (for thos formats where an image is available), or
first extract the image, and then work on that image. The examples
below show how to use cpmtools to work directly on the floppy disk.
|
|