38
38
#define _ECMA_167_H 1
40
40
/* Character set specification (ECMA 167r3 1/7.2.1) */
42
42
uint8_t charSetType;
43
43
uint8_t charSetInfo[63];
44
} __attribute__ ((packed)) charspec;
44
} __attribute__ ((packed));
46
46
/* Character Set Type (ECMA 167r3 1/7.2.1.1) */
47
47
#define CHARSPEC_TYPE_CS0 0x00 /* (1/7.2.2) */
68
68
uint8_t centiseconds;
69
69
uint8_t hundredsOfMicroseconds;
70
70
uint8_t microseconds;
71
} __attribute__ ((packed)) timestamp;
71
} __attribute__ ((packed));
73
73
/* Type and Time Zone (ECMA 167r3 1/7.3.1) */
74
74
#define TIMESTAMP_TYPE_MASK 0xF000
78
78
#define TIMESTAMP_TIMEZONE_MASK 0x0FFF
80
80
/* Entity identifier (ECMA 167r3 1/7.4) */
84
84
uint8_t identSuffix[8];
85
} __attribute__ ((packed)) regid;
85
} __attribute__ ((packed));
87
87
/* Flags (ECMA 167r3 1/7.4.1) */
88
88
#define ENTITYID_FLAGS_DIRTY 0x00
127
127
/* Boot Descriptor (ECMA 167r3 2/9.4) */
128
128
struct bootDesc {
130
uint8_t stdIdent[VSD_STD_ID_LEN];
131
uint8_t structVersion;
135
__le32 bootExtLocation;
136
__le32 bootExtLength;
139
timestamp descCreationDateAndTime;
141
uint8_t reserved2[32];
142
uint8_t bootUse[1906];
130
uint8_t stdIdent[VSD_STD_ID_LEN];
131
uint8_t structVersion;
133
struct regid archType;
134
struct regid bootIdent;
135
__le32 bootExtLocation;
136
__le32 bootExtLength;
139
struct timestamp descCreationDateAndTime;
141
uint8_t reserved2[32];
142
uint8_t bootUse[1906];
143
143
} __attribute__ ((packed));
145
145
/* Flags (ECMA 167r3 2/9.4.12) */
146
146
#define BOOT_FLAGS_ERASE 0x01
148
148
/* Extent Descriptor (ECMA 167r3 3/7.1) */
150
150
__le32 extLength;
151
151
__le32 extLocation;
152
} __attribute__ ((packed)) extent_ad;
152
} __attribute__ ((packed));
154
struct kernel_extent_ad {
155
155
uint32_t extLength;
156
156
uint32_t extLocation;
159
159
/* Descriptor Tag (ECMA 167r3 3/7.2) */
162
162
__le16 descVersion;
163
163
uint8_t tagChecksum;
191
191
/* Primary Volume Descriptor (ECMA 167r3 3/10.1) */
192
192
struct primaryVolDesc {
194
__le32 volDescSeqNum;
195
__le32 primaryVolDescNum;
196
dstring volIdent[32];
199
__le16 interchangeLvl;
200
__le16 maxInterchangeLvl;
202
__le32 maxCharSetList;
203
dstring volSetIdent[128];
204
charspec descCharSet;
205
charspec explanatoryCharSet;
206
extent_ad volAbstract;
207
extent_ad volCopyright;
209
timestamp recordingDateAndTime;
212
__le32 predecessorVolDescSeqLocation;
214
uint8_t reserved[22];
194
__le32 volDescSeqNum;
195
__le32 primaryVolDescNum;
196
dstring volIdent[32];
199
__le16 interchangeLvl;
200
__le16 maxInterchangeLvl;
202
__le32 maxCharSetList;
203
dstring volSetIdent[128];
204
struct charspec descCharSet;
205
struct charspec explanatoryCharSet;
206
struct extent_ad volAbstract;
207
struct extent_ad volCopyright;
208
struct regid appIdent;
209
struct timestamp recordingDateAndTime;
210
struct regid impIdent;
212
__le32 predecessorVolDescSeqLocation;
214
uint8_t reserved[22];
215
215
} __attribute__ ((packed));
217
217
/* Flags (ECMA 167r3 3/10.1.21) */
220
220
/* Anchor Volume Descriptor Pointer (ECMA 167r3 3/10.2) */
221
221
struct anchorVolDescPtr {
223
extent_ad mainVolDescSeqExt;
224
extent_ad reserveVolDescSeqExt;
225
uint8_t reserved[480];
223
struct extent_ad mainVolDescSeqExt;
224
struct extent_ad reserveVolDescSeqExt;
225
uint8_t reserved[480];
226
226
} __attribute__ ((packed));
228
228
/* Volume Descriptor Pointer (ECMA 167r3 3/10.3) */
229
229
struct volDescPtr {
231
__le32 volDescSeqNum;
232
extent_ad nextVolDescSeqExt;
233
uint8_t reserved[484];
231
__le32 volDescSeqNum;
232
struct extent_ad nextVolDescSeqExt;
233
uint8_t reserved[484];
234
234
} __attribute__ ((packed));
236
236
/* Implementation Use Volume Descriptor (ECMA 167r3 3/10.4) */
237
237
struct impUseVolDesc {
239
239
__le32 volDescSeqNum;
240
struct regid impIdent;
241
241
uint8_t impUse[460];
242
242
} __attribute__ ((packed));
244
244
/* Partition Descriptor (ECMA 167r3 3/10.5) */
245
245
struct partitionDesc {
247
247
__le32 volDescSeqNum;
248
248
__le16 partitionFlags;
249
249
__le16 partitionNumber;
250
regid partitionContents;
250
struct regid partitionContents;
251
251
uint8_t partitionContentsUse[128];
252
252
__le32 accessType;
253
253
__le32 partitionStartingLocation;
254
254
__le32 partitionLength;
255
struct regid impIdent;
256
256
uint8_t impUse[128];
257
257
uint8_t reserved[156];
258
258
} __attribute__ ((packed));
279
279
/* Logical Volume Descriptor (ECMA 167r3 3/10.6) */
280
280
struct logicalVolDesc {
282
__le32 volDescSeqNum;
283
charspec descCharSet;
284
dstring logicalVolIdent[128];
285
__le32 logicalBlockSize;
287
uint8_t logicalVolContentsUse[16];
288
__le32 mapTableLength;
289
__le32 numPartitionMaps;
292
extent_ad integritySeqExt;
293
uint8_t partitionMaps[0];
282
__le32 volDescSeqNum;
283
struct charspec descCharSet;
284
dstring logicalVolIdent[128];
285
__le32 logicalBlockSize;
286
struct regid domainIdent;
287
uint8_t logicalVolContentsUse[16];
288
__le32 mapTableLength;
289
__le32 numPartitionMaps;
290
struct regid impIdent;
292
struct extent_ad integritySeqExt;
293
uint8_t partitionMaps[0];
294
294
} __attribute__ ((packed));
296
296
/* Generic Partition Map (ECMA 167r3 3/10.7.1) */
323
323
/* Unallocated Space Descriptor (ECMA 167r3 3/10.8) */
324
324
struct unallocSpaceDesc {
326
__le32 volDescSeqNum;
327
__le32 numAllocDescs;
328
extent_ad allocDescs[0];
326
__le32 volDescSeqNum;
327
__le32 numAllocDescs;
328
struct extent_ad allocDescs[0];
329
329
} __attribute__ ((packed));
331
331
/* Terminating Descriptor (ECMA 167r3 3/10.9) */
332
332
struct terminatingDesc {
334
334
uint8_t reserved[496];
335
335
} __attribute__ ((packed));
337
337
/* Logical Volume Integrity Descriptor (ECMA 167r3 3/10.10) */
338
338
struct logicalVolIntegrityDesc {
340
timestamp recordingDateAndTime;
341
__le32 integrityType;
342
extent_ad nextIntegrityExt;
343
uint8_t logicalVolContentsUse[32];
344
__le32 numOfPartitions;
345
__le32 lengthOfImpUse;
346
__le32 freeSpaceTable[0];
340
struct timestamp recordingDateAndTime;
341
__le32 integrityType;
342
struct extent_ad nextIntegrityExt;
343
uint8_t logicalVolContentsUse[32];
344
__le32 numOfPartitions;
345
__le32 lengthOfImpUse;
346
__le32 freeSpaceTable[0];
349
349
} __attribute__ ((packed));
351
351
/* Integrity Type (ECMA 167r3 3/10.10.3) */
353
353
#define LVID_INTEGRITY_TYPE_CLOSE 0x00000001
355
355
/* Recorded Address (ECMA 167r3 4/7.1) */
357
357
__le32 logicalBlockNum;
358
358
__le16 partitionReferenceNum;
359
} __attribute__ ((packed)) lb_addr;
359
} __attribute__ ((packed));
361
361
/* ... and its in-core analog */
362
struct kernel_lb_addr {
363
363
uint32_t logicalBlockNum;
364
364
uint16_t partitionReferenceNum;
367
367
/* Short Allocation Descriptor (ECMA 167r3 4/14.14.1) */
369
369
__le32 extLength;
370
370
__le32 extPosition;
371
} __attribute__ ((packed)) short_ad;
371
} __attribute__ ((packed));
373
373
/* Long Allocation Descriptor (ECMA 167r3 4/14.14.2) */
375
375
__le32 extLength;
376
struct lb_addr extLocation;
377
377
uint8_t impUse[6];
378
} __attribute__ ((packed)) long_ad;
378
} __attribute__ ((packed));
382
kernel_lb_addr extLocation;
380
struct kernel_long_ad {
382
struct kernel_lb_addr extLocation;
386
386
/* Extended Allocation Descriptor (ECMA 167r3 4/14.14.3) */
388
388
__le32 extLength;
389
389
__le32 recordedLength;
390
390
__le32 informationLength;
392
} __attribute__ ((packed)) ext_ad;
391
struct lb_addr extLocation;
392
} __attribute__ ((packed));
396
uint32_t recordedLength;
397
uint32_t informationLength;
398
kernel_lb_addr extLocation;
394
struct kernel_ext_ad {
396
uint32_t recordedLength;
397
uint32_t informationLength;
398
struct kernel_lb_addr extLocation;
401
401
/* Descriptor Tag (ECMA 167r3 4/7.2 - See 3/7.2) */
416
416
/* File Set Descriptor (ECMA 167r3 4/14.1) */
417
417
struct fileSetDesc {
419
timestamp recordingDateAndTime;
420
__le16 interchangeLvl;
421
__le16 maxInterchangeLvl;
423
__le32 maxCharSetList;
425
__le32 fileSetDescNum;
426
charspec logicalVolIdentCharSet;
427
dstring logicalVolIdent[128];
428
charspec fileSetCharSet;
429
dstring fileSetIdent[32];
430
dstring copyrightFileIdent[32];
431
dstring abstractFileIdent[32];
432
long_ad rootDirectoryICB;
435
long_ad streamDirectoryICB;
436
uint8_t reserved[32];
419
struct timestamp recordingDateAndTime;
420
__le16 interchangeLvl;
421
__le16 maxInterchangeLvl;
423
__le32 maxCharSetList;
425
__le32 fileSetDescNum;
426
struct charspec logicalVolIdentCharSet;
427
dstring logicalVolIdent[128];
428
struct charspec fileSetCharSet;
429
dstring fileSetIdent[32];
430
dstring copyrightFileIdent[32];
431
dstring abstractFileIdent[32];
432
struct long_ad rootDirectoryICB;
433
struct regid domainIdent;
434
struct long_ad nextExt;
435
struct long_ad streamDirectoryICB;
436
uint8_t reserved[32];
437
437
} __attribute__ ((packed));
439
439
/* Partition Header Descriptor (ECMA 167r3 4/14.3) */
440
440
struct partitionHeaderDesc {
441
short_ad unallocSpaceTable;
442
short_ad unallocSpaceBitmap;
443
short_ad partitionIntegrityTable;
444
short_ad freedSpaceTable;
445
short_ad freedSpaceBitmap;
441
struct short_ad unallocSpaceTable;
442
struct short_ad unallocSpaceBitmap;
443
struct short_ad partitionIntegrityTable;
444
struct short_ad freedSpaceTable;
445
struct short_ad freedSpaceBitmap;
446
446
uint8_t reserved[88];
447
447
} __attribute__ ((packed));
449
449
/* File Identifier Descriptor (ECMA 167r3 4/14.4) */
450
450
struct fileIdentDesc {
452
452
__le16 fileVersionNum;
453
453
uint8_t fileCharacteristics;
454
454
uint8_t lengthFileIdent;
456
456
__le16 lengthOfImpUse;
457
457
uint8_t impUse[0];
458
458
uint8_t fileIdent[0];
469
469
/* Allocation Ext Descriptor (ECMA 167r3 4/14.5) */
470
470
struct allocExtDesc {
472
472
__le32 previousAllocExtLocation;
473
473
__le32 lengthAllocDescs;
474
474
} __attribute__ ((packed));
476
476
/* ICB Tag (ECMA 167r3 4/14.6) */
478
478
__le32 priorRecordedNumDirectEntries;
479
479
__le16 strategyType;
480
480
__le16 strategyParameter;
481
481
__le16 numEntries;
482
482
uint8_t reserved;
483
483
uint8_t fileType;
484
lb_addr parentICBLocation;
484
struct lb_addr parentICBLocation;
486
} __attribute__ ((packed)) icbtag;
486
} __attribute__ ((packed));
488
488
/* Strategy Type (ECMA 167r3 4/14.6.2) */
489
489
#define ICBTAG_STRATEGY_TYPE_UNDEF 0x0000
529
529
/* Indirect Entry (ECMA 167r3 4/14.7) */
530
530
struct indirectEntry {
532
struct icbtag icbTag;
533
struct long_ad indirectICB;
534
534
} __attribute__ ((packed));
536
536
/* Terminal Entry (ECMA 167r3 4/14.8) */
537
537
struct terminalEntry {
539
struct icbtag icbTag;
540
540
} __attribute__ ((packed));
542
542
/* File Entry (ECMA 167r3 4/14.9) */
543
543
struct fileEntry {
549
__le16 fileLinkCount;
550
uint8_t recordFormat;
551
uint8_t recordDisplayAttr;
553
__le64 informationLength;
554
__le64 logicalBlocksRecorded;
555
timestamp accessTime;
556
timestamp modificationTime;
559
long_ad extendedAttrICB;
562
__le32 lengthExtendedAttr;
563
__le32 lengthAllocDescs;
564
uint8_t extendedAttr[0];
565
uint8_t allocDescs[0];
545
struct icbtag icbTag;
549
__le16 fileLinkCount;
550
uint8_t recordFormat;
551
uint8_t recordDisplayAttr;
553
__le64 informationLength;
554
__le64 logicalBlocksRecorded;
555
struct timestamp accessTime;
556
struct timestamp modificationTime;
557
struct timestamp attrTime;
559
struct long_ad extendedAttrICB;
560
struct regid impIdent;
562
__le32 lengthExtendedAttr;
563
__le32 lengthAllocDescs;
564
uint8_t extendedAttr[0];
565
uint8_t allocDescs[0];
566
566
} __attribute__ ((packed));
568
568
/* Permissions (ECMA 167r3 4/14.9.5) */
729
729
/* Partition Integrity Entry (ECMA 167r3 4/14.13) */
730
730
struct partitionIntegrityEntry {
733
timestamp recordingDateAndTime;
734
uint8_t integrityType;
735
uint8_t reserved[175];
732
struct icbtag icbTag;
733
struct timestamp recordingDateAndTime;
734
uint8_t integrityType;
735
uint8_t reserved[175];
736
struct regid impIdent;
738
738
} __attribute__ ((packed));
740
740
/* Short Allocation Descriptor (ECMA 167r3 4/14.14.1) */
766
766
/* File Entry (ECMA 167r3 4/14.17) */
767
767
struct extendedFileEntry {
773
__le16 fileLinkCount;
774
uint8_t recordFormat;
775
uint8_t recordDisplayAttr;
777
__le64 informationLength;
779
__le64 logicalBlocksRecorded;
780
timestamp accessTime;
781
timestamp modificationTime;
782
timestamp createTime;
786
long_ad extendedAttrICB;
787
long_ad streamDirectoryICB;
790
__le32 lengthExtendedAttr;
791
__le32 lengthAllocDescs;
792
uint8_t extendedAttr[0];
793
uint8_t allocDescs[0];
769
struct icbtag icbTag;
773
__le16 fileLinkCount;
774
uint8_t recordFormat;
775
uint8_t recordDisplayAttr;
777
__le64 informationLength;
779
__le64 logicalBlocksRecorded;
780
struct timestamp accessTime;
781
struct timestamp modificationTime;
782
struct timestamp createTime;
783
struct timestamp attrTime;
786
struct long_ad extendedAttrICB;
787
struct long_ad streamDirectoryICB;
788
struct regid impIdent;
790
__le32 lengthExtendedAttr;
791
__le32 lengthAllocDescs;
792
uint8_t extendedAttr[0];
793
uint8_t allocDescs[0];
794
794
} __attribute__ ((packed));
796
796
#endif /* _ECMA_167_H */