Track/Side Selection when Writing?

All questions about how to use KryoFlux go here.
User avatar
NF6X
Posts: 15
Joined: Sat Aug 17, 2013 2:17 am
Location: Riverside, California, USA
Contact:

Track/Side Selection when Writing?

Post by NF6X »

I'm trying to write .ipf files created with keirf's Disk-Utilities to 8" single-sided floppies, using my KryoFlux and a D-Bit FDADAP adapter. Reading works great with this setup, but I'm having some trouble with writing.

First, I can't seem to get dtc to honor my track and side selections. Based on the console output, it appears to write both sides every time, without regard to the presence of -g0 or its location on the command line. This isn't a huge problem since I'm using a double-sided drive, but I think it would be a problem with a single-sided drive since the drive would presumably ignore the side select line and overwrite side 0 with side 1's data.

I'm also having trouble with the track selection arguments. No matter what combination and location of -s, -e, -os and -oe I use when I invoke dtc, it appears to write track 80 every time. That's a big problem: The drive appears to know that track 76 is its maximum track, and so it appears to ignore step pulses beyond track 76. I can see from the LEDs on the FDADAP board that dtc is actually trying to step to track 80, but I don't hear the drive step beyond 76. I suspected that this spurious write to nonexistent track 80 would overwrite track 76, and that appears to be true; I read the disk back in after writing it with dtc in this manner, and track 76 appears to be unformatted. That is, the valid track 76 data got overwritten by a write of unformatted data to track 80.

I know that dtc is picky about the ordering of its command-line arguments, but I have experimented with lots of argument orderings without success. Am I doing something wrong, or is this a real bug?

I'm using this version of dtc:

KryoFlux DiskTool Console, v2.20, uiv.1, Mar 24 2013, 19:59:17

and I'm on a Mac running OSX 10.8.5.

Here's an example of the output that I see if I experimentally try to just write track 5 through 7. Notice that it's also writing track 80 (which actually seems to overwrite track 76 in my setup). I didn't specify -g0 in this example, but both sides appear to get written no matter what.

% dtc -fFOO.ipf -s5 -e7 -w
Image type: IPF
05.0 : Writing IPF
05.1 : Writing IPF, <unformatted>
06.0 : Writing IPF
06.1 : Writing IPF, <unformatted>
07.0 : Writing IPF
07.1 : Writing IPF, <unformatted>
80.0 : Writing IPF, <unformatted>
80.1 : Writing IPF, <unformatted>

ldkraemer
Posts: 21
Joined: Sat Apr 20, 2013 3:54 am

Re: Track/Side Selection when Writing?

Post by ldkraemer »

Mark,
I've seen the exact same issue with my Kryoflux. I'm using a 360K DS/DD 48TPI Mitsubishi Floppy with 40 Tracks. I get the attempt to write
Tracks past 39, too!

I've been using the following with my 48TPI Floppy:
dtc -d0 -fMM000.ipf -w -s0 -e39 -k2

But Keir, found that I needed to remove the -k2 switch when he looked at some of my files I sent. So, I'm not sure what is correct.
The manual states that -k1 (80 Track) is DEFAULT, which appears to be valid, but it shouldn't be correct if using a 48TPI Floppy Drive.

What I didn't realize was that I may be overwriting the last Track, as your testing has shown. I'll have to write a floppy that has data on the last track to compare.
That might mean all the Files I've created could be misisng the last Track's information.

I am wondering if you have used the GUI Software and have verified the following, assuming a 48TPI Floppy:
Check "Image Type" is set to "MFM sector image" and "Track Distance" to "40 Tracks" or tick "Default". It generally should work then.
Additionally (if not already done so) you should go to File -> Settings -> Advanced and set "Max Track, Drive 0" to 39 or 40 for your 48 tpi drive.
Thanks.

Larry

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

Re: Track/Side Selection when Writing?

Post by mr.vince »

We will need to look into this. Basically, writing was aimed at known formats with 80 track drives. Hence this is an unplanned scenario. Thanks for feedback!

User avatar
NF6X
Posts: 15
Joined: Sat Aug 17, 2013 2:17 am
Location: Riverside, California, USA
Contact:

Re: Track/Side Selection when Writing?

Post by NF6X »

ldkraemer wrote:Mark,
I've seen the exact same issue with my Kryoflux. I'm using a 360K DS/DD 48TPI Mitsubishi Floppy with 40 Tracks. I get the attempt to write
Tracks past 39, too!
You might be ok. The 5.25" drives that I've experimented with do not appear to qualify the track step pulses, and they happily step the heads until they bang against the stop. And then continue banging them. Most of my drives can also step to at least track 40. If you're only trying to write tracks 0-39, then I think that there's a good chance that any tracks that dtc tried to write past track 39 were written without overwriting track 39.

The 8" drive I'm using is a Tandon TM848E, and it seems to actually count the tracks and refuse to try to step past track 76. If it blindly banged the heads against the stop like my 5.25" drives, then I might not be adversely affected by this issue.

Oh, I should also mention that I was able to boot my TRS-80 Model II from the disk that I made when I discovered this issue, in spite of the overwritten final track. So, aside from the issues with head and track selection, writing is definitely working!

I'll experiment with -k2, and I'll reply again if I get any interesting results.
mr.vince wrote:We will need to look into this. Basically, writing was aimed at known formats with 80 track drives. Hence this is an unplanned scenario. Thanks for feedback!
Thank you for looking into this! I'm crossing my fingers for a quick patch release! Keir has made some great improvements to Disk-Utilities lately that really expand the boundaries of what we can do with KryoFlux, so it's not too surprising that we'll find some issues like this.

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

Re: Track/Side Selection when Writing?

Post by mr.vince »

"Quick" and "patch" don't work well with "tested" and "quality", but we'll look into this. :)

User avatar
NF6X
Posts: 15
Joined: Sat Aug 17, 2013 2:17 am
Location: Riverside, California, USA
Contact:

Re: Track/Side Selection when Writing?

Post by NF6X »

mr.vince wrote:"Quick" and "patch" don't work well with "tested" and "quality", but we'll look into this. :)
Yes, very true! I'm willing to alpha-test patches, if that helps. ;)

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

Re: Track/Side Selection when Writing?

Post by mr.vince »

We have a major feature request under heavy development that has to do with this so maybe we can fit it into the process.

User avatar
NF6X
Posts: 15
Joined: Sat Aug 17, 2013 2:17 am
Location: Riverside, California, USA
Contact:

Re: Track/Side Selection when Writing?

Post by NF6X »

Cool!

Keir has also been working on a temporary work-around in Disk-Utilities. I'll be testing out a patch this morning after I get enough coffee into my system. I know that I've expressed some frustration online before because Team KryoFlux's major focus hasn't always been well-aligned with my primary use case, but I have to say that Keir's recent feature additions in Disk-Utilities have really turned KryoFlux into a useful and exciting tool for me.

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

Re: Track/Side Selection when Writing?

Post by mr.vince »

We're listening... as you might have noticed. ;)

User avatar
NF6X
Posts: 15
Joined: Sat Aug 17, 2013 2:17 am
Location: Riverside, California, USA
Contact:

Re: Track/Side Selection when Writing?

Post by NF6X »

And we're glad to be listened to! ;)

The patch I tested had an interesting effect that might be of interest to the folks who are looking into this issue. As I understand it, the patch tries to hack around the undesired behavior of dtc by replacing each unformatted track with the contents of the previous formatted track. Thus, the two potential cases of track overwrites will still occur, but they'll overwrite the track with the data that belongs there anyway. There was a surprise in the results, though. dtc still wrote both sides with -g0 specified, but it no longer performed the spurious writes to cylinder 80 when presented with one of the "hacked" .ipf images.

I haven't thoroughly wrung out the behavior yet; i.e., I only tested with some 77 track single sided 8" disk images so far. However, I thought that this detail might be helpful to your developers.

Post Reply