Success, i think
I installed the 'Anonymous' bios and my XT booted from the Flash drive, I dunno why it won't boot with the stock IBM BIOS or the 2 Clone XT bios's i tried.
Yes i changed the define to 0x2B because with 0x2C i had MAJOR corruption issues with this 'Anonymous' bios, I had to Zap the flash drive in another PC and start again.
More testing required but it seem's to be working quite well at the mo.
I've updated the BIOS to detect CH375 versus CH376 and select the correct write command. Obviously, this is a high risk "try it on a scratch device" change, but it seems to work on my CH376.
https://gitlab.com/hakfoo1/v40-bios/-/blob/CH375-Workarounds/disc.asm I also defaulted ALLOW_INTS on, because I suspect it has to do with the benchmarks being all over the show. I figure if we can avoid weird time-distortions, that's important to have an honest idea of what these devices and firmware can actually do.
According to their datasheets, CH376 chips start have version IDs starting with 0x40, but CH375 version numbers start with 0x80, so if we see a version 0x80 or higher, it's presumably a 375.
Right now it probes the device for its version ID before each write or format action. There are probably smarter alternatives:
* Storing the probe result somewhere-- can we steal one byte in the BIOS data area, for example
* Loading a different code base for the 375/376 toggle, like how we do for the 8086/V20+ toggle. Though now we have four copies of things and ROM space isn't free...
With regards to the other BIOSes... are any of them publically available? I could try instrumenting up the disc BIOS a bit more and seeing how those probe it to try to work the issue out. I'm afraid my machine has about as much in common with a "real" XT as grapes do to Grape-Nuts, so I'm not sure if I'll be able to actually get through a POST cycle, but it's worth trying.
Clearly the XT-IDE BIOS does something this one does not, if it can hand-off successfully.
A quick DiskTest since my machine now has both devices in it at the same time.
CH376 on this BIOS (generic 2Gb flash drive, 60M partition out of displayed 504Mb)
Write: 275.08k
Read: 342.19k
8k Random: 5.9 IOPS
Sector Random: 7.0 IOPS
Average time 143ms
XT-IDE: (32Gb Micro-SD card, 60M partition out of displayed 8G)
Write: 273.07k
Read: 637.01k
8K Random: 6.9 IOPS
Sector Random: 7.0 IOPS
Average time 142ms