On 24/04/2022 17:49, Mark Cave-Ayland wrote:
> Here are the next set of patches from my ongoing work to allow the q800
> machine to boot MacOS related to SCSI devices.
>
> The first patch implements a dummy FORMAT UNIT command which is used by
> the Apple HD SC Setup program when preparing an empty disk to install
> MacOS.
>
> Patch 2 adds a new quirks bitmap to SCSIDiskState to allow buggy and/or
> legacy features to enabled on an individual device basis. Once the quirks
> bitmap has been added, patch 3 uses the quirks feature to implement an
> Apple-specific mode page which is required to allow the disk to be recognised
> and used by Apple HD SC Setup.
>
> Patch 4 adds compat_props to the q800 machine which enable the new
> MODE_PAGE_APPLE_VENDOR quirk for all scsi-hd devices attached to the machine.
>
> Patch 5 adds a new quirk to force SCSI CDROMs to always return the block
> descriptor for a MODE SENSE command which is expected by A/UX, whilst patch 6
> enables the quirk for all scsi-cd devices on the q800 machine.
>
> Patch 7 adds support for truncated MODE SELECT requests which are sent by
> A/UX (and also MacOS in some circumstances) when enumerating a SCSI CDROM device
> which are shown to be accepted on real hardware as documented in [1].
>
> Patch 8 allows the MODE_PAGE_R_W_ERROR AWRE bit to be changeable since the A/UX
> MODE SELECT request sets this bit to 0 rather than the QEMU default which is 1.
>
> Patch 9 adds support for setting the CDROM block size via a MODE SELECT request
> which is supported by older CDROMs to allow the block size to be changed from
> the default of 2048 bytes to 512 bytes for compatibility purposes. This is used
> by A/UX which otherwise fails with SCSI errors if the block size is not set to
> 512 bytes when accessing CDROMs.
>
> Finally patches 10 and 11 augment the compat_props to set the default vendor,
> product and version information for all scsi-hd and scsi-cd devices attached
> to the q800 machine, taken from real drives. This is because MacOS will only
> allow a known set of SCSI devices to be recognised during the installation
> process.
>
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
>
> [1] https://68kmla.org/bb/index.php?threads/scsi2sd-project-anyone-interested.29040/page-7#post-316444
>
>
> v2:
> - Change patchset title from "scsi: add support for FORMAT UNIT command and quirks"
> to "scsi: add quirks and features to support m68k Macs"
> - Fix missing shift in patch 2 as pointed out by Fam
> - Rename MODE_PAGE_APPLE to MODE_PAGE_APPLE_VENDOR
> - Add SCSI_DISK_QUIRK_MODE_SENSE_ROM_FORCE_DBD quirk
> - Add support for truncated MODE SELECT requests
> - Allow MODE_PAGE_R_W_ERROR AWRE bit to be changeable for CDROM devices
> - Allow the MODE SELECT block descriptor to set the CDROM block size
>
>
> Mark Cave-Ayland (11):
> scsi-disk: add FORMAT UNIT command
> scsi-disk: add new quirks bitmap to SCSIDiskState
> scsi-disk: add MODE_PAGE_APPLE_VENDOR quirk for Macintosh
> q800: implement compat_props to enable quirk_mode_page_apple_vendor
> for scsi-hd devices
> scsi-disk: add SCSI_DISK_QUIRK_MODE_SENSE_ROM_FORCE_DBD quirk for
> Macintosh
> q800: implement compat_props to enable quirk_mode_sense_rom_force_dbd
> for scsi-cd devices
> scsi-disk: allow truncated MODE SELECT requests
> scsi-disk: allow the MODE_PAGE_R_W_ERROR AWRE bit to be changeable for
> CDROM drives
> scsi-disk: allow MODE SELECT block descriptor to set the ROM device
> block size
> q800: add default vendor and product information for scsi-hd devices
> q800: add default vendor and product information for scsi-cd devices
>
> hw/m68k/q800.c | 13 ++++++++++
> hw/scsi/scsi-disk.c | 53 +++++++++++++++++++++++++++++++++++-----
> hw/scsi/trace-events | 3 +++
> include/hw/scsi/scsi.h | 4 +++
> include/scsi/constants.h | 1 +
> 5 files changed, 68 insertions(+), 6 deletions(-)
Ping? Anyone have any further thoughts on this?
ATB,
Mark.