uweseimet / scsi2pi

Advanced performant SCSI/SASI emulation and tools for the PiSCSI/RaSCSI board
https://www.scsi2pi.net
BSD 3-Clause "New" or "Revised" License
10 stars 2 forks source link

Support BlueSCSI compatibility mode for names of drive image files #23

Closed uweseimet closed 10 months ago

uweseimet commented 10 months ago

BlueSCSI codes drive properties in the name of the image files. While the command line approach of SCSI2Pi/PiSCSI is more flexible it would be useful to have a compatibility mode with the same parsing rules as those used by BlueSCSI, see https://github.com/BlueSCSI/BlueSCSI-v2/wiki/Usage. In this mode you can directly use existing BlueSCSI image files for SCSI2Pi without having to provide a full set of SCSI2Pi command line options. A new device-specific s2p option "-B" shall switch to the compatiblity mode when parsing the data for the respective device. With this option s2p takes the drive parameters from the filename.

Instead of

>s2p -i 0:2 -b 1024 -n vendor:product:revision test.hds

you can also use an image file with a filename in BlueSCSI format:

>s2p -B HD02_1024_vendor:product:revision.hds

Note that there is a separator "_" between the sector size and the product data. If this separator is missing the string after the block size is ignored, because BlueSCSI permits any string between the block size and the extension. Without the "_" marker s2p cannot know whether to parse this string as product data or not. The existing s2p command line options shall override the settings taken from the filename:

>s2p -B -i 2 HD10_1024.hds

This command assigns the drive a SCSI ID of 2, because "-i" overrides the SCSI ID 1 coded in the filename.

>s2p -B -h 2 HD10_1024.hds

Same as above, but for a SASI instead of a SCSI drive. While BlueSCSI does not make use of the LUN number in a filename, SCSI2Piuses it.

>s2p -B HD10.hds -B CD131.hds -B RE11.hds

This results in a SCSI hard drive with SCSI ID 1, LUN 0, a CD-ROM drive with SCSI ID 1, LUN 31 and a removable media drive with SCSI ID1, Lun1.

uweseimet commented 10 months ago

@erichelgeson I would appreciate your feedback on this ticket. The proposed parsing rules would also make use of the LUN field, which appears to be unused in BlueSCSI. They also use the unused (in BlueSCSI) text between the sector size and the extension as the INQUIRY product data. Would you expect potential compatibility issues with future BlueSCSI versions?

uweseimet commented 10 months ago

The issue_23 branch now contains unit-tested support for this compatibility mode.

uweseimet commented 10 months ago

Merged into develop branch

erichelgeson commented 10 months ago

My 2c adding vendor/product/version is not needed. The "presets" we have defined would be a better option as there are usually other things that need to be set to be compatible with different host systems .

uweseimet commented 10 months ago

@erichelgeson Thank you for your feedback. As far as the SCSI2Pi compatibility mode is concerned only the filenames matter for this mode. This is not about further compatibility. Any other BlueSCSI configuration mechanism would be out of scope for SCSI2PI, which has its own configuration mechanism for defining custom mode pages etc. The option of having the product data in the filename would just be something I think is convenient, because SCSI ID/LUN, sector size and product name are the most frequent configuration properties as far as I can tell.