PiSCSI / piscsi

PiSCSI allows a Raspberry Pi to function as emulated SCSI devices (hard disk, CD-ROM, and others) for vintage SCSI-based computers and devices. This is a fork of the RaSCSI project by GIMONS.
https://piscsi.org
BSD 3-Clause "New" or "Revised" License
545 stars 82 forks source link

Make devices to be built configurable #1385

Closed uweseimet closed 1 year ago

uweseimet commented 1 year ago

The C++ code has become modular enough to consider making the devices to support/compile configurable. At least for some devices this is possible by just not compiling the device source file anymore and removing the device instantiation code from the device factory. This has already been tested with the host services device, but this test has not covered also changing the device types reported as available by the remote interface.

Potential approach:

  1. Introduce preprocessor #defines, e.g. WITH_DEVICE or WITHOUT_DEVICE for any device type that is removable.
  2. Grouping devices this way may be useful, e.g. WITH_DISKS builds all disk devices.
  3. Based on these #defines, in the C++ code do not include some header files and do not compile the device factory code instantiating removed devices. Also ensure that the remote interface does not report the removed device types as being supported.
  4. easysetup gives the user a choice which devices to support and runs "make" with the resulting "-D" settings.

Note, though, that one cannot save much compile time with not compiling everything. Mode code is always needed for the disk devices. This is why this ticket may not be worh the effort.

uweseimet commented 1 year ago

@rdmark Do you remember the recent tickets which moved some code from the device factory to the respective devices? Having done that makes implementing this ticket more straightforward.