Get Information from experts about Flux transitions analysis

All questions about how to use KryoFlux go here.
User avatar
DrCoolZic
Posts: 172
Joined: Tue Jul 26, 2011 10:44 am

Re: Get Information from experts about Flux transitions anal

Post by DrCoolZic » Wed Nov 27, 2013 9:14 pm

Thanks I will have a look.
FYI I have bought an hxc emulator ther USB version because I wanted the variable bit rate support. But unfortunately I have not yet spend much time with it ...

Jeff_HxC2001
Posts: 58
Joined: Thu May 12, 2011 10:56 pm

Re: Get Information from experts about Flux transitions anal

Post by Jeff_HxC2001 » Wed Nov 27, 2013 10:17 pm

DrCoolZic wrote:Thanks I will have a look.
FYI I have bought an hxc emulator ther USB version because I wanted the variable bit rate support. But unfortunately I have not yet spend much time with it ...
Then you should be able to play on Atari ST with your streams files ;)

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

Re: Get Information from experts about Flux transitions anal

Post by IFW » Thu Nov 28, 2013 8:06 pm

You have two lines controlling writing: Write Gate and Write Data.
Writing is activated by simply asserting Write Gate (setting it logical 1 level).
From that point the head constantly writes and erases the track.
Writing only ever stops once Write Gate is negated (logical 0 level), not any other time.
Write Gate is ignored if Write Protect is asserted - i.e. you can't write to a protected disk, unless the electronics is modified, which was a popular modification for e.g. CBM 1541 drives.
Write Data does not send any data, so that's a bit misleading... It tells the head to reverse the flux polarity each time there is a pulse sent on the line. So for example what might look like sending a few 0s then a 1, in reality is just keeping the Write Data negated (0, no change in polarity) for a certain amount time (proportional to the number of 0 bitcells and their timing) and when the Write Data gets asserted (1) the polarity changes.
Consequently, if you keep the Write Data line negated you keep writing whatever the last polarity was for the duration of keeping the line negated.
Do this for an entire track (in practice slightly more due to index signal jitter), and you end up with a completely unformatted, factory new track.
The only difference between this and the real deal comes when the drive used for writing now, or writing before to the disk is misaligned. The erase core erases the area around the track while the write head writes whatever polarity it should constantly. However, when there is previous content that does not conform to the margins allowed (ie the drive is misaligned) there will be leftovers that may cause readability issues on a properly aligned drive.
Similarly, once a 96/48 TPI drive writes to a disk, the area covered by the erasure is not the same as the coverage you get from a 96/96 TPI drive; the genuine 96/96 drive will read and write a disk perfectly, but the very same disk will be unreadable, or randomly failing on a 96/48 drive.
All of these things are discussed in detail in the manual.
As for -wb -we afaik the manual tells what they are - basically useful for 96 (stepper)/48 (head) TPI mixed drives, as discussed before.

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

Re: Get Information from experts about Flux transitions anal

Post by IFW » Thu Nov 28, 2013 8:18 pm

No flux area is a kind of protection; an area that does not emit any flux reversals when read back via the Read Data line.
If you write no flux reversals (keep Write Data negated, 0) you unformat a specific area of a track, which will read back as weak bits.
If you try to copy such protected area of a track two things can happen:
1, a software based copy program will try to write this area as 0 bits if it can. This will either result in weak bits (Amiga) or 1010... sequences (most MFM controllers). Naturally, both will fail when read back, as they either change their state (weak bits) or show a valid MFM pattern. (I documented how can you read MFM clock bits via a WD controller, even when that is impossible... a certain type of Copylock does that)
2, a hardware based copy program will just read 0 from Read Data and transfer it to Write Data, always generating weak bits -> protection fails.
You can only generate a no flux area by modulating the flux reversals written and using the summing property of the head/filtering.
There is no kind of dc erasure or any other magic involved - sorry to disappoint :) -, it happens because of how the AGC works.
This sounds like the ultimate disk protection, but it's not: it works on most drives, but not all of them -> failing protection on original disks -> loss for the publisher...

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

Re: Get Information from experts about Flux transitions anal

Post by IFW » Thu Nov 28, 2013 8:22 pm

fyi: DTC does generate no flux areas, so it can write all of those protections. It's impossible to do with a standard controller, or any kind of purely analogue hardware copier as discussed above. DTC can also unformat tracks or just specific track areas, again, as discussed above.

User avatar
DrCoolZic
Posts: 172
Joined: Tue Jul 26, 2011 10:44 am

Re: Get Information from experts about Flux transitions anal

Post by DrCoolZic » Fri Nov 29, 2013 12:37 pm

Istvan many thanks for the clarification. :o
I must admit I was confused especially after the discussion we had around the NFA in the Atari Forum. Mr.Vince has posted result of experiment with permanent magnet here http://www.atari-forum.com/viewtopic.ph ... 95#p195958 and I have misinterpreted this information. I was under the assumption that having no transitions on the write data would not work. But obviously I was wrong.
DC Erased track
DC Erased track
dc_erase.JPG (197.35 KiB) Viewed 1807 times
It is interesting to note that in the case of this DC erase track there is much less transitions than a normal unformatted track (quite different histogram).
Side note: For consistency my Stream parser checks (debug assertion) that the index timing reported using the index clock is 8 times the accumulation of flux transitions minus pre index time. Usually the two values are extremely close (I allow a slack of 8 clocks) but for some reason on these raw files the difference can go up to 39 ??? Not a big deal but just curious (First time I had this assertion to fail?).

Writing data on a floppy drive is different from the same operation on an audio tape drive. On an audio tape the information the data is first erase by an erase head then the new data is written linearly by the read/write head. On a floppy drive there is no erase head (other than the tunnel / straddle erase head used from track trimming) and the data are just written over existing with the head operating at magnetic saturation.
Below is the write circuit of a drive: we can clearly see that when no data arrives, the flip/flop keeps a constant value driving only one “side” of the coil.
Write circuit
Write circuit
write circuit.JPG (38.07 KiB) Viewed 1807 times
Write timing
Write timing
write timing.JPG (39.31 KiB) Viewed 1807 times
With the information you provided it is clear that when keeping the write data negated you erase the track. This operation is obviously not possible with a WD1772 (it would never produce a steady signal) but easy to control on a replicator or with Kryoflux. As you mention the only problem might come from misalignment but hopefully the straddle or tunnel erase head should take care of this.
I have updated the document I am writing with this information. Again many thanks.

As far as the NFA is concerned I think I already know everything about it! And yes there is no magic as detailed in the thread referenced above. Again this is also documented in the document I am writing.
But … you say: “I documented how you can read MFM clock bits via a WD controller, even when that is impossible...” Whaoooo would not thought it was possible :geek: :ugeek:
where can I find this information?

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

Re: Get Information from experts about Flux transitions anal

Post by IFW » Fri Nov 29, 2013 1:01 pm

Glad the explanation finally cleared up all the details :)

If you use the reference stream decoder the timing drift (index vs. cell) is as good as it will ever get (should take care of a few edge cases), so don't worry about it - unless you can find a bug in it; in that case please let me know :)

As for how to read clock bits with WD177x:
http://www.sarnau.info/atari:protection_turrican
http://www.atari-forum.com/viewtopic.ph ... 8&start=25
It was posted by Mr.Vince on my behalf at Wed Jul 20, 2011 9:49 pm.

You obviously need a Trace or KryoFlux to prepare data like this though and make it possible to verify both data and clock bits to be 0 as protection.

Slightly off topic, but may I ask what language are you using for this development? C++, C# or something else?

User avatar
DrCoolZic
Posts: 172
Joined: Tue Jul 26, 2011 10:44 am

Re: Get Information from experts about Flux transitions anal

Post by DrCoolZic » Fri Nov 29, 2013 4:04 pm

IFW wrote:If you use the reference stream decoder the timing drift (index vs. cell) is as good as it will ever get (should take care of a few edge cases), so don't worry about it - unless you can find a bug in it; in that case please let me know :)
It is supposed to be same as the “reference decoder” but has been largely rewritten (for no good reason :) ) in C++. I have found this "problem" on the version rewritten in C# and this is why I was wondering I did something wrong. But my C++ version as the same behavior.
IFW wrote: As for how to read clock bits with WD177x: …
Hummm I am disappointed :( I was expecting a “universal way” of reading clock bits with WD1772. In the case of Turrican it is by “design” that it is possible to read the clock bits. Reading clock bits in protection like Turrican is explained in detail page 49 of my document on protection http://info-coach.fr/atari/documents/my ... ection.pdf so unfortunately nothing new ! ;)
IFW wrote: Slightly off topic, but may I ask what language are you using for this development? C++, C# or something else?
As you may know all my previous development around Stream and IPF were done in C++ that I have been using for over 25 years. And for info I have never been a GUI person :roll:
In the feedback that I have received on KFAnalyze/KFPanzer programs it was mentioned that it did not make sense to develop new programs without having a decent GUI. :ugeek:

Therefore I have decided to learn WPF and C#. I have progressed slowly at the beginning because WPF has a relatively steep learning curve and you need to get use to C#. If you combine this with learning about charting, asynchronous threading (a must for GUI) etc. that’s a lot to digest :lol:

One of the problem with WPF and C# is that it they use “managed code”. Therefore in order to use my C++ Stream library and the IPF C++ library I have learned about marshalling and this is a paint in the … neck. I have therefore decided to rewrite the stream lib in C# (although I have written a C# wrapper for interop) and I have not yet decided what to do with IPF. The most reasonable seem to use a wrapper library to do the marshalling but it is unclear if it is best to do it in C# or managed C++ (this would require to learn C++ extension). The other alternative would be to convert the IPF lib in C# but my concern is about new releases (don’t want to do the work several times).

Although I reach the point were I can get quickly new features in my prototype the code is getting more and more ugly and less and less OO. So I will need to step back and clean that mess ... As mentioned above in a reply to Jeff displaying FD info is challenging in mixing high and low level information. I have been thinking about some interesting ways to present information in an interactive application and we will see how it looks :mrgreen:

User avatar
DrCoolZic
Posts: 172
Joined: Tue Jul 26, 2011 10:44 am

Re: Get Information from experts about Flux transitions anal

Post by DrCoolZic » Fri Nov 29, 2013 4:15 pm

By the way here is an extract of the doc including feedback received so far on unformatted tracks
FLOPPY DISK Information 0.1-unformat.rar
Unformatted track info
(684.51 KiB) Downloaded 87 times

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

Re: Get Information from experts about Flux transitions anal

Post by IFW » Fri Nov 29, 2013 6:41 pm

You realize that I was the one where the info in your doc comes from originally, right? ;)
So how do you find C# for a tool like this? Is it worth switching over or would you rather use C++ with a decent GUI toolkit like wxWidgets plus STL and/or BOOST?

Post Reply