Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass through SCSI commands to the Linux SG driver #497

Closed
uweseimet opened this issue Nov 30, 2021 · 1 comment
Closed

Pass through SCSI commands to the Linux SG driver #497

uweseimet opened this issue Nov 30, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@uweseimet
Copy link
Contributor

uweseimet commented Nov 30, 2021

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.

@uweseimet
Copy link
Contributor Author

Closing this ticket, because there are no resources for tickets like this. Can be re-opened if this changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant