-
Notifications
You must be signed in to change notification settings - Fork 205
/
iso9660.ksy
276 lines (275 loc) · 6.15 KB
/
iso9660.ksy
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
meta:
id: iso9660
title: ISO9660 CD filesystem
file-extension: iso
xref:
justsolve: ISO_9660
loc: fdd000348
pronom: fmt/468
wikidata: Q815645
license: CC0-1.0
doc: |
ISO9660 is standard filesystem used on read-only optical discs
(mostly CD-ROM). The standard was based on earlier High Sierra
Format (HSF), proposed for CD-ROMs in 1985, and, after several
revisions, it was accepted as ISO9960:1998.
The format emphasizes portability (thus having pretty minimal
features and very conservative file names standards) and sequential
access (which favors disc devices with relatively slow rotation
speed).
types:
vol_desc:
seq:
- id: type
type: u1
- id: magic
contents: "CD001"
- id: version
type: u1
- id: vol_desc_boot_record
type: vol_desc_boot_record
if: type == 0
- id: vol_desc_primary
type: vol_desc_primary
if: type == 1
vol_desc_boot_record:
seq:
- id: boot_system_id
type: str
size: 32
encoding: UTF-8
- id: boot_id
type: str
size: 32
encoding: UTF-8
vol_desc_primary:
doc-ref: 'https://wiki.osdev.org/ISO_9660#The_Primary_Volume_Descriptor'
seq:
- id: unused1
contents: [0]
- id: system_id
type: str
size: 32
encoding: UTF-8
- id: volume_id
type: str
size: 32
encoding: UTF-8
- id: unused2
contents: [0, 0, 0, 0, 0, 0, 0, 0]
- id: vol_space_size
type: u4bi
- id: unused3
contents: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
- id: vol_set_size
type: u2bi
- id: vol_seq_num
type: u2bi
- id: logical_block_size
type: u2bi
- id: path_table_size
type: u4bi
- id: lba_path_table_le
type: u4le
- id: lba_opt_path_table_le
type: u4le
- id: lba_path_table_be
type: u4be
- id: lba_opt_path_table_be
type: u4be
- id: root_dir
type: dir_entry
size: 34
- id: vol_set_id
type: str
size: 128
encoding: UTF-8
- id: publisher_id
type: str
size: 128
encoding: UTF-8
- id: data_preparer_id
type: str
size: 128
encoding: UTF-8
- id: application_id
type: str
size: 128
encoding: UTF-8
- id: copyright_file_id
type: str
size: 38
encoding: UTF-8
- id: abstract_file_id
type: str
size: 36
encoding: UTF-8
- id: bibliographic_file_id
type: str
size: 37
encoding: UTF-8
- id: vol_create_datetime
type: dec_datetime
- id: vol_mod_datetime
type: dec_datetime
- id: vol_expire_datetime
type: dec_datetime
- id: vol_effective_datetime
type: dec_datetime
- id: file_structure_version
type: u1
- id: unused4
type: u1
- id: application_area
size: 512
instances:
path_table:
pos: lba_path_table_le * _root.sector_size
size: path_table_size.le
type: path_table_le
dir_entries:
seq:
- id: entries
type: dir_entry
repeat: until
repeat-until: _.len == 0
dir_entry:
seq:
- id: len
type: u1
- id: body
type: dir_entry_body
size: len - 1
if: len > 0
dir_entry_body:
seq:
- id: len_ext_attr_rec
type: u1
- id: lba_extent
type: u4bi
- id: size_extent
type: u4bi
- id: datetime
type: datetime
- id: file_flags
type: u1
- id: file_unit_size
type: u1
- id: interleave_gap_size
type: u1
- id: vol_seq_num
type: u2bi
- id: len_file_name
type: u1
- id: file_name
type: str
encoding: UTF-8
size: len_file_name
- id: padding
type: u1
if: len_file_name % 2 == 0
- id: rest
size-eos: true
instances:
extent_as_dir:
io: _root._io
pos: lba_extent.le * _root.sector_size
size: size_extent.le
type: dir_entries
if: file_flags & 2 != 0
extent_as_file:
io: _root._io
pos: lba_extent.le * _root.sector_size
size: size_extent.le
if: file_flags & 2 == 0
## AKA "Path Table Entry"
path_table_le:
doc-ref: 'https://wiki.osdev.org/ISO_9660#The_Path_Table'
seq:
- id: entries
type: path_table_entry_le
repeat: eos
path_table_entry_le:
seq:
- id: len_dir_name
type: u1
- id: len_ext_attr_rec
type: u1
- id: lba_extent
type: u4le
- id: parent_dir_idx
type: u2le
- id: dir_name
type: str
encoding: UTF-8
size: len_dir_name
- id: padding
type: u1
if: len_dir_name % 2 == 1
datetime:
seq:
- id: year
type: u1
- id: month
type: u1
- id: day
type: u1
- id: hour
type: u1
- id: minute
type: u1
- id: sec
type: u1
- id: timezone
type: u1
dec_datetime:
doc-ref: 'https://wiki.osdev.org/ISO_9660#Date.2Ftime_format'
seq:
- id: year
type: str
size: 4
encoding: ASCII
- id: month
type: str
size: 2
encoding: ASCII
- id: day
type: str
size: 2
encoding: ASCII
- id: hour
type: str
size: 2
encoding: ASCII
- id: minute
type: str
size: 2
encoding: ASCII
- id: sec
type: str
size: 2
encoding: ASCII
- id: sec_hundreds
type: str
size: 2
encoding: ASCII
- id: timezone
type: u1
u2bi:
seq:
- id: le
type: u2le
- id: be
type: u2be
u4bi:
seq:
- id: le
type: u4le
- id: be
type: u4be
instances:
sector_size:
value: 2048
primary_vol_desc:
pos: 0x010 * sector_size
type: vol_desc