Identifying floppy disk images

Anything QL Software or Programming Related.
Post Reply
Martin_Head
Aurora
Posts: 847
Joined: Tue Dec 17, 2013 1:17 pm

Identifying floppy disk images

Post by Martin_Head »

I've noticed a problem in my Floppy Disk Image file driver (FDI2). In that it does not like the images of disks that were not formatted to their full capacity.

I need to rewrite the routine that determines the density of the original disk (DD/HD etc), and the sector length.

To determine them, I think I need to make some assumptions about the original disks.

1.. Is it safe for me to assume that all QL floppy disks will have a sector size of 512 bytes, except for ED disks which are 2048 bytes?

2.. Is it safe for me to assume that all HD, QL floppy disks will have 18 sectors per track, and all ED disks have 10 have sectors per track?

I am only interested in QL floppy disks that have the QL5A/B format ID.

There only seems to be a command in the Trump/Gold cards for setting the number of tracks, So I am hoping that sector sizes and sectors per track are effectively fixed.

Thanks in advance

Martin Head


RWAP
RWAP Master
Posts: 2834
Joined: Sun Nov 28, 2010 4:51 pm
Location: Stone, United Kingdom
Contact:

Re: Identifying floppy disk images

Post by RWAP »

So far as I know all floppy disks use 512 sectors except for the ED floppies, as you say.

However, the number of tracks cannot be assumed - there have been several utilities to change this either to squeeze extra data onto a DD disk, or to reduce the number of tracks and make disk copying quicker (Tony Firshman still uses this for Minerva and Hermes support disks).


User avatar
NormanDunbar
Forum Moderator
Posts: 2251
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: Identifying floppy disk images

Post by NormanDunbar »

Evening Martin,

http://qdosmsq.dunbar-it.co.uk/doku.php ... sq:fs:dsdd is a page on my qdos smsq wiki that describes the floppy disc format. You can extract the number of sectors from the header and that should always be correct.

You also get the number of sides and so on from a few calculations and from reading the logical to physical table, where a logical sector > 127 is on side 1 else on side zero.


Hth

Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
Martin_Head
Aurora
Posts: 847
Joined: Tue Dec 17, 2013 1:17 pm

Re: Identifying floppy disk images

Post by Martin_Head »

Thanks for the responses
RWAP wrote:However, the number of tracks cannot be assumed - there have been several utilities to change this either to squeeze extra data onto a DD disk, or to reduce the number of tracks and make disk copying quicker (Tony Firshman still uses this for Minerva and Hermes support disks).
NormanDunbar wrote:You can extract the number of sectors from the header and that should always be correct.
This is what is screwing up the current version of my driver, where the program that created the image file from the disk creates a full sized image file, even if it has a reduced number of tracks.

What the driver currently does, is divide the size of the image file, by the total number of sectors. To get the sector size, and compares it with a table of known sizes. 128, 256, 512, 1024, 2048

It then compares the total sectors, with a table of total sector values 720, 1440, 2880, 1600. To get the disk density.

You see I must have assumed that all the disks would be fully formatted before the images were taken. And I don't want to fall back into that hole again, if some disks might have strange sector sizes, or numbers of sectors per track.

Martin


User avatar
janbredenbeek
Super Gold Card
Posts: 629
Joined: Wed Jan 21, 2015 4:54 pm
Location: Hilversum, The Netherlands

Re: Identifying floppy disk images

Post by janbredenbeek »

I would be very interested in a virtual FLP-driver that can handle ED diskette images. I have about a dozen of them and since they are some 25 years old now (including the hardware needed to read them) preservation of the contents becomes urgent. I've managed to copy an image of one diskette onto several smaller diskettes on the QL, then re-assembled the sections together on the PC to get a 3.2MB image file. However it appears that the FLP_DRIVE command on QPC2 doesn't work with ED images :(
UPDATE: Of course I should have looked first before asking the question - I've found your FDI2 driver on Dilwyn's site. This appears to be a well-written package. Now I first want to get some sleep ;)

Jan.


Post Reply