Patch DragonDOS for 512 byte sectors?

A place to discuss everything Dragon related that doesn't fall into the other categories.
Post Reply
User avatar
robcfg
Posts: 1532
Joined: Sat Apr 04, 2009 10:16 pm
Location: Stockholm, Sweden
Contact:

Patch DragonDOS for 512 byte sectors?

Post by robcfg »

Hello everyone!

I was trying to get the usb floppy emulator (the cheap chinese one from Gotek) working with the Dragon, due to recent success with the Amiga (by using a new firmware) and Amstrad CPC (converting disk images to IBM format).

The DragonDOS 720kb layout is identical to the PC 1.44Mb layout but with 256 byte sectors instead of 512 byte sectors.

Thing is, that's the only thing that makes it not work with the Dragon.

So, my question is, could DragonDOS be easily patched to use 512 byte sectors?

Regards,
Rob
sixxie
Posts: 1348
Joined: Fri Jul 18, 2008 8:36 am
Location: Hertfordshire
Contact:

Re: Patch DragonDOS for 512 byte sectors?

Post by sixxie »

Not trivial - the easiest read-only patch would be to make it divide the sector by two and use the lowest bit to decide whether to skip the first or second 256 bytes of the sector read - assuming there's enough time between bytes to do that without losing data (you can do a little, but really not much).

Writing in that scheme would be much more involved - you'd need to read a full sector in and overwrite half of it before writing it out again.

Or you could change the on-disk format - again, probably more involved than it sounds. Modulo-256 arithmetic is really convenient...
prime
Posts: 267
Joined: Fri Apr 10, 2009 1:40 am

Re: Patch DragonDOS for 512 byte sectors?

Post by prime »

If you where going to attempt it, it would be better IMHO to try and adapt to 9x512 byte sectors.

Whilst the 2797 is capable of reading a HD disk, you would need to firstly modify the DOS controller to run the 2797 with a clock of 2MHz, and secondly you'd need to run any code accessing the floppy from ROM at an address > $8000 and in fast mode as this is the only way that it can keep up with the HD data stream**. Other than that it should be possible but it is certainly not trivial, it would also break compatibility with software that assumes 256 byte sectors.

** I actually tried this a few years back the data comes in too fast at HD data rates for the 0.89MHz 6809 to keep up with, resulting in lost data from the controller as the 6809 has not had a chance to finish storing the last byte before the next comes in.

Cheers.

Phill.
sixxie
Posts: 1348
Joined: Fri Jul 18, 2008 8:36 am
Location: Hertfordshire
Contact:

Re: Patch DragonDOS for 512 byte sectors?

Post by sixxie »

Oh, are they also HD-only? Yeah that's going to suck more...

It baffles me why they're so limited - the format used by the HxC is just raw transition data and so doesn't have any built in assumptions about sector size (or even encoding). In this case, the cheaper device is surely having to do more work by translating whatever format it uses that has sector size assumptions into transition data?

Being limited to a single data rate is a bit more understandable in terms of cost saving.
User avatar
robcfg
Posts: 1532
Joined: Sat Apr 04, 2009 10:16 pm
Location: Stockholm, Sweden
Contact:

Re: Patch DragonDOS for 512 byte sectors?

Post by robcfg »

One silly question...

The Dragon is more than able to read and write 720kb disks, so would it be possible to create a rom for the DragonDOS controller that only reads FAT12 720kb disks?

Also, is reading 512 byte sectors that big of a problem for the dragon even if the disk capacity is already supported?
sixxie
Posts: 1348
Joined: Fri Jul 18, 2008 8:36 am
Location: Hertfordshire
Contact:

Re: Patch DragonDOS for 512 byte sectors?

Post by sixxie »

That wouldn't be a problem at all. If all you wanted was program loading (no FREAD/FWRITE, etc.), it probably wouldn't take too long to rustle one up, either.

There's no problem with reading or writing non-256 byte sectors (i.e., 128, 512 or 1024 byte) - in fact the standard ROM routines will do it with no modification if you use a preformatted disk. It's keeping the DragonDOS on-disk format that would be a right pain.
Post Reply