Work-In-Progress Reports for October 2009

31 October 2009

KryoFlux - Data Packets: Found the "problem of unformatted tracks" mentioned in the last WIP. It actually had nothing to do with unformatted tracks, it just demonstrated a logic flaw in the decoder. Data arrives in packets, but there is no guarantee that a packet always contains complete encoded sequences of flux data and OOB (Out Of Band) data, so it may continue in the next packet. (more)

30 October 2009

KryoFlux - Interrupts: The spurious interrupts mentioned in the previous WIP have now been fixed. Some more testing is needed, but we can definitely dump both DD and HD disks without it occurring anymore, with all the proper stream enable/disable sequences in place and without any hacks or work arounds. Track data passes initial integrity tests built into the host decoder. (more)

29 October 2009

KryoFlux - Out Of Band Data: Added all OOB (Out Of Band) functionality for transfer information and disk index signal. The transfer information helps profiling transfer performance, detecting and recovering from errors or skipping data without very complicated host algorithms. The disk index signal contains the reference timer and other data that enables the host to calculate the exact disk index signal position. (more)

28 October 2009

KryoFlux - Transfer Rate Testing: Time to test a few disks, both DD and HD ones, just to get an idea of the average transfer rate. Windows Commander on HD disk gives an average of 380 KiB. Another HD disk we sampled for over an hour without problems at 450 KiB. (more)

27 October 2009

KryoFlux - Optimisation Strategies: Unless there is an unnoticed issue, the code is now fully working. There are a few dirty things here and there that will be replaced with proper functions, things like disabling the data streaming properly as at the moment, once it's turned on, it remains on forever until a software reset is requested by the host. Things still to do: - Do testing to verify integrity... just in case. - Add OOB (Out Of Band) data for index signal. (more)

26 October 2009

KryoFlux - Results!: Another possibility arose that would save a few more cycles on the interrupt, but sadly an "optimisation" in the compiler kills all attempts at making it work - the resulting code is too short (!) and merged with the next few instructions... The responsible optimisation could be turned off, but that would produce slow code for the rest of the function, so we had to abandon it. (more)

24 October 2009

KryoFlux - New Interrupt Encoding System: Implemented new communication code that works and seems to pass integrity checks on the host side, but not the internal sanity checks done by the firmware. This is probably down to synchronisation issues. In order to have a guaranteed working version, more synchronisation would be needed to guard the ring buffer content, but that would be very expensive in terms of execution time. (more)

17 October 2009

KyroFlux - Problems with HD: Transfer is working in DD mode, but the encoding takes too much time for HD - it might fail under some specific conditions. It's already highly optimised lockless code, so there is nothing that can be improved with the current solution. We'll try a slightly different approach, as bottlenecks have been identified, to see which strategy is best with HD in mind. (more)

15 October 2009

KyroFlux - Progress: Added a basic memory system as the fixed memory allocation done at compile time is problematic when using dynamic buffers. Added separate code path for writing, currently just signals an error. Any USB disconnect, suspend, or bus reset event can now stop the board processing the current command, or stop streaming and reset the allocated resources, including the disk drive. (more)

14 October 2009

KryoFlux - Timing and Measurement: This discussion is related to the previous WIP about overflow - why it is not enough to just partially measure a signal, and researching whether the hardware was capable of the automatic read/restart of the timer measuring on the same edge, a feature that actually worked out for a change. (more)

13 October 2009

KryoFlux - Stupid Timers: Implemented some code that transfers data and, on the host side, checks data validity and spots suspect data - just to be on the safe side. This lead to the discovery of an unfortunate problem: the timer value is unreliable for anything above 16 bits (it can count 0...65535, then starts from 0 again and so on). That is, we can only measure 2. (more)

12 October 2009

KryoFlux - Disk Reading - Fine Tuning: Got some real ring-buffer code in the sampler interrupt. It took a long time to balance, as the number of instructions should be minimal. It's been tested running with the USB stress-test and sampling a disk at the same time - after a few structural changes the speed could still be maintained. (more)

10 October 2009

KryoFlux - Disk Reading: Added disk read handling interrupt. Currently, it just stores the sampled flux change distances into a buffer, and signals the main code path to send the buffer. The main thread sends the buffer that can be seen on the PC host. Did some test reads and the data returned is pretty much what is expected. (more)

9 October 2009

KryoFlux - Misc: Some code re-organization. Added disk index signal handling interrupt.

8 October 2009

KryoFlux - Fast Interrupts: Tested all cases of how fast IRQ's, "FIQ" (Fast Interrupt Request), work and should be set up. Created a test FIQ server that finally fully works. This took a few hours, especially since the SDK assembly startup routine for the board accidentally disables fast IRQ support, has no FIQ vector set, and the hardware documentation is missing a few tiny details... (more)

7 October 2009

KryoFlux - Drive Control: Recent work: * It's alive - drive control is working now! * Commands and settings are fully working now. Everything should be mostly functional apart from actually reading a disk. Trying KryoFlux with a board that does not have the external power connected should detect the hardware failure, and set the track number set to 65535. As soon as power is restored it re-calibrates the drive hardware and logic. (more)

5 October 2009

KryoFlux - Drive Control Prerequisites: We have come a long way during the past 2-3 weeks, although none of it would have been possible without the previous work on Cyclone20, or the hundreds of hours invested into learning the various architectures involved (USB protocol, ARM architecture, ARM programming/assembly, ATMEL chips and devices, linker scripting, Windows drivers...) - probably a few thousand pages of docs... (more)