Page 1 of 1

Need a small byte swapping test routine

Posted: 13 Mar 2020 17:59
by exxos
Could some kind soul write a test routine in assembly to do by swapping which is what would happen in HD11 etc when used on hard drives ?

Reason is, I'm just curious as to how long it would take a 8MHz CPU to do the byte swapping on I assume 512 bytes of data ? versus the same test on a 32MHz boosted CPU...

This boils down to if a boosted CPU can do a reasonably quick job at byte swapping, there may actually be no need for us to develop a byte swapping function in hardware for our IDE boards...Then let users simply tick the byte swap box in the driver, and even though it is a lot slower, if we can gain speed back with a faster CPU, we could just do that instead. But this is why I need on sort of benchmark tool so I can do the comparison...

Re: Need a small byte swapping test routine

Posted: 13 Mar 2020 18:08
by czietz
I see one issue with that idea: It's not only slower, but HDDRIVER can't boot from a byte-swapped drive, either. I.e., when you don't byte-swap in hardware (like e.g. the Thunder is capable of doing), one cannot boot from a PC-compatible IDE hard drive / CF card / SD card adapter. Meaning that you always need two drives: one with Atari byte order for booting and one with PC byte order for data exchange.

Re: Need a small byte swapping test routine

Posted: 13 Mar 2020 18:13
by exxos
I guess that would be more of a TOS issue though ? I assume TOS would check for the IDE driver and try to load the driver.. I assume that would fail before the driver itself..


EDIT:
Has anyone tried using HD11 etc with one byte swapped drive and one not-byte swapped , IE master and slave ? I assume that is how people are doing it currently anyway ?

Re: Need a small byte swapping test routine

Posted: 13 Mar 2020 18:22
by czietz
exxos wrote: 13 Mar 2020 18:13 I guess that would be more of a TOS issue though ? I assume TOS would check for the IDE driver and try to load the driver.. I assume that would fail before the driver itself..
Actually, it's both. Meaning that even if you patch TOS 2 to get the root sector loaded from a byte-swapped IDE, then HDDRIVER's loader (the part that loads HDDRIVER.SYS from disk) fails on a byte-swapped drive. Of course, with EmuTOS one does not have such issues. There, a byte-swapped drive is merely slower.
exxos wrote: 13 Mar 2020 18:13 Has anyone tried using HD11 etc with one byte swapped drive and one not-byte swapped , IE master and slave ? I assume that is how people are doing it currently anyway ?
I know several people who use it that way in a Falcon with a dual-CF card reader, yes. In the ST and TT, I also of course know a lot of people who have a Lightning ST or Thunder and therefore don't have these problems in the first place. ;)