-
Notifications
You must be signed in to change notification settings - Fork 0
/
SD-SCSI.cfg
executable file
·152 lines (140 loc) · 7.17 KB
/
SD-SCSI.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# vim:set sw=4 ts=4:
# SD-SCSI configuration file
#
# This is a template configuration file for the SD-SCSI adapter. Anything after a "#" is ignored, except it is
# within a quoted string. Any value can be within quotes, but in the mode page configuration, quotes change the
# meaning of the given value. Escaping using the backslash character is also possible.
# Keywords are case-insensitive, string parameters are taken as-is. Numbers are allowed in octal, decimal or
# hexadecimal format, the default is decimal, a leading 0 switches to octal, a leading 0x to hexadecimal.
#
# To configure the SD-SCSI adapter, a small FAT16 partition has to be created on the card as partition 1,
# this file has to be put there with the name sd-scsi.cfg
# If the configuration file is not found or contains errors, the SD-SCSI adapter creates one target with the whole
# card and shows it on USB and SCSI (ID 0), which enables the user to maintain partitions and configuration of the
# adapter.
# Target configuration
# * Syntax: "Target" <TargetNumber> "Partition" <PartitionNumber>
# - TargetNumber Target number, valid range 0-7, gaps allowed.
# - PartitionNumbe> Partition number to use as back end for this target. 0 is full device, 1 is the first
# partition, 5 is the first logical volume in an extended partition and so on.
# Following a target configuration line, target details like inquiry data and mode pages may follow.
Target 0 Partition 1 # FAT16 file system with configuration
# Target's inquiry data
# * Syntax: "Inquiry" <VendorId> <ProductId> [Revision] [SerialNumber]
# - VendorId Vendor identification, up to 8 characters
# - ProductId Product identification, up to 16 characters
# - Revision Optional device revision, up to 4 characters
# - SerialNumber Optional serial number, up to 8 characters
# If the inquiry data it not given, defaults are assigned by the firmware, making sure each target gets it's own
# serial number, also being unique across adapters with different serial numbers.
Inquiry "MIK" "SD-SCSI ADAPTER" "0001"
# Target's mode page data
# * Syntax: "ModePage" <PageCode> [PageData] ...
# - PageCode The code of this mode page. Allowed values are 0-62
# - PageData The page data in either numerical or string format - or a mix of both
# Mode pages need to be defined in ascending order, the only exception is page 0, which has to come as the last
# entry. Data can be given as a sequence of numbers and strings, and in this case it is important that numbers
# are not quoted and strings are, as this is the way to clearly distinguish them. Data entry for a mode page can
# be continued in the next line, so pretty formatting and commenting is possible. The next keyword ends reading
# mode page data.
ModePage 1 # Read-Write Error Recovery mode page
0x24 # AWRE, ARRE, TB, RC, error recovery bits
0x1B # Read retry count
0x30 # Correction span
0x00 # Head offset count
0x00 # Data strobe offset count
0xFF # Reserved / restricted for MMC-4
0x03 # Write retry count
0x00 # reserved
0x01 0x00 # Recovery time limit
ModePage 3 # Format Parameters page
0x00 0x0F # Tracks per zone
0x00 0x0C # Alternate sectors per zone
0x00 0x00 # Alternate tracks per zone
0x00 0x1E # Alternate tracks per volume
0x00 0x20 # Sectors per track
0x02 0x00 # Data bytes per physical sector
0x00 0x01 # Interleave
0x00 0x0D # Track skew factor
0x00 0x15 # Cylinger skew factor
0x00 # SSEC, HSEC, RMB, SURF, drive type
0x00 0x00 0x00 # reserved
ModePage 4 # Rigid Drive Geometry Parameters page
0x00 0x0e 0xd8 # Number of cylinders
0x20 # Number of heads
0x00 0x00 0x00 # Starting cylinder - write precomp
0x00 0x00 0x00 # Starting cylinder - reduced write current
0x00 0x00 # Drive step rate
0x00 0x00 0x00 # Landing zone cylinder
0x00 # Reserved / RPL
0x00 # Rotational offset
0x00 # Reserved
0x0e 0x10 # Medium rotation rate
0x00 # Reserved
0x00 # Reserved
ModePage 8 # Caching Parameters page
0x90 # IC, ABPF, CAP, DISC, SIZE, WCE, MF, RCD
0x00 # Demand read retention priority, write retention priority
0xff 0xff # Disable prefetch transfer length
0x00 0x00 # Minimum prefetch
0xff 0xff # Maximum prefetch
0xff 0xff # Maximum prefetch ceiling
0x80 # FSW, LBCSS, DRA, reserved
0x01 # Number of cache segments
0x00 0x00 # Cache segment size
0x00 # reserved
0x00 0x00 0x00 # Non-cache segment size
ModePage 0x30 "APPLE COMPUTER, INC "
# The following is an example to partially emulate a read hard drive. The back end partition should be of the
# same size than the original drive, the INQUIRY and mode page information configured here are dumped from the
# original hard drive.
Target 1 Partition 2 # Emulated hard drive example
Inquiry SEAGATE ST11200N 9494 00929429
ModePage 1 # Read-Write error recovery (Mac Plus PC 2, Quadra 700 PC 3)
0x24 0x10 0x30 0x00 0x00 0xff
ModePage 2 # Disconnect-Reconnect
0x80 0x80 0x00 0x0a 0x00 0x00 0x00 0x00 0x00 0x00
ModePage 3 # Format (obsolete)
0x00 0x0f 0x00 0x0c 0x00 0x00 0x00 0x1e 0x00 0x4a 0x02 0x00 0x00 0x01 0x00 0x0d 0x00 0x15 0x40 0x00 0x00 0x00
ModePage 0x04 # Rigid disk geometry (obsolete)
0x00 0x07 0x50 # Cylinders
0x0f # Heads
0x00 0x00 0x00 # Starting cylinder write precomp
0x00 0x00 0x00 # Starting cylinder reduced write current
0x00 0x00 # Drive step rate
0x00 0x00 0x00 # Landing zone cylinder
0x00 # Reserved / RPL
0x00 # Rotational offset
0x00 # Reserved
ModePage 0x06 0x00 0x00 0x6c
ModePage 0x08 # Caching
0x90 0x00 0xff 0xff 0x00 0x00 0xff 0xff 0xff 0xff 0x80 0x01 0x00 0x00 0x00 0x00 0x00 0x00
ModePage 0x0c # Notch and partition (obsolete)
0x80 0x00 0x00 0x17 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x07 0x4d 0x0e 0x00 0x00 0x00 0x00 0x00 0x00 0x10 0x00
ModePage 0x20 "00929429"
ModePage 0x30 "APPLE COMPUTER, INC "
ModePage 0x36 0x00 0x00
ModePage 0x00 # Unit Attention condition [vendor specific format]
0x10 0x00
# SCSI configuration
# * Syntax: "SCSI-ID" <Id> "Target" <TargetNumber>
# "SCSI-ID" <Id> "Initiator"
# - Id SCSI ID on bus that will be assigned
# - TargetNumber Target number the SCSI ID is assigned to
# Establishes the routing of SCSI IDs on the bus to targets, the second option sets the own SCSI ID when running as
# initiator. Any ID may only appear once and one target may not be assigned to multiple IDs.
SCSI-ID 3 Target 1 # Boot drive (Sun)
SCSI-ID 7 Initiator # Initiator when accessing SCSI-bus via USB
# USB LUN configuration
# * Syntax: "USB-LUN" "Target" <Id>
# "USB-LUN" "SCSI-ID" <Id>
# - Id SCSI ID to connect USB LUN to
# Establishes the routing of USB LUNs to SCSI targets, either provided by the SD-SCSI adapter or on the SCSI bus.
# LUN number doesn't need to be given as holes are not allowed, so they are defined in ascending order, starting with
# 0. It is recommended to define the parallel SCSI targets after all local targets as some operating systems stop
# scanning if an error occurs on a target, which might make all targets appearing after a non-functional one to also
# not work.
# Up to 16 USB LUNs may be configured
USB-LUN Target 0
USB-LUN Target 1
USB-LUN SCSI-ID 6