The SCSI2Pi Host Services

The host services are a special SCSI device that exposes parts of the SCSI2Pi functionality via SCSI. This means that any computer connected to the PiSCSI board can control SCSI2Pi up to a certain extent. In addition, the host services offer a realtime clock interface.
For the Atari there is a set of client tools that makes use of the host services. But these services are not Atari-specific and can be used by any computer, providated that the required SCSI calls are implemented on the client side. This means that essentially you need kind of a SCSI2Pi driver, just like you need a driver for hard drives or the DaynaPort network adapter. For the Atari the client tools represent this driver.
You can attach the host services device with the PiSCSI web interface, the SCSI Control app or on the command line:

>s2p -i 6 services

When using a LUN (sub-device) the host services do not even need a SCSI ID of their own:

>s2p -i 0 hard_drive_image.hds -i 0:1 services

In this example the host services share a SCSI ID with a hard drive. The hard drive is LUN 0, the host services allocate LUN 1.

The Pi as a realtime clock

The SCSI2Pi host services provide a vendor-specific SCSI mode page that clients can use to query the current date and time, including daylight saving time support. The SCSI2Pi sources (host_services.cpp and host_services.h provide details on how to use this clock.

Shutting down or restarting SCSI2Pi or the Pi

A SCSI command can shut down SCSI2Pi or to shut down/restart the Pi. This is in particular useful when the Pi is powered by your computer, and you want to ensure that SCSI2Pi and the Pi are properly shut down before turning off the computer. When shutting down SCSI2Pi the caches of all devices (usually devices with image files) are automatically saved.

Managing SCSI2Pi with the connected computer

The s2pctl command line tool, the PiSCSI web interface and the SCSI Control app make use of SCSI2Pi's remote interface. With this interface, which requires a network connection to the Pi, you can control some of the SCSI2Pi functionality. You can, for instance, attach/detach devices, change the log level, eject media and much more. As a rule of thumb everything offered by the SCSI Control app can also be controlled with this interface.
The computer connected to the PiSCSI board can make use of the same functionality by sending SCSI commands to SCSI2Pi, without the need for a network connection. The device that receives and executes these commands is the host services device (SCHS). While any computer can manage SCSI2PI with SCSI commands, for the Atari the client tools comprise some sample applications, e.g. for setting the SCSI2Pi log level.
Also in this case the sources for the host services contain further information.