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

Doesn't check CRCs when loading from floppy #94

Open
TomHarte opened this issue Jan 2, 2017 · 4 comments
Open

Doesn't check CRCs when loading from floppy #94

TomHarte opened this issue Jan 2, 2017 · 4 comments

Comments

@TomHarte
Copy link
Contributor

TomHarte commented Jan 2, 2017

... which could conceivably cause a disk protection mechanism that relied upon the CRCs being invalid to fail.

(discovered by chance, after observing that the CRCs on the barbitoric2.dsk bundled with Oricutron are incorrect, so that disk shouldn't load — see http://forum.defence-force.org/viewtopic.php?f=19&t=1708 )

Update: the bundled BuggyBoy.dsk and Quintessential.dsk also seem to have incorrect CRCs. Pulsoids and ZipNZapE seem to be correct.

@pete-gordon
Copy link
Owner

pete-gordon commented Jan 3, 2017

IIRC, I noticed that checking the CRC stopped Barbitoric from booting, and since I was assured it booted on real hardware, I disabled the check, filed it under "look into it later" and forgot about it. I think there might even be a comment in the source where I removed the check (one of the pitfalls of writing an emulator when you don't own the real hardware is it's hard to verify this kind of bug).

@TomHarte
Copy link
Contributor Author

TomHarte commented Jan 4, 2017

I think you were in the right with your original implementation — not calculating CRCs was a known missing feature in early versions of the disk builder, and the tool that writes .DSKs to real floppies silently corrects CRCs.

@Godzil
Copy link
Collaborator

Godzil commented Jan 11, 2017

The problem with CRC and real hardware is that the CRC from the file is not used, when you write a track on a floppy the CRC is calculated by FDC (as you should use the F7 command for that) that can explain why barbitoric works fine on a real floppy.

Also the HxC tool to convert the DSK to it's own format must calculate the CRC too, remain the unknown on the Cumulus, I wonder if it update the CRC or just ignore it (and never reply trigger a CRC error)

Edit: After checking the code, it's quite likely that the Cumulus ignore the CRC, so it will not trigger an error if the CRC is invalid, but it does not corrrect it either, so if you read the track you will get an invalid CRC..

@TomHarte
Copy link
Contributor Author

Just a quick follow-up to note that OSDK 1.11 which is about a week old at the time of writing includes an updated FloppyBuilder that generates correct CRCs. So hopefully this issue will become academic with time.

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

No branches or pull requests

3 participants