@joerg
Reopening this topic as a result of the "Hyperion managed by liquidator; bankruptcy looming" thread.
Quote:
What would be the difference if SP-Engine (the part creating/modifying the RDB, MediaToolBox is just a GUI using it) instead of the device drivers convert LBA to CHS?
Ok, I am confused. I do not know what SP-engine is. All I know is that my NVMe driver replies to a geometry query with total number of blocks or CHS values that are valid for the size of the disk. But that MediaToolBox ends up with wrong values which results in the famous red dots as described above.
Quote:
For example the ATA drivers convert LBA48 disk sizes to CHS in the emulated HD_SCSICmd used by SP-Engine.
I don't think SP-Engine changes anything in the CHS values it gets from the device drivers.
As already mentioned in previous post, that is not what happens.
When using MediaToolbox, someone sends a SCSI "READ CAPACITY(10)" command. I'll reply in the 32bit "RETURNED LOGICAL BLOCK ADDRESS" field (and acc SCSI standard) the LBA of the Last logical block (amount of logical blocks-1). Someone translates this into an artifical CHS and this gets displayed in MediaToolBox
In case when the LBA of the last logic block exceeds 0xFFFFFFFE then I will reply this command with 0xFFFFFFFF (also acc. SCSI standard).
The SCSI standard describes that in case the returned value is 0xFFFFFFFF, the caller shall perform the SCSI "READ CAPACITY(16)" command. This is an extended command where the "RETURNED LOGICAL BLOCK ADDRESS" field is 64bit instead of 32bit. And that allows me the return the correct LBA of the last logical block for drives >2TB.
But the callers doesn't perform this SCSI "READ CAPACITY(16)" command when "READ CAPACITY(10)" returns 0xFFFFFFFF.
Instead the caller performs a TD_GetGeometry command. In this query I reply with actificial CHS values that multiply to the correct number of blocks that the >2TB drive supports because the field for the total amount of logical block in TD_GetGeometry is also limited to just 32bit.
Again, someone is doing translation of values returned by the driver and in this case my artificial CHS values are getting translated to some different CHS values that are wrong. These values result in the red dots as described above.
I need to ignore the red dots and manually correct the CHS values so that they multiply to the correct number of logical blocks. MediaToolBox still marks those values as invalid with those red dots but at least it allows me to create partititions that exceed 1.86TB. And those partitions work fine with NGFS.
But if MediaToolBox is just a GUI for "SP-engine" then "SP-engine" is the one that is the caller in my story? And the one creating those artificial CHS values afterall?
I do not intend to say that we need to change the way RDB stores the disk capacity. I said that we need to fix how the size is acquired from the disk in the first place. To prevent those red dots and offer a user friendly way to make >2TB disks work. Because not everybody knows what cylinders Heads and Sectors are and how they relate to the size of a disk.
As for storing capacity, CHS in the current RDB is perfectly fine for me.
You also mention mounter.library. But this library has its own method of aqcuiring disk size and that is TD_GetGeometry64. The returned structure contains a 64bit field for the amount of logical block. Iirc CHS is not even supported for this command
And now for 4k block size support.
Do we need to change the RDB format for that? Or any other components like dos.library? Because the both SCSI "READ CAPACITY (1x)" and TD_GetGeometry allow me to return the logical block size of 4k bytes. MediaToolBox picks up this value correctly (So I assume that "SP-Engine" is fine with them as well).
It's just that MediaToolBox doesn't allow me to create partitions. Everything is greyed out in the partitioning window.
If MediaToolBox is just a GUI then where is the limitation?
Edited by geennaam on 2024/4/10 13:28:40
Edited by geennaam on 2024/4/10 13:31:08