Octocontrabass wrote:MFM, RLL, ESDI, and pre-ATA IDE (1993-ish).
I don't intend to support MFM, RLL and ESDI drives as they are too obsolete. I'm undecided on pre-ATA-standardization IDE drives (if you refer to these). If they don't have too many differences from post-ATA-standardization IDE drives and their reliability isn't too bad, I'd probably want to support them because it wouldn't be too much additional effort.
Octocontrabass wrote:A bootloader has no reason to use multisector reads in the first place.
It's not necessary, but can be more efficient. I have already implemented splitting the read requests on track boundaries for CHS (undecided for LBA, either at 127 sectors, or at 120 sectors, or at LBA % 8 == 0), so the slight added complexity isn't an issue. Besides, the case where read requests can fail applies to both singlesector and multisector reads and as such there isn't much if any better reliability achieved by reading sector-by-sector. Unless I'm missing something?
Maybe it's not unreasonable to make the assumption that on 512e drives the filesystem has been formatted in 4K blocks that are properly aligned. Thus reading at most 15 such consecutive blocks (120 consecutive 512-byte logical sectors) will be a properly aligned request.
Octocontrabass wrote:An easier solution is to request 24 bytes for the first entry and examine bit 0 of the extended attributes. Thanks to the backwards compatibility problems mentioned on the wiki, bit 0 of the extended attributes must always be set (and ACPI 4.0 redefined it to always be set anyway), so if the BIOS writes a value with bit 0 clear or doesn't write anything at all, the BIOS only supports 20-byte entries, and you need to request the first entry again.
If I understand your method correctly, I suppose it will work in practice. I think it's very unlikely that a memory region would start on an odd byte, thus bit 0 is expected to always be clear if the BIOS returns 24 bytes despite an entry consisting of 20 bytes. Except that now bit 0 being clear doesn't mean that the entry ought to be ignored, but that 20-byte entries should be requested instead.
However, for my OS I still intend to check the presence of ACPI and its version because that information will be passed to the kernel anyway.
BenLunt wrote:Then, in my opinion, that is a faulty BIOS. Doing anything blindly defeats the purpose of a robust BIOS interface. A well written BIOS will first check to see if the request is within range of the media, as well as possibly making other checks before requesting sectors from the hardware.
I agree with this, however it often doesn't happen in practice. In fact, no BIOS among those I tested with PCem seems to be doing it, otherwise they wouldn't return success with unmodified PCem. There is an argument to be made that these BIOSes were written over 30 years ago and that modern BIOSes are likely more robust, but one must not rely on that.
Would you please tell me whether your BIOS supports the configuration of the Intel VS440FX machine in PCem? If not, would you please suggest another configuration to try? Also, have you tested your BIOS with QEMU and, if so, how do you run it? I'm also curious to see the results.