Page 2 of 2
Re: QubIDE media layer query
Posted: Sat Aug 16, 2025 11:00 am
by Peter
Except getting incompatible to older versions of Amiga QDOS Classic, I wouldn't see a problem if Mark's driver would de-swap the data. QubIDE occupies a whole harddisk anyway, so that would not collide with other Amiga use. It would make an actual harddisk compatible to the QL and simplify data interchange with UAE images. SMSQ/E on Q68/Qzero/QIMSI Gold directly supports QubIDE images, so a UAE image on SD card should immediately work with those. At least if the UAE image depicts the IDE drive 1:1 - not sure about that.
Re: QubIDE media layer query
Posted: Sat Aug 16, 2025 11:27 am
by tofro
With Atari TOS (that stores IDE data "in wrong byte order" from a PC POV), there are drivers that byte-swap HD images for PC compatibility (The famous HDDRIVER is an example) on the fly. Those drivers are known to receive a significant performance penalty when operating in PC compatibility mode, i.e. do the byte swap.
Re: QubIDE media layer query
Posted: Sat Aug 16, 2025 11:41 am
by Peter
tofro wrote: Sat Aug 16, 2025 11:27 am
Those drivers are known to receive a significant performance penalty when operating in PC compatibility mode, i.e. do the byte swap.
I thought the same, and remember a discussion with Richard about it in the Q60 context, but he insisted it was neglegible. We tried, Richard was right. "Significant penalty" probably refers to a 68000 or so. Not sure how important that is as a QDOS Classic target, and what loss we are actually talking about.
Re: QubIDE media layer query
Posted: Sat Aug 16, 2025 1:41 pm
by Mark Swift
Peter wrote: Sat Aug 16, 2025 10:18 am
Yes, I run RedHat + Shoestring Linux on Q60 and Debian 12 on a PC. Both pull the same image from an attached IDE drive, if swab is used on the PC but not on the Q60.
So your test shows that drives present differently to dd depending on whether you are running a big-endian or little-endian version of linux. That would seem to imply that on a big-endian linux, a QL QubIDE drive would correctly report "QLW1" and not "LQ1W"
I was expecting that there would be an abstraction layer between the hardware and the upper OS to make sure that the byte-stream read from the same disk remained the same between linux versions. Seems not.
Yes, the Amiga QubIDE code adjusts for these hardware differences.
The original QubIDE core is left as-is but on the Amiga version; words are byte-swapped just before a word is sent and just after a word is read from the IDE controller.
Peter wrote: Sat Aug 16, 2025 11:00 am
...I wouldn't see a problem if Mark's driver would de-swap the data ...It would make an actual harddisk compatible to the QL
Since Amiga, Q60 and QL are all big-endian, a drive will have the same physical byte-stream order between all QubIDE systems.
So the physical QubIDE drive on Amiga QDOS Classic should already be compatible with a real QL...
...It's just the disk images in UAE that are weird.
I suppose I could create a UAE-only version of the QubIDE driver that de-swaps when handling sector buffer data ; to ensure that UAE images are compatible with images from existing systems. I was just hoping for a cleaner solution.
Re: QubIDE media layer query
Posted: Sat Aug 16, 2025 2:44 pm
by Peter
Mark Swift wrote: Sat Aug 16, 2025 1:41 pm
That would seem to imply that on a big-endian linux, a QL QubIDE drive would correctly report "QLW1" and not "LQ1W"
That is correct.
Mark Swift wrote: Sat Aug 16, 2025 1:41 pm
The original QubIDE core is left as-is but on the Amiga version; words are byte-swapped just before a word is sent and just after a word is read from the IDE controller.
So it could be corrected with a (probably neglegible) speed advantage instead of the penalty Tobias mentioned.
Mark Swift wrote: Sat Aug 16, 2025 1:41 pm
So the physical QubIDE drive on Amiga QDOS Classic should already be compatible with a real QL...
At first I thought it is not compatible, but you are probably right.
Mark Swift wrote: Sat Aug 16, 2025 1:41 pm
I suppose I could create a UAE-only version of the QubIDE driver that de-swaps when handling sector buffer data ; to ensure that UAE images are compatible with images from existing systems. I was just hoping for a cleaner solution.
Maybe just document the issue and leave the driver as it is. Not a big deal to use external scripts swapping the data.
Is the UAE harddisk image a direct drive image or does it contain "extras"?
Re: QubIDE media layer query
Posted: Sat Aug 16, 2025 5:00 pm
by Mark Swift
Peter wrote: Sat Aug 16, 2025 2:44 pm
Is the UAE harddisk image a direct drive image or does it contain "extras"?
The UAE QubIDE harddisk image wasn't copied from a physical drive; and there's no extras.
It was originally just an blank 64 Mb file. After booting into UAE/QDOS Classic, I formatted the resultant empty drive via "format win1_Name" selecting all cylinders "(0=all)". I can't remember what block size I chose.