Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cpp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ $(MAN_PAGE_DIR)/%.1 : $(DOC_DIR)/%.1 | $(MAN_PAGE_DIR)/
$(DOC_DIR)/%_man_page.txt : $(DOC_DIR)/%.1
@echo "!! ------ THIS FILE IS AUTO_GENERATED! DO NOT MANUALLY UPDATE!!!" > $@
@echo "!! ------ The native file is $(notdir $<). Re-run 'make docs' after updating\n\n" >> $@
man -l $< | col -bx >> $@
MANWIDTH=80 man -l $< | col -bx >> $@

$(SYSTEMD_CONF) : $(OS_FILES)/$(notdir $(SYSTEMD_CONF))
@echo "-- Copying $@"
Expand Down
11 changes: 4 additions & 7 deletions doc/piscsi.1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.Dd December 18, 2025
.Dt PISCSI 1
.Os
.Os PiSCSI
.Sh NAME
.Nm piscsi
.Nd Emulates SCSI devices using the Raspberry Pi GPIO pins
Expand Down Expand Up @@ -57,15 +57,14 @@ If the file extension is not recognized, the device type can be specified explic
.Pp
For example, if you want to specify an Apple-compatible HD image on ID 0, you can use the following command:
sudo piscsi -ID0 /path/to/drive/hdimage.hda

.Pp
Note: PiSCSI is a fork of RaSCSI. The two cannot be run in parallel on the same system.

.Pp
Once PiSCSI starts, it will open a socket (default port is 6868) to allow external management commands.
If another process is using this port, PiSCSI will terminate, since it is likely another instance of PiSCSI or RaSCSI.
Once PiSCSI has initialized, the scsictl utility can be used to send commands.

.Pp
To quit PiSCSI, press Control + C. If it is running in the background, you can kill it using an INT signal.

.Sh OPTIONS
.Bl -tag -width Ds
.It Fl b Ar BLOCK_SIZE
Expand Down Expand Up @@ -99,7 +98,6 @@ n is the SCSI ID number (0-7). u (0-31) is the optional LUN (logical unit). The
.Pp
FILE is the name of the image file to use for a SCSI mass storage device. For devices that do not support an image file (SCDP, SCLP, SCHS) the filename may have a special meaning or a dummy name can be provided. For SCDP it is a prioritized list of network interfaces with an IP address and netmask, e.g. "interface=eth0,eth1,wlan0:inet=10.10.20.1/24". For SCLP it is the print command to be used and a reservation timeout in seconds, e.g. "cmd=lp -oraw %f:timeout=60".
.El

.Sh EXAMPLES
Launch PiSCSI with no emulated drives attached:
.Dl Nm piscsi
Expand All @@ -115,7 +113,6 @@ To create an empty, 100MiB HD image, use the following command:
.Pp
In case the fallocate command is available a much faster alternative to the dd command is:
.Dl fallocate -l 104857600 /path/to/newimage.hda

.Sh SEE ALSO
.Xr scsictl 1 ,
.Xr scsimon 1 ,
Expand Down
218 changes: 121 additions & 97 deletions doc/piscsi_man_page.txt
Original file line number Diff line number Diff line change
@@ -1,151 +1,175 @@
!! ------ THIS FILE IS AUTO_GENERATED! DO NOT MANUALLY UPDATE!!!
!! ------ The native file is piscsi.1. Re-run 'make docs' after updating\n\n
piscsi(1) General Commands Manual piscsi(1)
!! ------ The native file is piscsi.1. Re-run 'make docs' after updating


PISCSI(1) General Commands Manual PISCSI(1)

NAME
piscsi - Emulates SCSI devices using the Raspberry Pi GPIO pins
piscsi Emulates SCSI devices using the Raspberry Pi GPIO pins

SYNOPSIS
piscsi [-F FOLDER] [-L LOG_LEVEL[:ID:[LUN]]] [-P ACCESS_TOKEN_FILE] [-R
SCAN_DEPTH] [-h] [-n VENDOR:PRODUCT:REVISION] [-p PORT] [-r RE‐
SERVED_IDS] [-n TYPE] [-v] [-z LOCALE] [-IDn:[u] FILE] [-HDn[:u]
FILE]...
piscsi [-b BLOCK_SIZE] [-F FOLDER] [-L LOG_LEVEL[: ID[: LUN]]]
[-n VENDOR:PRODUCT:REVISION] [-P ACCESS_TOKEN_FILE] [-p PORT]
[-R SCAN_DEPTH] [-r RESERVED_IDS] [-s MICROSECONDS] [-t TYPE]
[-z LOCALE] [-IDn[:u] FILE] [-HDn[:u] FILE ...]
piscsi [-h]
piscsi [-v]

DESCRIPTION
piscsi emulates SCSI devices using the Raspberry Pi GPIO pins.

In the arguments to PiSCSI, one or more SCSI (-IDn[:u]) devices can be
specified. The number (n) after the ID or HD identifier specifies the
ID number for that device. The optional number (u) specifies the LUN
(logical unit) for that device. The default LUN is 0. For SCSI: The ID
is limited from 0-7. However, typically SCSI ID 7 is reserved for the
In the arguments to PiSCSI, one or more SCSI (-IDn[:u]) devices can be
specified. The number (n) after the ID or HD identifier specifies the
ID number for that device. The optional number (u) specifies the LUN
(logical unit) for that device. The default LUN is 0. For SCSI: The ID
is limited from 0-7. However, typically SCSI ID 7 is reserved for the
"initiator" (the host computer). The LUN is limited from 0-31.

PiSCSI will determine the type of device based upon the file extension
PiSCSI will determine the type of device based upon the file extension
of the FILE argument.
hd1: SCSI Hard Disk image (generic, non-removable, SCSI-1)
hds: SCSI Hard Disk image (generic, non-removable)
hdr: SCSI Hard Disk image (generic, removable)
hdn: SCSI Hard Disk image (NEC compatible - only used with PC-98
hds: Hard Disk image (generic, non-removable)
hd1: Hard Disk image (generic, non-removable, SCSI-1 compatibility
mode)
hdr: Hard Disk image (generic, removable)
hdn: Hard Disk image (NEC compatible - only used with PC-98 comput‐
ers)
hdi: Hard Disk image (Anex86 proprietary - only used with PC-98 com‐
puters)
nhd: Hard Disk image (T98Next proprietary - only used with PC-98
computers)
hdi: SCSI Hard Disk image (Anex86 proprietary - only used with
PC-98 computers)
nhd: SCSI Hard Disk image (T98Next proprietary - only used with
PC-98 computers)
hda: SCSI Hard Disk image (Apple compatible - typically used with
Macintosh computers)
mos: SCSI Magneto-Optical image (generic - typically used with
NeXT, X68000, etc.)
iso: SCSI CD-ROM or DVD-ROM image (ISO 9660 image)
is1: SCSI CD-ROM or DVD-ROM image (ISO 9660 image, SCSI-1)

For example, if you want to specify an Apple-compatible HD image on ID
hda: Hard Disk image (Apple compatible - typically used with Macin‐
tosh computers)
mos: Magneto-Optical image (generic - typically used with NeXT,
X68000, etc.)
iso: CD-ROM or DVD-ROM image (ISO 9660 image)
is1: CD-ROM or DVD-ROM image (ISO 9660 image, SCSI-1 compatibility
mode)
tap: Tape image (raw tape image containing non-block data)
tar: Tape archive (tape block data in tar format)

If the file extension is not recognized, the device type can be speci‐
fied explicitly using the -t option and a four letter code.
SCCD: SCSI CD-ROM (generic CD-ROM or DVD-ROM drive)
SCDP: SCSI DaynaPort (DaynaPort compatible network adapter)
SCHD: SCSI Hard Disk (generic, non-removable)
SCHS: SCSI Host Services (used for special host services)
SCLP: SCSI Printer (generic line printer)
SCMO: SCSI Magneto-Optical Drive (generic MO drive)
SCRM: SCSI Removable Hard Disk (generic, removable)
SCTP: SCSI Tape Drive (generic tape, or streamer, drive)

For example, if you want to specify an Apple-compatible HD image on ID
0, you can use the following command:
sudo piscsi -ID0 /path/to/drive/hdimage.hda

Note: PiSCSI is a fork of RaSCSI. The two cannot be run in parallel on
Note: PiSCSI is a fork of RaSCSI. The two cannot be run in parallel on
the same system.

Once PiSCSI starts, it will open a socket (default port is 6868) to al‐
low external management commands. If another process is using this
port, PiSCSI will terminate, since it is likely another instance of
PiSCSI or RaSCSI. Once PiSCSI has initialized, the scsictl utility can
Once PiSCSI starts, it will open a socket (default port is 6868) to al‐
low external management commands. If another process is using this
port, PiSCSI will terminate, since it is likely another instance of
PiSCSI or RaSCSI. Once PiSCSI has initialized, the scsictl utility can
be used to send commands.

To quit PiSCSI, press Control + C. If it is running in the background,
To quit PiSCSI, press Control + C. If it is running in the background,
you can kill it using an INT signal.

OPTIONS
-b BLOCK_SIZE
The optional block size, either 512, 1024, 2048 or 4096 bytes.
Default size is 512 bytes.
The optional block size, either 512, 1024, 2048 or 4096 bytes.
Default size is 512 bytes.

-F FOLDER
The default folder for image files. For files in this folder no
absolute path needs to be specified. The initial default folder
is '~/images'.
The default folder for image files. For files in this folder no
absolute path needs to be specified. The initial default folder
is '~/images'.

-L LOG_LEVEL[:ID:[LUN]]
The piscsi log level (trace, debug, info, warning, error, off).
The default log level is 'info' for all devices unless a partic‐
ular device ID and an optional LUN was provided.
-h Show a help page.

-P ACCESS_TOKEN_FILE
Enable authentication and read the access token from the speci‐
fied file. The access token file must be owned by root and must
be readable by root only.

-R SCAN_DEPTH
Scan for image files recursively, up to a depth of SCAN_DEPTH.
Depth 0 means to ignore any folders within the default image
filder. Be careful when using this option with many sub-folders
in the default image folder. The default depth is 1.

-h Show a help page.
-L LOG_LEVEL[: ID[: LUN]]
The piscsi log level (trace, debug, info, warning, error, off).
The default log level is 'info' for all devices unless a partic‐
ular device ID and an optional LUN was provided.

-n VENDOR:PRODUCT:REVISION
Set the vendor, product and revision for the device, to be re‐
turned with the INQUIRY data. A complete set of name components
must be provided. VENDOR may have up to 8, PRODUCT up to 16, RE‐
VISION up to 4 characters. Padding with blanks to the maxium
length is automatically applied. Once set the name of a device
cannot be changed.
Set the vendor, product and revision for the device, to be re‐
turned with the INQUIRY data. A complete set of name components
must be provided. VENDOR may have up to 8, PRODUCT up to 16, RE‐
VISION up to 4 characters. Padding with blanks to the maxium
length is automatically applied. Once set the name of a device
cannot be changed.

-P ACCESS_TOKEN_FILE
Enable authentication and read the access token from the speci‐
fied file. The access token file must be owned by root and must
be readable by root only.

-p PORT
The piscsi server port, default is 6868.
The piscsi server port, default is 6868.

-r RESERVED_IDS
Comma-separated list of IDs to reserve. Pass an empty list in
order to not reserve anything. -p TYPE The optional case-insen‐
sitive device type (SAHD, SCHD, SCRM, SCCD, SCMO, SCBR, SCDP,
SCLP, SCHS). If no type is specified for devices that support an
image file, piscsi tries to derive the type from the file exten‐
sion.
-R SCAN_DEPTH
Scan for image files recursively, up to a depth of SCAN_DEPTH.
Depth 0 means to ignore any folders within the default image
folder. Be careful when using this option with many sub-folders
in the default image folder. The default depth is 1.

-v Display the piscsi version.
-r RESERVED_IDS
Comma-separated list of IDs to reserve. Pass an empty list in
order to not reserve anything.

-z LOCALE
Overrides the default locale for client-faces error messages.
The client can override the locale.
-s MICROSECONDS
Minimum execution time for SCSI commands in microseconds. De‐
fault is 50. Higher values may be needed for some older SCSI
initiators to work properly.

-IDn[:u] FILE
n is the SCSI ID number (0-7). u (0-31) is the optional LUN
(logical unit). The default LUN is 0.
-t TYPE
The optional case-insensitive device type (see list of type
codes above). If no type is specified for devices that support
an image file, piscsi tries to derive the type from the file ex‐
tension.

FILE is the name of the image file to use for the SCSI device.
For devices that do not support an image file (SCBR, SCDP, SCLP,
SCHS) the filename may have a special meaning or a dummy name
can be provided. For SCBR and SCDP it is an optioinal priori‐
tized list of network interfaces, an optional IP address and
netmask, e.g. "interface=eth0,eth1,wlan0:inet=10.10.20.1/24".
For SCLP it is the print command to be used and a reservation
timeout in seconds, e.g. "cmd=lp -oraw %f:timeout=60".
-v Display the piscsi version.

FILE is the name of the image file to use for the SCSI device.
-z LOCALE
Sets the default locale for client-facing error messages. The
client can override the locale.

-ID n[: u] FILE
n is the SCSI ID number (0-7). u (0-31) is the optional LUN
(logical unit). The default LUN is 0.

FILE is the name of the image file to use for a SCSI mass stor‐
age device. For devices that do not support an image file (SCDP,
SCLP, SCHS) the filename may have a special meaning or a dummy
name can be provided. For SCDP it is a prioritized list of net‐
work interfaces with an IP address and netmask, e.g. "inter‐
face=eth0,eth1,wlan0:inet=10.10.20.1/24". For SCLP it is the
print command to be used and a reservation timeout in seconds,
e.g. "cmd=lp -oraw %f:timeout=60".

EXAMPLES
Launch PiSCSI with no emulated drives attached:
piscsi
piscsi

Launch PiSCSI with an Apple hard drive image as ID 0 and a CD-ROM as ID
Launch PiSCSI with an Apple hard drive image as ID 0 and a CD-ROM as ID
2
piscsi -ID0 /path/to/harddrive.hda -ID2 /path/to/cdimage.iso
piscsi -ID0 /path/to/harddrive.hda -ID2 /path/to/cdimage.iso

Launch PiSCSI with a removable SCSI drive image as ID 0 and the raw de‐
vice file /dev/hdb (e.g. a USB stick) and a DaynaPort network adapter
as ID 6:
piscsi -ID0 -t scrm /dev/hdb -ID6 -t scdp daynaport
Launch PiSCSI with a removable SCSI drive image as ID 0 and the raw de‐
vice file /dev/hdb (e.g. a USB stick) and a DaynaPort network adapter as
ID 6:
piscsi -ID0 -t scrm /dev/hdb -ID6 -t scdp daynaport

To create an empty, 100MiB HD image, use the following command:
dd if=/dev/zero of=/path/to/newimage.hda bs=512 count=204800
dd if=/dev/zero of=/path/to/newimage.hda bs=512 count=204800

In case the fallocate command is available a much faster alternative to
In case the fallocate command is available a much faster alternative to
the dd command is:
fallocate -l 104857600 /path/to/newimage.hda
fallocate -l 104857600 /path/to/newimage.hda

SEE ALSO
scsictl(1), scsimon(1), scsidump(1)

Full documentation is available at: <https://www.piscsi.com>

piscsi(1)
PiSCSI December 18, 2025 PISCSI(1)
13 changes: 5 additions & 8 deletions doc/scsictl.1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.Dd December 18, 2025
.Dt SCSICTL 1
.Os
.Os PiSCSI
.Sh NAME
.Nm scsictl
.Nd Sends management commands to the piscsi process
Expand Down Expand Up @@ -31,13 +31,12 @@
.Sh DESCRIPTION
.Nm
sends commands to the piscsi process to make configuration adjustments at runtime or to check the status of the devices.

Either the -i or -l option should be specified at one time. Not both.

.Pp
Either the -i or -l option should be specified at one time. Not both.
.Pp
You do NOT need root privileges to use scsictl. scsictl also runs on non-Pi Linux platforms.

.Pp
Note: The command and type arguments are case insensitive. Only the first letter of the command/type is evaluated by the tool.

.Sh OPTIONS
.Bl -tag -width Ds
.It Fl b Ar BLOCK_SIZE
Expand Down Expand Up @@ -143,7 +142,6 @@ Overrides the default locale for client-facing error messages.
.It Fl u Ar UNIT
Unit number (0-31). This will default to 0. This option is only used when there are multiple SCSI devices on a shared SCSI controller. (This is not common)
.El

.Sh EXAMPLES
Show a listing of all of the SCSI devices and their current status.
.Dl Nm scsictl Fl l
Expand All @@ -159,7 +157,6 @@ Example output:
.Pp
Request the PiSCSI process to attach a disk (assumed) to SCSI ID 0 with the contents of the file system image "HDIIMAGE0.HDS".
.Dl Nm scsictl Fl i 0 Fl f HDIIMAGE0.HDS

.Sh SEE ALSO
.Xr piscsi 1 ,
.Xr scsimon 1 ,
Expand Down
Loading