Douglas Gilbert | 68f4f8d | 2007-06-27 03:20:52 +0000 | [diff] [blame] | 1 | Introduction |
| 2 | ============ |
| 3 | The FreeBSD port of sg3_utils contains those utilities that are _not_ |
| 4 | specific to Linux. In some cases a utility could be ported but |
| 5 | requires more work. An example is sg_dd which needs more work |
| 6 | beyond the SCSI command pass through mechanism. |
| 7 | |
| 8 | Supported Utilities |
| 9 | =================== |
| 10 | Here 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 Gilbert | 7502647 | 2007-06-27 03:51:21 +0000 | [diff] [blame] | 19 | sg_opcodes |
Douglas Gilbert | 68f4f8d | 2007-06-27 03:20:52 +0000 | [diff] [blame] | 20 | sg_prevent |
Douglas Gilbert | 2e37f3d | 2007-06-27 03:53:07 +0000 | [diff] [blame] | 21 | sg_raw |
Douglas Gilbert | 71e6e2d | 2007-06-27 03:24:23 +0000 | [diff] [blame] | 22 | sg_rdac |
Douglas Gilbert | 7502647 | 2007-06-27 03:51:21 +0000 | [diff] [blame] | 23 | sg_read_buffer |
Douglas Gilbert | 68f4f8d | 2007-06-27 03:20:52 +0000 | [diff] [blame] | 24 | sg_read_long |
| 25 | sg_readcap |
| 26 | sg_reassign |
| 27 | sg_requests |
| 28 | sg_rmsn |
| 29 | sg_rtpg |
Douglas Gilbert | 084021a | 2007-09-29 13:51:35 +0000 | [diff] [blame] | 30 | sg_safte |
Douglas Gilbert | 543a9ec | 2007-06-27 03:26:00 +0000 | [diff] [blame] | 31 | sg_sat_identify |
Douglas Gilbert | 203814d | 2007-12-01 05:04:11 +0000 | [diff] [blame] | 32 | sg_sat_phy_event |
Douglas Gilbert | 084021a | 2007-09-29 13:51:35 +0000 | [diff] [blame] | 33 | sg_sat_set_features |
Douglas Gilbert | 68f4f8d | 2007-06-27 03:20:52 +0000 | [diff] [blame] | 34 | sg_senddiag |
| 35 | sg_ses |
| 36 | sg_start |
Douglas Gilbert | f834051 | 2007-09-01 03:01:06 +0000 | [diff] [blame] | 37 | sg_stpg |
Douglas Gilbert | 68f4f8d | 2007-06-27 03:20:52 +0000 | [diff] [blame] | 38 | sg_sync |
| 39 | sg_turs |
| 40 | sg_verify |
Douglas Gilbert | 71e6e2d | 2007-06-27 03:24:23 +0000 | [diff] [blame] | 41 | sg_vpd |
Douglas Gilbert | 68f4f8d | 2007-06-27 03:20:52 +0000 | [diff] [blame] | 42 | sg_wr_mode |
Douglas Gilbert | 7502647 | 2007-06-27 03:51:21 +0000 | [diff] [blame] | 43 | sg_write_buffer |
Douglas Gilbert | 68f4f8d | 2007-06-27 03:20:52 +0000 | [diff] [blame] | 44 | sg_write_long |
| 45 | |
| 46 | Most utility names are indicative of the main SCSI command |
| 47 | that they execute. Some utilities are slightly higher level, for |
| 48 | example sg_ses fetches SCSI Enclosure Services (SES) status pages and |
| 49 | can send control pages. Each utility has a man page (placed in |
| 50 | section 8). An overview of sg3_utils can be found at: |
Douglas Gilbert | 71e6e2d | 2007-06-27 03:24:23 +0000 | [diff] [blame] | 51 | http://www.torque.net/sg/sg3_utils.html . |
| 52 | A copy of the "sg3_utils.html" file is in the "doc" subdirectory. |
Douglas Gilbert | 68f4f8d | 2007-06-27 03:20:52 +0000 | [diff] [blame] | 53 | |
| 54 | |
| 55 | See the INSTALL file (at the end) for instructions on how to build |
| 56 | sg3_utils on FreeBSD. Some man pages have examples which use linux |
| 57 | device names which hopefully will not confuse the FreeBSD users. |
| 58 | |
| 59 | |
| 60 | Details |
| 61 | ======= |
| 62 | The ported utilities listed above, all use SCSI command functions |
Douglas Gilbert | 543a9ec | 2007-06-27 03:26:00 +0000 | [diff] [blame] | 63 | declared in sg_cmds_basic.h and sg_cmds_extra.h . Those SCSI command |
| 64 | functions are implemented in the corresponding ".c" files. The ".c" |
| 65 | files pass SCSI commands to the host operating system via |
| 66 | an interface declared in sg_pt.h . There are currently four |
Douglas Gilbert | 68f4f8d | 2007-06-27 03:20:52 +0000 | [diff] [blame] | 67 | implementations of that interface depending on the host operating |
| 68 | system: |
| 69 | - sg_pt_linux.c |
| 70 | - sg_pt_freebsd.c |
| 71 | - sg_pt_osf1.c [Tru64] |
Douglas Gilbert | 543a9ec | 2007-06-27 03:26:00 +0000 | [diff] [blame] | 72 | - sg_pt_win32.c |
Douglas Gilbert | 68f4f8d | 2007-06-27 03:20:52 +0000 | [diff] [blame] | 73 | |
| 74 | The sg_pt_freebsd.c file uses the FreeBSD CAM SCSI pass through |
| 75 | mechanism. Hence only FreeBSD device nodes that support CAM can |
| 76 | be used. These can be viewed with the "camcontrol devlist" |
| 77 | command. To access ATAPI devices (e.g. ATAPI DVD drives) the |
| 78 | kernel may need to be configured with the "atapicam" device. |
| 79 | |
| 80 | At the present time these utilities have been lightly tested on a |
Douglas Gilbert | 7502647 | 2007-06-27 03:51:21 +0000 | [diff] [blame] | 81 | FreeBSD version 6.2 system with some SCSI disks, a SCSI tape |
Douglas Gilbert | 68f4f8d | 2007-06-27 03:20:52 +0000 | [diff] [blame] | 82 | drive and an ATAPI CD drive. |
| 83 | |
Douglas Gilbert | 2e37f3d | 2007-06-27 03:53:07 +0000 | [diff] [blame] | 84 | See the FreeBSD section in the INSTALL file for install directions. |
| 85 | |
Douglas Gilbert | 68f4f8d | 2007-06-27 03:20:52 +0000 | [diff] [blame] | 86 | |
| 87 | Doug Gilbert |
Douglas Gilbert | 203814d | 2007-12-01 05:04:11 +0000 | [diff] [blame] | 88 | 2nd December 2007 |