Skip to content

Commit

Permalink
Release 3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
uweseimet committed Mar 27, 2024
1 parent cca2da4 commit 32f65be
Show file tree
Hide file tree
Showing 182 changed files with 2,537 additions and 3,414 deletions.
47 changes: 0 additions & 47 deletions .github/workflows/analyze_llvm.yml

This file was deleted.

21 changes: 10 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
# What is SCSI2Pi?

SCSI2Pi (or simply just S2P) is an alternative to the <a href="https://github.com/PiSCSI/piscsi" target="blank">PiSCSI software</a> for the PiSCSI/RaSCSI board. It provides an improved SCSI emulation, extendend functionality and new tools for the board's initiator mode. SCSI2Pi is compatible with the PiSCSI web UI and the <a href="https://www.scsi2pi.net/en/app.html" target="blank">SCSI Control app</a>.<br />
SCSI2Pi is an advanced alternative to the <a href="https://github.com/PiSCSI/piscsi" target="blank">PiSCSI software</a> for the PiSCSI/RaSCSI board. It provides an improved SCSI emulation, extendend functionality and new tools for the board's initiator mode. SCSI2Pi is compatible with the PiSCSI web UI and the <a href="https://www.scsi2pi.net/en/app.html" target="blank">SCSI Control app</a>.<br />
You can switch from PiSCSI to SCSI2Pi (or back, if needed) in seconds, simply by installing/de-installing a <a href="https://www.scsi2pi.net/en/downloads.html" target="blank">package with the SCSI2Pi binaries</a>. No time-consuming compilation is required.<br />
SCSI2Pi emulates several SCSI or SASI devices like hard drives, CD-ROM drives, printers or network adapters at the same time. You can easily add a range of devices to computers like 68k Macs, Atari ST/TT/Falcon030, Unix workstations, samplers or other computers with SCSI port. Compared to PiSCSI, SCSI2Pi offers <a href="https://www.scsi2pi.net/en/scsi2pi.html" target="blank">numerous extensions</a>, performance improvements and bug fixes. These add to the extensive changes and new features I contributed to the PiSCSI project in the past.<br />
SCSI2Pi was chosen as the name for this project because there are not that many choices left for names that contain both "SCSI" and "Pi" ;-).
SCSI2Pi emulates several SCSI or SASI devices like hard drives, CD-ROM drives, printers or network adapters at the same time. You can easily add a range of devices to computers like 68k Macs, Atari ST/TT/Falcon030, Amiga, Unix workstations, samplers or other computers with SCSI port. Compared to PiSCSI, SCSI2Pi offers <a href="https://www.scsi2pi.net/en/scsi2pi.html" target="blank">numerous extensions</a>, performance improvements, smaller and highly optimized binaries, and bug fixes. These add to the extensive changes and new features I contributed to the PiSCSI project in the past.

# How is SCSI2Pi related to PiSCSI?
# Who am I?

In the PiSCSI project there was not much interest in replacing old, often buggy or unnecessary code, or to improve the throughput. In addition, code reviewers were missing, which resulted in a rather long PR backlog, slowing down the development process. Developing software without being able to publish the results is not much fun. Further, long promised features on the PiSCSI roadmap and in tickets have not been addressed. This is why I decided to work on the emulation backend in a separate project. The major part of the PiSCSI C++ codebase has been contributed by me anyway.<br />
There was also no interest in further developing the SCSI emulation and exploiting the initiator mode feature of the FULLSPEC board. This mode, together with new SCSI2Pi command line tools, offers solutions for use cases that have never been addressed before. These tools also help with advanced testing.
In the past I was the main contributor for the PiSCSI SCSI emulation. I revised the backend architecture, added a remote interface and re-engineered most of the legacy C++ code. The code was updated to C++-20, which is the latest C++ standard you can currently use on the Pi. All in all this resulted in more modular code and drastically improved <a href="https://sonarcloud.io/project/overview?id=uweseimet_scsi2pi" target="blank">SonarQube code metrics</a>. Besides adding numerous <a href="https://www.scsi2pi.net/en/scsi2pi.html" target="blank">new features</a> and improving the compatibility with many platforms, I also fixed a range of bugs in the legacy codebase and added an extensive set of unit tests.<br />
I am also the author of the <a href="https://www.scsi2pi.net/en/app.html" target="blank">SCSI Control app</a> for Android, which is the remote control for your PiSCSI/RaSCSI boards. SCSI Control supports both SCSI2Pi and PiSCSI. The full range of app features requires SCSI2Pi, though.

# Who am I?
# How is SCSI2Pi related to PiSCSI?

In the past I was the main contributor for the PiSCSI emulation backend. I revised the backend architecture, added a remote interface and re-engineered most of the legacy C++ code. The code was updated to C++-20, which is the latest C++ standard you can currently use on the Pi. All in all this resulted in more modular code and drastically improved the <a href="https://sonarcloud.io/project/overview?id=uweseimet_scsi2pi" target="blank">SonarQube code metrics</a>. Besides adding numerous <a href="https://www.scsi2pi.net/en/scsi2pi.html" target="blank">new features</a> and improving the compatibility with many platforms, I also fixed a range of bugs in the legacy codebase and added an extensive set of unit tests.<br />
I am also the author of the <a href="https://www.scsi2pi.net/en/app.html" target="blank">SCSI Control app</a> for Android, which is the remote control for your PiSCSI/RaSCSI boards. SCSI Control supports both SCSI2Pi and PiSCSI. I also develop the <a href="https://www.hddriver.net" target="blank">HDDRIVER driver package</a> and tools for Atari 32 bit computers.
In the PiSCSI project there was not much interest in replacing old, often buggy or unnecessary code, or to improve the data transfer rates. In addition, code reviewers were missing, which resulted in a rather long PR backlog, slowing down the development process. Unfortunately long promised features on the PiSCSI roadmap and user requests in tickets have not been addressed. This is why I decided to work on the emulation in a separate project, while staying compatible with the PiSCSI web interface. The major part of the PiSCSI C++ codebase has been contributed by me anyway.<br />
There was also not much interest in further developing the SCSI emulation and exploiting the initiator mode feature of the FULLSPEC board. This mode, together with new SCSI2Pi command line tools, offers solutions for use cases that have never been addressed before. These tools also help with advanced testing, making the emulation more robust and reliable.

# SCSI2Pi goals

SCSI2Pi is not meant to completely replace the PiSCSI software, but only the actual SCSI/SASI emulation and the tools. For the PiSCSI project great work is still being done on the web interface, and on supporting users in social media. SCSI2Pi also addresses compatibility issues.<br />
There is no support for the X68000 platform, in particular not for the host bridge (SCBR) device. In PiSCSI the related code has always been in a bad shape, and nobody has been willing to test it. The other PiSCSI features (and more) are supported by SCSI2Pi - many of these I implemented anyway ;-).
SCSI2Pi is not meant to completely replace the PiSCSI software, but only the device emulation and the tools. For the PiSCSI project great work is still being done on the web interface, and on supporting users in social media.<br />
There is no SCSI2Pi support for the X68000 platform, in particular not for the host bridge (SCBR) device. In PiSCSI the respective code has always been in a bad shape, and nobody has been interested in testing it. The other PiSCSI features (and many more) are supported by SCSI2Pi - most of these I implemented anyway ;-).

# SCSI2Pi website

Expand Down
5 changes: 3 additions & 2 deletions cpp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ ifeq ("$(shell uname -s)", "Linux")
endif

ifeq ("$(shell uname -s)", "FreeBSD")
AR = ar
AR = $(CROSS_COMPILE)ar
CXXFLAGS += -fexperimental-library -I/usr/local/include -Wno-unused-parameter
endif

ifeq ("$(shell uname -s)", "NetBSD")
AR = ar
AR = $(CROSS_COMPILE)ar
CXXFLAGS += -I/usr/pkg/include -Wno-unused-parameter -Wno-macro-redefined
endif

Expand Down Expand Up @@ -373,6 +373,7 @@ install: $(BINARIES)
$(INSTALL_BIN)%: $(BINDIR)/%
mkdir -p $(INSTALL_BIN)
cp $< $@



## help Lists information about how to use the Makefile
Expand Down
12 changes: 5 additions & 7 deletions cpp/base/device.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//---------------------------------------------------------------------------
//
// SCSI target emulator and SCSI tools for the Raspberry Pi
// SCSI device emulator and SCSI tools for the Raspberry Pi
//
// Copyright (C) 2021-2024 Uwe Seimet
//
//---------------------------------------------------------------------------

#include <spdlog/spdlog.h>
#include <stdexcept>
#include <spdlog/spdlog.h>
#include "shared/s2p_version.h"
#include "device.h"

Expand Down Expand Up @@ -47,12 +47,10 @@ void Device::SetProduct(const string &p, bool force)
throw invalid_argument("Product '" + p + "' must have between 1 and 16 characters");
}

// Changing vital product data is not SCSI compliant
if (!product.empty() && !force) {
return;
// Changing existing vital product data is not SCSI compliant
if (product.empty() || force) {
product = p;
}

product = p;
}

void Device::SetRevision(const string &r)
Expand Down
12 changes: 6 additions & 6 deletions cpp/base/device.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
//---------------------------------------------------------------------------
//
// SCSI target emulator and SCSI tools for the Raspberry Pi
// SCSI device emulator and SCSI tools for the Raspberry Pi
//
// Copyright (C) 2021-2024 Uwe Seimet
//
//---------------------------------------------------------------------------

#pragma once

#include <unordered_map>
#include "generated/s2p_interface.pb.h"
#include "shared/s2p_util.h"

Expand Down Expand Up @@ -43,6 +42,11 @@ class Device // NOSONAR The number of fields and methods is justified, the compl
}
virtual void Reset();

void SetReset(bool b)
{
reset = b;
}

bool IsProtectable() const
{
return protectable;
Expand Down Expand Up @@ -157,10 +161,6 @@ class Device // NOSONAR The number of fields and methods is justified, the compl
{
return reset;
}
void SetReset(bool b)
{
reset = b;
}
bool IsAttn() const
{
return attn;
Expand Down
2 changes: 1 addition & 1 deletion cpp/base/device_factory.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//---------------------------------------------------------------------------
//
// SCSI target emulator and SCSI tools for the Raspberry Pi
// SCSI device emulator and SCSI tools for the Raspberry Pi
//
// Copyright (C) 2021-2023 Uwe Seimet
//
Expand Down
3 changes: 1 addition & 2 deletions cpp/base/device_factory.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//---------------------------------------------------------------------------
//
// SCSI target emulator and SCSI tools for the Raspberry Pi
// SCSI device emulator and SCSI tools for the Raspberry Pi
//
// Copyright (C) 2021-2024 Uwe Seimet
//
Expand All @@ -13,7 +13,6 @@
#include <unordered_map>
#include "primary_device.h"
#include "generated/s2p_interface.pb.h"
#include "shared/s2p_util.h"

using namespace std;
using namespace s2p_interface;
Expand Down
7 changes: 6 additions & 1 deletion cpp/base/device_logger.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//---------------------------------------------------------------------------
//
// SCSI target emulator and SCSI tools for the Raspberry Pi
// SCSI device emulator and SCSI tools for the Raspberry Pi
//
// Copyright (C) 2022-2024 Uwe Seimet
//
Expand All @@ -20,6 +20,11 @@ void DeviceLogger::Debug(const string &message) const
Log(level::debug, message);
}

void DeviceLogger::Info(const string &message) const
{
Log(level::info, message);
}

void DeviceLogger::Warn(const string &message) const
{
Log(level::warn, message);
Expand Down
3 changes: 2 additions & 1 deletion cpp/base/device_logger.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//---------------------------------------------------------------------------
//
// SCSI target emulator and SCSI tools for the Raspberry Pi
// SCSI device emulator and SCSI tools for the Raspberry Pi
//
// Copyright (C) 2022-2024 Uwe Seimet
//
Expand All @@ -19,6 +19,7 @@ class DeviceLogger

void Trace(const string&) const;
void Debug(const string&) const;
void Info(const string&) const;
void Warn(const string&) const;
void Error(const string&) const;

Expand Down
2 changes: 1 addition & 1 deletion cpp/base/interfaces/scsi_block_commands.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//---------------------------------------------------------------------------
//
// SCSI target emulator and SCSI tools for the Raspberry Pi
// SCSI device emulator and SCSI tools for the Raspberry Pi
//
// Copyright (C) 2021-2022 Uwe Seimet
//
Expand Down
2 changes: 1 addition & 1 deletion cpp/base/interfaces/scsi_communications_commands.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//---------------------------------------------------------------------------
//
// SCSI target emulator and SCSI tools for the Raspberry Pi
// SCSI device emulator and SCSI tools for the Raspberry Pi
//
// Copyright (C) 2024 Uwe Seimet
//
Expand Down
2 changes: 1 addition & 1 deletion cpp/base/interfaces/scsi_mmc_commands.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//---------------------------------------------------------------------------
//
// SCSI target emulator and SCSI tools for the Raspberry Pi
// SCSI device emulator and SCSI tools for the Raspberry Pi
//
// Copyright (C) 2021-2022 Uwe Seimet
//
Expand Down
2 changes: 1 addition & 1 deletion cpp/base/interfaces/scsi_primary_commands.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//---------------------------------------------------------------------------
//
// SCSI target emulator and SCSI tools for the Raspberry Pi
// SCSI device emulator and SCSI tools for the Raspberry Pi
//
// Copyright (C) 2021-2022 Uwe Seimet
//
Expand Down
9 changes: 4 additions & 5 deletions cpp/base/interfaces/scsi_printer_commands.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//---------------------------------------------------------------------------
//
// SCSI target emulator and SCSI tools for the Raspberry Pi
// SCSI device emulator and SCSI tools for the Raspberry Pi
//
// Copyright (C) 2021-2022 Uwe Seimet
// Copyright (C) 2021-2024 Uwe Seimet
//
// Interface for SCSI printer commands (see SCSI-2 specification)
//
Expand All @@ -20,7 +20,6 @@ class ScsiPrinterCommands

// Mandatory commands
virtual void Print() = 0;
virtual void ReleaseUnit() = 0;
virtual void ReserveUnit() = 0;
virtual void SendDiagnostic() = 0;

// ReleaseUnit(), ReserveUnit() and SendDiagnostic() are contributed by PrimaryDevice
};
2 changes: 1 addition & 1 deletion cpp/base/memory_util.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//---------------------------------------------------------------------------
//
// SCSI target emulator and SCSI tools for the Raspberry Pi
// SCSI device emulator and SCSI tools for the Raspberry Pi
//
// Copyright (C) 2022-2023 Uwe Seimet
//
Expand Down
2 changes: 1 addition & 1 deletion cpp/base/memory_util.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//---------------------------------------------------------------------------
//
// SCSI target emulator and SCSI tools for the Raspberry Pi
// SCSI device emulator and SCSI tools for the Raspberry Pi
//
// Copyright (C) 2022-2024 Uwe Seimet
//
Expand Down
Loading

0 comments on commit 32f65be

Please sign in to comment.