Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redesign MFM decoding & add encoding #29

Merged
merged 2 commits into from
Mar 7, 2024

Conversation

jepler
Copy link
Member

@jepler jepler commented Feb 22, 2024

The old implementation literally decoded MFM on the fly which was cool but irrelevant: we can store a track worth of flux on all the micros we care about, in addition to the decoded sector data.

So redo it based around the idea of holding the full track; and implement MFM writing.

MFM writing is only ever track-at-a-time and fully re-writes the track including all markers and timing.

The timing is not correct right now but it's good enough for the "05" test to read back what it wrote.

Creating in draft form as the CI will be (justifiably) unhappy. I plan to rebase this code before pushing, so don't spend too much time on a detailed line by line review yet

The old implementation literally decoded MFM on the fly which was cool
but irrelevant: we can store a track worth of flux on all the micros
we care about, in addition to the decoded sector data.

The new implementation also includes an encoder, which writes data
that is understood by a USB 3.5" floppy drive. The MSD demo is enhanced
for read/write support.
@jepler
Copy link
Member Author

jepler commented Mar 6, 2024

@ladyada I think this is ready for you to test again.

My testing procedure, on linux of course

  • Start with a floppy that has a valid low level format & valid FAT filesystem
  • Put floppy in drive, plug in floppsy.
  • Create/edit a file and put some content in it
  • eject/safely remove/etc the drive to ensure everything's written out.
  • switch to a USB floppy drive and read/verify the data added in the earlier step

I have not stress tested this.

@ladyada
Copy link
Member

ladyada commented Mar 7, 2024

hmm cant replicate success i had a floppy full of some other files, added one more file, got serial output indicating its writing but the file didn't stick (?)

9:35:07.434 -> Flushing track 1 side 0
19:35:07.434 -> Going to track 1
19:35:07.434 -> 
write call back block 19 size 512
19:35:07.481 -> Going to track 0
19:35:07.904 -> Going to track 0
19:35:07.904 -> 
Writing block 19
19:35:07.904 -> write call back block 20 size 512
19:35:07.904 -> Writing block 20
19:35:07.904 -> write call back block 21 size 512
19:35:07.904 -> Writing block 21
19:35:07.904 -> write call back block 22 size 512
19:35:07.904 -> Writing block 22
19:35:07.904 -> write call back block 23 size 512
19:35:07.904 -> Writing block 23
19:35:07.904 -> write call back block 24 size 512
19:35:07.904 -> Writing block 24
19:35:07.904 -> write call back block 25 size 512
19:35:07.904 -> Writing block 25
19:35:07.904 -> write call back block 26 size 512
19:35:07.904 -> Writing block 26
19:35:08.229 -> flush
19:35:08.229 -> 
19:35:08.229 -> Flushing track 0 side 1
19:35:08.229 -> Going to track 0
19:35:08.229 -> Going to track 0

let me try a blank floppy maybe?

@ladyada
Copy link
Member

ladyada commented Mar 7, 2024

oh gah i had write protect on 😢

@ladyada
Copy link
Member

ladyada commented Mar 7, 2024

ok it can def read from the same disk drive and a separate USB drive. so its good!

@jepler jepler marked this pull request as ready for review March 7, 2024 19:50
@jepler jepler merged commit a5a1e19 into adafruit:main Mar 7, 2024
3 checks passed
@jepler jepler deleted the redo-mfm-add-decoding branch March 7, 2024 19:50
@jepler
Copy link
Member Author

jepler commented Mar 7, 2024

I need to improve handling of the floppy WP mode for sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants