[PATCH 0/6] scsi: add support for FORMAT UNIT command and quirks

Mark Cave-Ayland posted 6 patches 2 years ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20220421065155.31276-1-mark.cave-ayland@ilande.co.uk
Maintainers: Laurent Vivier <laurent@vivier.eu>, Paolo Bonzini <pbonzini@redhat.com>, Fam Zheng <fam@euphon.net>
hw/m68k/q800.c           | 12 ++++++++++++
hw/scsi/scsi-disk.c      | 24 ++++++++++++++++++++++++
hw/scsi/trace-events     |  1 +
include/hw/scsi/scsi.h   |  3 +++
include/scsi/constants.h |  1 +
5 files changed, 41 insertions(+)
[PATCH 0/6] scsi: add support for FORMAT UNIT command and quirks
Posted by Mark Cave-Ayland 2 years ago
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.

Patches 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 MODE_PAGE_APPLE
quirk for all scsi-hd devices attached to the machine.

Finally patches 5 and 6 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>


Mark Cave-Ayland (6):
  scsi-disk: add FORMAT UNIT command
  scsi-disk: add new quirks bitmap to SCSIDiskState
  scsi-disk: add MODE_PAGE_APPLE quirk for Macintosh
  q800: implement compat_props to enable quirk_mode_page_apple for
    scsi-hd devices
  q800: add default vendor, product and version information for scsi-hd
    devices
  q800: add default vendor, product and version information for scsi-cd
    devices

 hw/m68k/q800.c           | 12 ++++++++++++
 hw/scsi/scsi-disk.c      | 24 ++++++++++++++++++++++++
 hw/scsi/trace-events     |  1 +
 include/hw/scsi/scsi.h   |  3 +++
 include/scsi/constants.h |  1 +
 5 files changed, 41 insertions(+)

-- 
2.20.1
Re: [PATCH 0/6] scsi: add support for FORMAT UNIT command and quirks
Posted by Mark Cave-Ayland 2 years ago
On 21/04/2022 07:51, 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.
> 
> Patches 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 MODE_PAGE_APPLE
> quirk for all scsi-hd devices attached to the machine.
> 
> Finally patches 5 and 6 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>
> 
> 
> Mark Cave-Ayland (6):
>    scsi-disk: add FORMAT UNIT command
>    scsi-disk: add new quirks bitmap to SCSIDiskState
>    scsi-disk: add MODE_PAGE_APPLE quirk for Macintosh
>    q800: implement compat_props to enable quirk_mode_page_apple for
>      scsi-hd devices
>    q800: add default vendor, product and version information for scsi-hd
>      devices
>    q800: add default vendor, product and version information for scsi-cd
>      devices
> 
>   hw/m68k/q800.c           | 12 ++++++++++++
>   hw/scsi/scsi-disk.c      | 24 ++++++++++++++++++++++++
>   hw/scsi/trace-events     |  1 +
>   include/hw/scsi/scsi.h   |  3 +++
>   include/scsi/constants.h |  1 +
>   5 files changed, 41 insertions(+)

I was fortunate enough to find a really good reference to some work done over on 
68mla.org reverse engineering Apple's HD SC Setup and SCSI device detection. This 
pointed me towards a couple of additional SCSI changes for QEMU that also fix CDROM 
access under A/UX which I shall include in an updated v2.


ATB,

Mark.