All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/11] scsi: add quirks and features to support m68k Macs
@ 2022-04-24 16:49 Mark Cave-Ayland
  2022-04-24 16:49 ` [PATCH v2 01/11] scsi-disk: add FORMAT UNIT command Mark Cave-Ayland
                   ` (11 more replies)
  0 siblings, 12 replies; 25+ messages in thread
From: Mark Cave-Ayland @ 2022-04-24 16:49 UTC (permalink / raw)
  To: pbonzini, laurent, fam, qemu-devel, qemu-block

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(-)

-- 
2.20.1



^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2022-05-30 21:05 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-24 16:49 [PATCH v2 00/11] scsi: add quirks and features to support m68k Macs Mark Cave-Ayland
2022-04-24 16:49 ` [PATCH v2 01/11] scsi-disk: add FORMAT UNIT command Mark Cave-Ayland
2022-05-25 22:01   ` Laurent Vivier
2022-04-24 16:49 ` [PATCH v2 02/11] scsi-disk: add new quirks bitmap to SCSIDiskState Mark Cave-Ayland
2022-05-26 12:26   ` Laurent Vivier
2022-04-24 16:49 ` [PATCH v2 03/11] scsi-disk: add MODE_PAGE_APPLE_VENDOR quirk for Macintosh Mark Cave-Ayland
2022-05-26 12:50   ` Laurent Vivier
2022-04-24 16:49 ` [PATCH v2 04/11] q800: implement compat_props to enable quirk_mode_page_apple_vendor for scsi-hd devices Mark Cave-Ayland
2022-05-26 12:25   ` Laurent Vivier
2022-04-24 16:49 ` [PATCH v2 05/11] scsi-disk: add SCSI_DISK_QUIRK_MODE_SENSE_ROM_FORCE_DBD quirk for Macintosh Mark Cave-Ayland
2022-04-24 16:49 ` [PATCH v2 06/11] q800: implement compat_props to enable quirk_mode_sense_rom_force_dbd for scsi-cd devices Mark Cave-Ayland
2022-05-26 12:25   ` Laurent Vivier
2022-04-24 16:49 ` [PATCH v2 07/11] scsi-disk: allow truncated MODE SELECT requests Mark Cave-Ayland
2022-05-26 12:06   ` Paolo Bonzini
2022-05-30 21:00     ` Mark Cave-Ayland
2022-04-24 16:49 ` [PATCH v2 08/11] scsi-disk: allow the MODE_PAGE_R_W_ERROR AWRE bit to be changeable for CDROM drives Mark Cave-Ayland
2022-04-24 16:49 ` [PATCH v2 09/11] scsi-disk: allow MODE SELECT block descriptor to set the ROM device block size Mark Cave-Ayland
2022-05-26 12:08   ` Paolo Bonzini
2022-05-30 21:03     ` Mark Cave-Ayland
2022-04-24 16:49 ` [PATCH v2 10/11] q800: add default vendor and product information for scsi-hd devices Mark Cave-Ayland
2022-05-26 12:22   ` Laurent Vivier
2022-04-24 16:49 ` [PATCH v2 11/11] q800: add default vendor and product information for scsi-cd devices Mark Cave-Ayland
2022-05-26 12:22   ` Laurent Vivier
2022-05-18 14:16 ` [PATCH v2 00/11] scsi: add quirks and features to support m68k Macs Mark Cave-Ayland
2022-05-26 12:09   ` Paolo Bonzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.