blob: 2acd042f3b008bb54d9a6fa4ef751784958209fd [file] [log] [blame]
Douglas Gilbert68f4f8d2007-06-27 03:20:52 +00001Introduction
2============
3The FreeBSD port of sg3_utils contains those utilities that are _not_
4specific to Linux. In some cases a utility could be ported but
5requires more work. An example is sg_dd which needs more work
6beyond the SCSI command pass through mechanism.
7
8Supported Utilities
9===================
10Here is a list of utilities that have been ported:
11 sg_format
12 sg_get_config
13 sg_ident
14 sg_inq [dropped ATA IDENTIFY DEVICE capability]
15 sg_logs
16 sg_luns
17 sg_modes
18 sg_persist
Douglas Gilbert75026472007-06-27 03:51:21 +000019 sg_opcodes
Douglas Gilbert68f4f8d2007-06-27 03:20:52 +000020 sg_prevent
Douglas Gilbert2e37f3d2007-06-27 03:53:07 +000021 sg_raw
Douglas Gilbert71e6e2d2007-06-27 03:24:23 +000022 sg_rdac
Douglas Gilbert75026472007-06-27 03:51:21 +000023 sg_read_buffer
Douglas Gilbert68f4f8d2007-06-27 03:20:52 +000024 sg_read_long
25 sg_readcap
26 sg_reassign
27 sg_requests
28 sg_rmsn
29 sg_rtpg
Douglas Gilbert084021a2007-09-29 13:51:35 +000030 sg_safte
Douglas Gilbert543a9ec2007-06-27 03:26:00 +000031 sg_sat_identify
Douglas Gilbert203814d2007-12-01 05:04:11 +000032 sg_sat_phy_event
Douglas Gilbert084021a2007-09-29 13:51:35 +000033 sg_sat_set_features
Douglas Gilbert68f4f8d2007-06-27 03:20:52 +000034 sg_senddiag
35 sg_ses
36 sg_start
Douglas Gilbertf8340512007-09-01 03:01:06 +000037 sg_stpg
Douglas Gilbert68f4f8d2007-06-27 03:20:52 +000038 sg_sync
39 sg_turs
40 sg_verify
Douglas Gilbert71e6e2d2007-06-27 03:24:23 +000041 sg_vpd
Douglas Gilbert68f4f8d2007-06-27 03:20:52 +000042 sg_wr_mode
Douglas Gilbert75026472007-06-27 03:51:21 +000043 sg_write_buffer
Douglas Gilbert68f4f8d2007-06-27 03:20:52 +000044 sg_write_long
45
46Most utility names are indicative of the main SCSI command
47that they execute. Some utilities are slightly higher level, for
48example sg_ses fetches SCSI Enclosure Services (SES) status pages and
49can send control pages. Each utility has a man page (placed in
50section 8). An overview of sg3_utils can be found at:
Douglas Gilbert71e6e2d2007-06-27 03:24:23 +000051http://www.torque.net/sg/sg3_utils.html .
52A copy of the "sg3_utils.html" file is in the "doc" subdirectory.
Douglas Gilbert68f4f8d2007-06-27 03:20:52 +000053
54
55See the INSTALL file (at the end) for instructions on how to build
56sg3_utils on FreeBSD. Some man pages have examples which use linux
57device names which hopefully will not confuse the FreeBSD users.
58
59
60Details
61=======
62The ported utilities listed above, all use SCSI command functions
Douglas Gilbert543a9ec2007-06-27 03:26:00 +000063declared in sg_cmds_basic.h and sg_cmds_extra.h . Those SCSI command
64functions are implemented in the corresponding ".c" files. The ".c"
65files pass SCSI commands to the host operating system via
66an interface declared in sg_pt.h . There are currently four
Douglas Gilbert68f4f8d2007-06-27 03:20:52 +000067implementations of that interface depending on the host operating
68system:
69 - sg_pt_linux.c
70 - sg_pt_freebsd.c
71 - sg_pt_osf1.c [Tru64]
Douglas Gilbert543a9ec2007-06-27 03:26:00 +000072 - sg_pt_win32.c
Douglas Gilbert68f4f8d2007-06-27 03:20:52 +000073
74The sg_pt_freebsd.c file uses the FreeBSD CAM SCSI pass through
75mechanism. Hence only FreeBSD device nodes that support CAM can
76be used. These can be viewed with the "camcontrol devlist"
77command. To access ATAPI devices (e.g. ATAPI DVD drives) the
78kernel may need to be configured with the "atapicam" device.
79
80At the present time these utilities have been lightly tested on a
Douglas Gilbert75026472007-06-27 03:51:21 +000081FreeBSD version 6.2 system with some SCSI disks, a SCSI tape
Douglas Gilbert68f4f8d2007-06-27 03:20:52 +000082drive and an ATAPI CD drive.
83
Douglas Gilbert2e37f3d2007-06-27 03:53:07 +000084See the FreeBSD section in the INSTALL file for install directions.
85
Douglas Gilbert68f4f8d2007-06-27 03:20:52 +000086
87Doug Gilbert
Douglas Gilbert203814d2007-12-01 05:04:11 +0000882nd December 2007