UDF

From OSDev Wiki
Jump to navigationJump to search
Filesystems
Virtual Filesystems
Disk Filesystems
CD/DVD Filesystems
Network Filesystems
Flash Filesystems

TheUniversal Disc Format orUDF is the filesystem used on DVDs and Blu-Ray discs. It is similar to the CDFS (ISO 9660) file system, but it includes many extended features, such as incremental updates, which allows files to be deleted or updated over time.

Contents

Volume Structure

Like the CDFS file system, the UDF file system uses a 2048 byte sector size, and it designates that the first 16 sectors can be used by the OS to store proprietary data or boot logic. It also, like CDFS, uses 2048 byte aligned descriptors, starting at sector 16, to record the UDF specific information to locate additional volumes, partitions and files located on the disc. It also supports the inclusion of descriptors from other file systems for compatibility with other media formats, operating systems and devices.

The descriptors located at sector 16 (0x10) all use the same general layout as the CDFS volume descriptor:

OffsetLength (bytes)Field nameDatatypeDescription
01Typeint8Volume Descriptor type code (see below).
15IdentifierstrADesignates the type of descriptor.
61Versionint8Volume Descriptor Version (0x01).
72041Data-Depends on the volume descriptor type.

The identifier field is used to determine the type of the descriptor:

IdentifierDescription
"CD001"Indicates that this volume contains an ISO 9660 file system.
"BEA01"Denotes the beginning of the extended descriptor section.
"NSR02"Indicates that this volume contains a UDF file system.
"NSR03"Indicates that this volume contains a UDF file system.
"BOOT2"Includes information concerning boot loader location and entry point address.
"TEA01"Denotes the end of the extended descriptor section.

The presence of an NSR02 or NSR03 descriptor denotes that there is a valid UDF file system located on this volume, and that there is an Anchor Volume Descriptor Pointer located in sector 256 (0x100), with backup copies located in the last sector of the volume and/or the sector located 256 sectors from the end of the volume.

Anchor Volume Descriptor Pointer

The Anchor Volume Descriptor Pointer is a descriptor that contains the location of the Main Volume Descriptor and the backup Reserve Volume Descriptor.

OffsetLength (bytes)Field nameDatatypeDescription
016DescriptorTagstructContains the descriptor type, version and checksum information for this descriptor.
168MainVolumeDescriptorSequenceExtentstructContains the sector and length of the main volume descriptor sequence.
248ReserveVolumeDescriptorSequenceExtentstructContains the sector and length of the backup volume descriptor sequence.
32480Reserved-Reserved for future use.

Descriptor Tag

The descriptor tag structure is used by all UDF descriptors to designate the descriptor type and to verify data integrity.

OffsetLength (bytes)Field nameDatatypeDescription
02TagIdentifieruint16Contains the descriptor type.
22DescriptorVersionuint16Contains the version of the descriptor tag.
41TagChecksumuint8Used to verify the data within the Descriptor Tag structure.
51Reserveduint8Reserved for future use.
62TagSerialNumberuint16Unique serial number for this volume
82DescriptorCRCuint16Used to verify the data with the Descriptor Tag structure.
102DescriptorCRCLengthuint16Used to verify the data with the Descriptor Tag structure.
124TagLocationuint32Contains the sequence number of this descriptor.

The TagIdentifier field will have one of the following values:

Identifier (Hex)Description
0x0001Primary Volume Descriptor
0x0002Anchor Volume Descriptor Pointer
0x0003Volume Descriptor Pointer
0x0004Implementation Use Volume Descriptor
0x0005Partition Descriptor
0x0006Logical Volume Descriptor
0x0007Unallocated Space Descriptor
0x0008Terminating Descriptor
0x0009Logical Volume Integrity Descriptor
0x0100File Set Descriptor
0x0101File Identifier Descriptor
0x0102Allocation Extent Descriptor
0x0103Indirect Entry
0x0104Terminal Entry
0x0105File Entry
0x0106Extended Attribute Header Descriptor
0x0107Unallocated Space Entry
0x0108Space Bitmap Descriptor
0x0109Partition Integrity Entry
0x010aExtended File Entry

Extent Structure

The extent structure is used to locate data on the current volume. It contains the sector index (relative to the beginning of the volume), and the length of the data.

OffsetLength (bytes)Field nameDatatypeDescription
04Lengthuint32Contains the length, in bytes, of the data pointed to by this extent.
44Locationuint32Contains the sector index of the data, relative to the beginning of the volume.

Volume Descriptor Sequence

The Main (and Reserve) Volume Sequence can be found by reading the extent information located in the Anchor Volume Descriptor Pointer record above. Starting at the sector specified in the Location field of the extent structure, several Volume Descriptors will be found. Each of these descriptors will provide additional information about this volume. The Terminating Descriptor (0x0008) marks the end of the Volume Descriptor Sequence.

Note: Only Volume Descriptors (0x0001 to 0x0009) are allowed in the Volume Descriptor Sequence.

Note: The UDF Specifications state that the minimum extent size for the Volume Descriptor Sequence is 16 sectors, so there may be empty descriptor blocks after the Terminating Descriptor block, which can be ignored.

Logical Volume Descriptor

The Logical Volume Descriptor (0x0006) contains information concerning the Logical Volume, including a pointer to the File Set Descriptor.

OffsetLength (bytes)Field nameDatatypeDescription
016TagstructThe volume tag for this descriptor.
164Volume Sequence Numberuint32The sequence number of this Logical Volume.
2064Descriptor Character SetstructThe character set used in this descriptor.
84128Logical Volume IdentifierCompressed UnicodeThe name of the logical volume.
2124Logical Block Sizeuint32The block size of the logical volume.
21632Domain IdentifierstructThe domain identifier for this volume.
24816Logical Volume Contents Usebyte[]Area reserved for content use.
2644Map Table Lengthuint32The length of the map table in bytes.
2684Number Of Partition Mapsuint32The number of partition map records in this descriptor.
27232Implementation IdentifierstructThe implementation identifier for this volume.
304128Implementation Usebyte[]Area reserved for implementation use.
4328Integrity Sequence ExtentstructThe extent of the integrity sequence, if any.
440*Partition Mapsstruct[]The map of partitions on this logical volume.


External Links

Retrieved from "https://wiki.osdev.org/index.php?title=UDF&oldid=16514"
Categories: