Tape Drives (Streamers)

SCSI2Pi offers an extensive support of tape drives, not available with any other SCSI emulation. Two operation modes are supported: A tar-compatible mode for using tar files as image files, and a SIMH/Open SIMH-compatible mode with the full emulation functionality.

Tar-compatible mode

In the tar-compatible mode you can use normal tar files as image files. When using files with the extension .tar, s2p automatically switches into this mode.

>s2p -i 3 IMAGE_FILE.tar

In tar mode s2p ensures by a limited functionality that when writing data only tar-compatible data are created. In particular there is no filemark support.
With the Gemar-Software for the Atari or the tar tool, e.g. under Linux, you can read and write tar image files:

>tar cvf /dev/st0 IMAGE_FILE.tar
>tar tf /dev/st0 IMAGE_FILE.tar

This is similar to using tar on a local filesystem, but the tar file is on the Raspberry Pi and Linux accesses it with the SCSI tape drive/streamer driver of the Linux kernel.

SIMH-compatible mode

In this mode the full emulation functionality is available, i.e. also filemarks, navigation or variable block sizes. This mode is required for applications that require functionality beyond what is needed by tar, e.g. professional streamer software or booting operating systems from a tape drive.
s2p switches into the full-featured mode when an image file extension different than .tar is used. SIHM-compatible files contain meta data, which s2p uses to navigate or to support variable block sizes.

>s2p -i 3 IMAGE_FILE.tap

The tar tool can also be used with SIHM-compatible files. In this case the the resulting file format is not tar-compatible, though, but SIMH-compatible.

Appending data

With the standard settings s2p retains the size of a tape image file, just like you know it from a hard drive image file. Often it is convenient to append data to a tape image file. This is why s2p supports the append property. With this property, e.g. in /etc/s2p.conf, you can specifiy the maximum file size of a tape image file. s2p if required will append data until this size has been reached.

Analyzing tape image files

With the s2psimh tool you can list the contents of SIMH-compatible files. Furthermore, you can create SIMH files.

>s2psimh test.tap
Offset 0/$0: Class 0, good data record, record length 80 ($50)
Offset 88/$58: Class 0, good data record, record length 80 ($50)
Offset 176/$b0: Class 0, good data record, record length 80 ($50)
Offset 264/$108: Class 0, tape mark
Offset 268/$10c: Class 0, tape mark
Offset 272/$110: Class 0, good data record, record length 80 ($50)
Offset 360/$168: Class 0, good data record, record length 80 ($50)
Offset 448/$1c0: Class 0, tape mark
Offset 452/$1c4: Class 0, tape mark

With the -d option s2psimh also displays the data block contents. s2psimh does not require a Pi. It compiles and runs on any Linux/BSD platform and also on macOS.

Reading/Writing complete tapes

Complete Tapes can be dumped to or restored from SIHM files with s2pdump. s2pdump supports any tape format, also tapes with variable block sizes.