Friday, May 21, 2004
(Written in the style of a Unix command-line man page ...)
NAME
plscsi - talk SCSI at the command line
SYNOPSIS
plscsi [-w|devicenames] [options] -x "$command"
DESCRIPTION
plscsi copies commands, data, status, and auto sense between the host and one or more devices.
BUGS
Below we say "should" where we have discovered we want our code to do something other than what it actually does.
OPTIONS
-w
Try all the well-known path names now connected to SCSI devices, same as --whichever.
-v
Trace all the SCSI talk, same as
--verbose, opposite of -q and --quiet. Should be less redundant
with Unix `hexdump -C`.
-x "$command"
Specify what command descriptor block (CDB) bytes to copy out to each device, quotes optional.
-p
Pass thru commands known to crash certain operating systems, such as unusual CDB length and mode sense of header. Pass thru commands known to destroy disks, such as x04 Format. Same as --please.
-t $filename
Copy data bytes in to a file, often /dev/null. Maybe the cryptic concise -t . should mean copy to stdout, meanwhile -t "" works. Probably the default should be to stdout, rather than to /dev/null. Some Unix define such aliases as /dev/stdout and /dev/fd/1 to mean stdout. Same as --to $filename.
-i $length
Copy data bytes in from each device. -i . should mean copy in as many bytes as -f or -fx. Same as --in $length.
-f $filename
Copy data bytes out from a file, often /dev/zero or /dev/urandom. Maybe the cryptic concise -f . should mean copy from stdin, meanwhile -f "" works. Probably the default should be from stdin, rather than from /dev/zero translated to \xAE. Some Unix define such aliases as /dev/stdin and /dev/fd/0 (distinct from the /dev/fd0 floppy) to mean stdin. Same as --from $file.
-fx "$hex"
Should mean copy data bytes out from a string of hex. Meanwhile, you can use the -f $filename option, after you prepare a file with a tool of your choosing such as the otherwise undocumented --loop option, for example:
plscsi --loop -v -x \"00 FF FF FE\" -i x101 -t cycle.bin
-o $length
Copy data bytes out to each device. -o . should mean copy out all the bytes of -f or -fx. Same as --out $length.
-h
Print help. Same as --help.
OBSCURE OPTIONS
-c
Compare the data bytes copied in to the data bytes copied out and complain of differences found. Same as --compare.
-d $length
Allot and -v trace more than just the -i $length or -o $length of data. Same as --data $length.
-a $page $offset
Mis/align the data to a $page size
in bytes by an $offset in bytes. Same as --align. Should be redundant,
because every specified length should be specified as
$length.$page.$offset.
-y
Repeat til the command succeeds. Same as --yes.
-n
Repeat til the command fails, except should tolerate copying less than all data bytes while the count of bytes copied does not change. Same as --no.
PLATFORM SPECIFIC OPTIONS
-X $filename
Speak only thru the specified shared library, such as Linux lscsio.so or Windows Wnaspi32.dll.
-X sense $length
Limit the count of auto sense bytes copied in from each device.
-X time $s $ns
Should be the legacy way of spelling `-X
within $s.$ns`.
-X within $s.$ns
Time out and cancel if more than
seconds & nanoseconds elapse. Should be the one way of spelling this
option, but isn't yet, so for now use `-X
time $s $ns`. The default has been 28 hours i.e. try not to
cancel, which works well in Windows, where Ctrl+C and Ctrl+Alt+Del and
such cancel well on demand. Some say Linux works better with a
default more like 5 seconds, except with slow devices, because
otherwise Ctrl+C doesn't work well.
-X late $s.$ns
Complain of slow time after the fact without trying to cancel to reduce time. Eventually gives the same info, but works better across platforms, than the cancel after time out of `-X within $s.$ns`. Should work but doesn't.
PLATFORM DISTINGUISHING OPTIONS
-X aspi
Speak only thru Windows ASPI
-X csp
Speak only thru Linux
CDROM_SEND_PACKET. Should work but doesn't.
-X dos
Speak only thru DOS ASPI
-X sgio
Speak only thru Linux ioctl SG_IO
-X spt
Speak only thru Windows DeviceIoControl IOCTL_SCSI_PASS_THROUGH
-X sptd
Speak only thru Windows DeviceIoControl IOCTL_SCSI_PASS_THROUGH_DIRECT
-X sptx
Speak only thru Windows DeviceIoControl, -X Spt if <= 16KiB, else -X Sptd
Posted by Pat LaVarre