davidgiven / fluxengine

PSOC5 floppy disk imaging interface
MIT License
357 stars 69 forks source link

Reading 3.5" HD IBM disk -> 2640 kb total / 33 sectors detected #106

Open hpingel opened 5 years ago

hpingel commented 5 years ago

Hi,

I was testing imaging a disk using fluxengine read ibm.

I have a feeling that the disk was detected to be of a higher density (ED?) than it really is. Maybe I am just mistaken. I expected an image size of 1.440 KB. SVG shows 20 sectors but summary says 33 sectors.

The candidate (it is pretty difficult to take a decent close-up photo of a floppy disk): IMG_20190908_200032-1200x1600

Console output:

Autodetecting output geometry
H.SS Tracks --->
0. 0 ................................................................................
0. 1 ........................................X.......................................
0. 2 ................................................................................
0. 3 ................................................................................
0. 4 ................................................................................
0. 5 ................................................................................
0. 6 ................................................................................
0. 7 ................................................................................
0. 8 ................................................................................
0. 9 ................................................................................
0.10 ................................................................................
0.11 ................................................................................
0.12 ................................................................................
0.13 ................................................................................
0.14 ................................................................................
0.15 ................................................................................
0.16 ................................................................................
0.17 ................................................................................
0.18 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0.19 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0.20 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0.21 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0.22 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0.23 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0.24 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0.25 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0.26 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0.27 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0.28 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0.29 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0.30 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0.31 ................................................................................
0.32 ................................................................................
1. 0 ................................................................................
1. 1 ................................................................................
1. 2 ................................................................................
1. 3 ................................................................................
1. 4 ................................................................................
1. 5 ................................................................................
1. 6 ................................................................................
1. 7 ................................................................................
1. 8 ................................................................................
1. 9 ................................................................................
1.10 ................................................................................
1.11 ................................................................................
1.12 ................................................................................
1.13 ................................................................................
1.14 ................................................................................
1.15 ................................................................................
1.16 ................................................................................
1.17 ................................................................................
1.18 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1.19 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1.20 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1.21 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1.22 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1.23 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1.24 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1.25 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1.26 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1.27 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1.28 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1.29 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1.30 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1.31 ................................................................................
1.32 ................................................................................
Good sectors: 3199/5280 (60%)
Missing sectors: 2081/5280 (39%)
Bad sectors: 0/5280 (0%)
writing 80 tracks, 2 heads, 33 sectors, 512 bytes per sector, 2640 kB total

SVG and Flux: promise0908 promise0908.svg.txt promise.flux.rename.txt

davidgiven commented 5 years ago

I think they've tried to copy protect this disk. The total size is garbage because FluxEngine thinks there are 33 sectors per track, because of the presence of sectors 31 and 32.

I'm not sure there's a way around this without very easy but completely specific-to-this-format code in the IBM decoder (for mapping sectors 31 and 32 to 18 and 19) --- it's a couple of lines of code in arch/ibm/decoder.cc.

This is actually a 1638kB extended format disk, by the way.

hpingel commented 5 years ago

I am surprised that a copy protection is causing this - I never even thought about copy protection on a driver disk. This leaves me a bit embarassed as I was just going through my very small box of my old 3,5" PC disks just to throw anything at FluxEngine to see what would happen. I don't really have a need to create an image of this driver disk. It does not contain the unpublished novel I wanted to rescue (after never writing it in the first place). So this leaves me with the following question:

Should I restrict my usage of FluxEngine to those personal disks that really matter to me - these will probably work flawlessly with FluxEngine as they are standard HD disks.

Or does it make any sense to bother you with this kind of irregular stuff at all - just for learning about what people did back in the 80s and 90s when they created disks commercially. Is there any value in this kind of knowledge today?

I know that reacting to copy protection is not in the scope of this project.

davidgiven commented 5 years ago

In this case, the 'copy protection' looks like it just has two mislabelled sectors in each track. I bet that the software checks that those sectors exist. The DOS filesystem code probably won't try to access them; I bet that FAT is set up for a disk with sectors 0..19, with 18 and 19 marked as bad (as they don't exist).

FluxEngine will read these absolutely fine --- there's no technical reason why they wouldn't work. The only issue is that they're complicated.

For this particular disk, you may be able to get a usable image with -o out.img:s=0-19, which will tell it to write sectors 0 to 19 only; sectors 31 and 32 will be discarded and the missing 18 and 19 will be replaced with zeroes. Of course, if this is copy protection then the code which checks for the non-standard disk format may fail. You might also have good luck with LDBS format which is better at representing non-standard formats.