Skip to content

Pass through SCSI commands to the Linux SG driver #497

Description

@uweseimet

RaSCSI should support passing received SCSI commands to the Linux SG (generic SCSI) driver, see http://sg.danny.cz/sg/sg_v40.html. This driver supports numerous device types, including non-SCSI devices. By passing commands to this driver any device supported by the SG driver could be directly exposed as SCSI device to RaSCSI clients. Vintage computers would be able to access USB (and other) devices this way.

There is already an implementation for Atari software emulators (Hatari and ARAnyM), see https://github.com/hatari/hatari/blob/master/src/nf_scsidrv.c. This approach enables Atari software running within the emulations to directly access devices connected to the Linux host. From the Atari perspective all devices appear to be SCSI devices but can be anything supported by the SG driver. This is similar to the device pass through feature of VirtualBox.

It has been verified (with a USB drive) that the SG driver is working fine on the Pi when using Raspberry Pi OS bullseye 64 bit.

An extension for RaSCSI would likely be a new controller and not a new device type, because the SG driver is device-independent. When creating such a device the SG driver's device file would have to be specified, e.g.

>rascsi -ID 5 -t schd /dev/sg0 -ID 6 -t sccd /dev/sg2

Based on the filename it is clear that this is an SG driver mapping, so that the respective controller can be used. In the example above the devices are a SCSI hard disk drive managed as /dev/sg0 and a CD-ROM driver managed as /dev/sg2.

Note that media changes may be an issue, because these are automatically handled by udev.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions