:mad: FLOPPIES :mad:

Started by hydrophilic, May 15, 2007, 01:11 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

hydrophilic

* long post *

I've been happily (although slowly) transferring files from C128 to my PC with a 1571 and a program I wrote for writing FAT12 filesystem.  As far as I knew my 1571 was just fine, but then when I wanted to create a work disk for developement on my C128 (instead of VICE on my PC), I couldn't do a native format! :förbannad:

I'm still puzzled since I can format in MFM just fine, and my PC can read it.  My PC can write to the disk and then my 1571 can read it.  My 1571 can read old 1541 disks in GCR format too.  But when I try to format in native GCR mode, I always get the
?BAD DISK ERROR

This happens in either 1571 or 1541 mode.

I cleaned the disk heads and used the best disk I can find (its not new but looks good, I tried the few unused ones I have from my old collection).  I don't have a frequency counter or strobe light to check the disk speed but I wrote a program to test it.  Naturally the value varies a little -- it generally reports between 300.75 and 300.95 rpm (about 5.016Hz) which is very close to standard (assuming my program is reliable!)

I haven't checked the ROM to see how MFM formatting is handled, but I know how the GCR formatting is done.  Basically it sets an error count-down to some fairly high number like 200 and each error it gets reduces until zero and then failure.

In my opinion that's part of the problem.  Imagine it encounters several errors on the first few tracks (but it manages to fix them and then continues), and the rest of the disk is fine until it gets to the last track and then one little glitch and the whole thing aborts!

I thought about using one of those 9-second format programs because I remember the ones I used (back in the day) just send the data to the disk and then move to the next track without ANY verification.  Not something I want.

So I wrote a program from scratch (well parts of it are from my memory of one of those fast-formats) that WILL format your disk if it is possible.  Basically it wipes the entire track with $FFs (this produce the highest frequency and should help erase anything) then wipes the track with $55 (CBM standard for intersector gaps), and then writes out the track.  Finally it uses standard ROM routines to be sure it can read each sector on the track without error.  If any sector fails, it completely starts over on that track.  It will do this up to 10 times on each track.

If a track can't be formated after 10 attempts, it simply keeps going with the remaining tracks.  A report is generated of which tracks were successfully created.

Well I ran this program and it formated the disk I'd been trying (without luck before) on the first try and the report showed all tracks formatted OK.  Indeed I can read and write to it.  I'm so happy, but exhausted.

Oh yeah, all this occurs inside the drive so there is no serial bus slowdown.

Although it may not be reliable for long term use (who would store valuable data on a floppy anyway?), it is great for creating work disks.  Especially important since I can't go to Wal-Mart or Circuit City and buy 5.25 disks!!  Oh I can get some, eventually...  I'm curious if any other drive can read it. :)

Anyway, just wondering if anybody had ideas or comments about the Commodore GCR format as opposed to the MFM format.  I still don't see why MFM is fine but GCR kept giving me errors...

And if anybody is interested in the program I can clean it up (needs seperate program to transfer code to drive and later write BAM/Dir) and post it somewhere.  Surely its been done before but it's been an educational (if long and frustrating) experience.

Edit  Fixed some typos.  Silly me, hit submit instead of preview :rodna: