Trouble decoding BBC Micro disks

All questions about how to use KryoFlux go here.
Post Reply
thomastc
Posts: 4
Joined: Mon Feb 02, 2015 8:39 pm

Trouble decoding BBC Micro disks

Post by thomastc » Thu Feb 12, 2015 7:16 pm

I recently bought a KryoFlux and a second-hand Chinon FZ-506 disk drive to salvage my old programs from BBC Microcomputer 5.25" disks. I am a bit of a software tinkerer, but not much of a hardware/electronics hero, and I haven't done anything like this before, but I have read all the manuals, some relevant forum topics and some Wikipedia pages :)

Most of these disks were written on a Model B with the DFS filesystem (i.e. FM). Some might be ADFS (MFM) and/or might have been written on a Master. My actual Model B died on me, but before it did, it was able to read at least some of these disks correctly.

I got the KryoFlux to talk to the drive and emit data, and I think I also have the right set of flags to create an image. To read a forensic dump, I use:

Code: Select all

dtc -ftest -i0
Opening the forensic dump in the GUI, I can see spikes in the histogram at 4 and 8 µs, except for tracks 80-83 which just contain noise. So these are 80-track disks. Since there's nothing confidential on this test disk (just some 30-odd-year-old English literature exams) I have uploaded a zip file with the full forensic dump here.

Then, to turn that into an FM image, I use:

Code: Select all

dtc -l255 -m1 -ftest -i0 -z1 -fout -i3
The -z1 is needed because this disk format apparently uses 256-byte sectors. -i3 is for FM format, because I see only two peaks in the spectrum; MFM would have three.

The problem is that I don't get properly decoded data. The log (just the FM lines) look something like this:

Code: Select all

00.0    : FM: <error>, trk: 000, sec: 10, bad: 10, *H +6
00.1    : FM: <error>, trk: 000, sec: 3, bad: 2, mis: 1, *HS
01.0    : FM: <error>, trk: 001, sec: 8, bad: 6, mis: 2, *H +4
01.1    : FM: <error>, trk: 001, sec: 8, bad: 4, mis: 4, *HS +4
02.0    : FM: <error>, trk: 002, sec: 8, bad: 7, mis: 1, *H
02.1    : FM: <error>, trk: 002, sec: 9, bad: 5, mis: 4, *HS +5
03.0    : FM: <error>, trk: 003, sec: 10, bad: 9, mis: 1, *H
03.1    : FM: <error>, trk: 003, sec: 10, bad: 2, mis: 8, *XHS +2
04.0    : FM: <error>, trk: 004, sec: 10, bad: 7, mis: 2, *H
04.1    : FM: <error>, trk: 004, sec: 6, bad: 3, mis: 3, *HS
...
13.1    : FM: <error>, trk: 013, sec: 10, bad: 10, *HS +1
14.0    : FM: <error>, trk: 014, sec: 10, bad: 2, *H
14.1    : FM: <error>, trk: 014, sec: 10, bad: 10, *HS +3
15.0    : FM: <error>, trk: 015, sec: 10, bad: 1, *H
15.1    : FM: <error>, trk: 015, sec: 10, bad: 6, *HS +1
16.0    : FM: OK*, trk: 016, sec: 10, *H
16.1    : FM: <error>, trk: 016, sec: 10, bad: 5, *HS
17.0    : FM: OK*, trk: 017, sec: 10, *H
17.1    : FM: <error>, trk: 017, sec: 10, bad: 3, *HS
18.0    : FM: OK*, trk: 018, sec: 10, *H
18.1    : FM: <error>, trk: 018, sec: 10, bad: 1, *HS
19.0    : FM: OK*, trk: 019, sec: 10, *H
19.1    : FM: <error>, trk: 019, sec: 10, bad: 2, *HS
20.0    : FM: OK*, trk: 020, sec: 10, *H
20.1    : FM: <error>, trk: 020, sec: 10, bad: 3, *HS
21.0    : FM: OK*, trk: 021, sec: 10, *H
21.1    : FM: OK*, trk: 021, sec: 10, *HS
22.0    : FM: OK*, trk: 022, sec: 10, *H
22.1    : FM: OK*, trk: 022, sec: 10, *HS
...
76.0    : FM: OK*, trk: 076, sec: 10, *H
76.1    : FM: OK*, trk: 076, sec: 10, *HS
77.0    : FM: OK*, trk: 077, sec: 10, *H
77.1    : FM: OK*, trk: 077, sec: 10, *HS
78.0    : FM: <error>, trk: 078, sec: 10, bad: 1, *H
78.1    : FM: OK*, trk: 078, sec: 10, *HS
79.0    : FM: <error>, trk: 079, sec: 10, bad: 2, *XH
79.1    : FM: OK*, trk: 079, sec: 10, *HS
80.0    : FM: <unformatted>
80.1    : FM: <unformatted>
81.0    : FM: <unformatted>
81.1    : FM: <unformatted>
82.0    : FM: <unformatted>
82.1    : FM: <unformatted>
83.0    : FM: <unformatted>
83.1    : FM: <unformatted>
The full log is in this pastebin.

From this, I gather that the data is OK near the end of the disk, but corrupted in the first 20 tracks or so. It's like this for all three disks I tried, so (especially since these worked fine on the Beeb) I suspect the issue is with the drive. Some sort of alignment problem perhaps?

But even for the sectors that are present in the output file, the data doesn't seem to be read correctly. I'm running the Unix command strings on the output image to extract the contents of some text files:

Code: Select all

...
This test consists`of two perts. Part One is about the works you have read
in class with yo}r teakher. Part Two is about the books you have read on
your own. You only have to answer questionw0
...
That looks like a fair amount of bitflips. The farther I scroll down, the better it gets, with almost perfect text near the end.

Another thing I should mention is that the drive doesn't stop spinning after the KryoFlux is done reading it. When I press the little reset button on the KryoFlux, the drive does stop. Could this be an(other) indication of a slightly faulty drive?

I still have the Canon MDD221 drive that was attached to the BBC Micro, but it has a different power plug (not standard molex). It's also a four-pin plug though, so I suspect I could just rewire it to feed the drive off of a molex adapter, but will this drive even work with the KryoFlux?

Is this a known problem? Is there a way to make this drive work for me? Should I give up and buy another one? Or am I misinterpreting the data and is the problem elsewhere?

Many thanks for reading!

spags
Posts: 90
Joined: Sun Sep 09, 2012 5:46 am
Location: Australia

Re: Trouble decoding BBC Micro disks

Post by spags » Sat Feb 14, 2015 10:28 pm

If you decide to try your Canon drive, the datasheet at http://www.vintagecomputer.net/fjkraan/ ... 11_221.pdf may help you with the power pins.

thomastc
Posts: 4
Joined: Mon Feb 02, 2015 8:39 pm

Re: Trouble decoding BBC Micro disks

Post by thomastc » Mon Feb 16, 2015 6:35 pm

Yep, thanks! I'm hoping for a simpler and less scary solution though...

drdanj
Posts: 37
Joined: Sat Dec 29, 2012 9:47 pm

Re: Trouble decoding BBC Micro disks

Post by drdanj » Mon Feb 23, 2015 7:41 pm

Hello Thomas,
I've had no trouble getting dtc to create SSD images for the beeb via the GUI. Have you made sure your drive heads are clean? In the meantime, if you want to delve a bit deeper into what's going on with the images you've captured, I have some bits of code I wrote to deal with beeb/archi discs:

https://github.com/drdpj/kryotools

It expects the tracks to be called "track" and not "test", but if you muck around with the "KryoTest" application you should be able to get it to do an analysis of the tracks and pull out exactly what's going on with them.

I haven't played with it for a couple of years, so I can't remember the ins and outs of everything, but if I remember rightly it can do proper decoding of FM streams to create an SSD file, but not MFM streams (I was mostly playing with creating APD files for the archimedes which aren't processed, and are just raw bitstreams). I then extended it to look at some beeb files. If I get some time I'll have a more concerted poke at it later in the week.

d.

thomastc
Posts: 4
Joined: Mon Feb 02, 2015 8:39 pm

Re: Trouble decoding BBC Micro disks

Post by thomastc » Sun Mar 08, 2015 9:24 pm

Thanks for the reply!

I don't have a drive cleaning kit at hand, so I'm not sure that the heads are clean. But since they appear to work fine near the end of the disk, I would think so. There's no way a head could be dirty at track 0 and clean at track 80, especially after repeated tries on different disks, right?

I might have a play around with your code at some point. However, since you (and other people) report success reading BBC Micro disks with the KryoFlux without any additional tools (even analysis tools), I'm not sure it'll help.

If anyone else has a hunch what could be wrong with my hardware, disks, or software, I'm all ears!

drdanj
Posts: 37
Joined: Sat Dec 29, 2012 9:47 pm

Re: Trouble decoding BBC Micro disks

Post by drdanj » Mon Mar 09, 2015 2:22 pm

Have a go with the GUI. If you look at the scatter plot of your dump, you can see that there are some spurious fluxes that have crept in - they also don't seem to be completely consistent between revolutions of the drive (this is me just eyeballing it, not actually looking in detail). They're sort of in bands too which doesn't really look quite like the nasty smear you get with dirty heads. :-/ That said, I'd try cleaning the heads - IPA and lens tissue will work fine, just be careful and don't use a cotton bud or you'll clog them.

Failing that, I'd try the beeb drive on the kryoflux in the first instance if it's known to be good. It should work. As you said, you just need to suss out the power connector!

d.

thomastc
Posts: 4
Joined: Mon Feb 02, 2015 8:39 pm

Re: Trouble decoding BBC Micro disks

Post by thomastc » Sat Mar 14, 2015 9:39 pm

When I opened up the Canon's case, I noticed that the other end of the weird cable was a very common molex plug :) So that was a lot easier than expected. I managed to get perfect images of most of my floppies, and >80% of the rest (some bad sectors remain, despite plenty of retries). Thanks for all the input!

drdanj
Posts: 37
Joined: Sat Dec 29, 2012 9:47 pm

Re: Trouble decoding BBC Micro disks

Post by drdanj » Mon Mar 16, 2015 10:21 am

Ah, it was probably a Molex-> Beeb Auxillary Power cable (6 pins in a rectangle) - glad you got it to work!

d.

User avatar
mr.vince
Posts: 1873
Joined: Tue Oct 05, 2010 5:48 pm

Re: Trouble decoding BBC Micro disks

Post by mr.vince » Wed Mar 18, 2015 6:12 pm

Glad it all worked out well.

Please note that there are in fact Berg-like connectors on certain drives which are NOT Berg compatible and switch +5 and +12 (e.g. Speccy drives). You can fry your device by connecting a "standard" plug so better check before plugging.

User avatar
IFW
Posts: 2634
Joined: Mon Nov 08, 2010 2:42 pm

Re: Trouble decoding BBC Micro disks

Post by IFW » Wed Apr 15, 2015 4:25 pm

Other than what's already been said:
You may have to change the density setting of the drive trying -dd0 vs -dd1 in your command.
HD filtering/AGC may have difficulty reading long flux reversals, adding random flux reversals sometimes, while DD should work - as long as the drive actually changes its filtering during reading via the density line at all.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest