it seems that with the help of GPT.FLT (that can modify the IORBs passed between OS2DASD.DMD and the ADD drivers), you can also address sectors beyond the ABSOLUTE 2TB limit and that OS2AHCI.ADD has some sort of extension to use 48 bits of LBA address. Potentially what I proposed earlier on.
I didn't see your proposal so I wrote my own
There are two new CommandCodes:
IOCC_GEOMETRY64 (0x13) and
IOCC_EXECUTE_IO64 (0x14). They signal the use of new extended IORBs,
GEOMETRY64 and
IORB_EXECUTEIO64. The only difference from the 32-bit IORBs is that a 64-bit field has been added at the end of the structures to hold
ullTotalSectors and
ullRBA, respectively. The .ADD code is unchanged except that it now looks at the CmdCode to decide whether to take the LBA from the 32-bit or 64-bit field.
Current versions of AN's 'os2ahci.add' and 'nvme.add' support this interface. It's use comes at a small cost: for requests above 2TB, GPT.FLT has to create a 64-bit version of each request before it sends it to the .ADD. Each request is less than 100 bytes, so the overhead is minimal.
BTW...
IOCC_GEOMETRY64 returns the actual number of sectors on a disk - it isn't rounded down to a cylinder boundary. The call can also be used as a safe way to determine if 48/64-bit support is available.
What is the reason why OS2DASD.DMD cannot be modified? License issues?
Virtually everything above the .ADD/.FLT level is tied to 32-bit LBAs. There's just too much to change.