I’m interested in writing third party images to physical floppy disks for use in the MicroVAX. Images available via the net are often used with simh eg
They often have an extension of DSK, but there are some others. On the face of it these images contain the raw sector data.
In my naivety, i thought that i would be able to take these images and write them with greaseweazle in much the same way as i had read the disks that came with the machine.
# Example custom.cfg
disk RX50
cyls = 80
heads = 1
tracks * ibm.mfm
secs = 10
bps = 512
interleave = 1
rate = 250
rpm = 300
end
end
gw write --diskdefs=custom.cfg --format=rx50 <file>.img
I attempted this and achieved an epic fail. The MicroVAX could not make sense of them. Sometimes it recognised the label, other times it recognised an unexpected label, but it could never find its “home block”.
I was able to “initialise” these disks though, and it was interesting to read these back and compare the resulting IMG file with the original.
The first track ie the first 10x512byte sectors are the same. It is as-if the MicroVAX ignored the first track when it initialised the disk. The original label remains on this track.
Once the disk is re-initialised, the MicroVAX sees the new label which is on the second track. This gives the impression that there is a search order ie it looks for a label on the second track and then, if it does not find one, it tries the first track and perhaps all tracks. It gives the appearance of searching the whoe disk.
Is it possible that the track zero sensor is out by a track? If there is a problem then the disks that came with the unit must have been written with that fault because they all work.
Or is there some track numbering magic going on eg 0 to 79 vs 1 to 80?
This post on VCF provides some insight (and solutions):
The first track is only used by the DEC Rainbow – a CP/M machine that also uses the RX50 floppy disk drive. It also says that images used with simh have the first track moved to the end of the image. Important info.
This is not the only difference though. The position of the sector that holds the root directory on the original image is in the third sector of the first track whereas the disk formatted in the MicroVAX has this directory in the sixth sector of the third track. This hints that the downloaded files may have the sectors in a logical order. Several sources state that the disk controller uses an interleave of 2. Just changing the interleave to 2 when creating the img does not resolve the problem.
But the above post does contain a solution in the form of two python scripts that handle the conversions between a raw image and the images used by simh. Inspection of them reveals some detail regarding the interleave.
I would never have worked out the rotation. Bravo to shirsch for solving it and coding the translators!
Depending on direction of conversion:
skewtab = [8, 0, 2, 4, 6, 9, 1, 3, 5, 7]
skewtab = [1, 6, 2, 7, 3, 8, 4, 9, 0, 5]
So we have two different image/binary formats.
The first represents the sectors in the order in which they are occur on the disk surface. The first track is unused. I am using the IMG extension for these files.
The second has the unused first physical track moved to the end of the file, and the sectors in logical order. I will use the DSK extension for disk images simh files which is the opposite of the author’s assumption so:
dsk2img.py --input-file file.img --output-file file.dsk
img2dsk.py --input-file file.dsk --output-file file.img
Using these scripts, i have been able to move floppy disk images easily between the simh and physical environments.
The IMG files can be read from, and written to, disk by greaseweazle using the definitions near the top of this page.
I haven’t found a way to move files in and out of images. There are some programs that appear to do this, but they may not support the Files-11 Structure Level 2 that is used by the MicroVAX. If the available tools support file extraction (and i’m thinking of cpmtools for the DEC rainbow) they may not support directories, for example. I would have to give it a whirl.