ISO 9660: Difference between revisions

[unchecked revision][unchecked revision]
(New section about the System Area at the start of ISO images.)
 
(26 intermediate revisions by 7 users not shown)
Line 1:
{{Filesystems}}
'''ISO 9660''' is the standard file system for CD-ROMs. It is also widely used
on DVD and BD media and may as well be present on USB sticks or hard disks.
Its specifications are available for free under the name '''ECMA-119'''.
 
{{In Progress}}
 
== Overview and caveats ==
ISO 9660 is not a complex file system, but has a few quirks that are worth remembering. It seems that some operating systems also create non-compliant CDs, so beware! The main example of this is the character set that is available for file names. Strictly, filenames may only consist of uppercase letters A-Z, digits,
dots, and underscores. Further there is a semicolon which separates the visible file name from its version number suffix. Many operating systems also allow lower case letters and other characters. Linux's [[VFS]] displays lower case filenames to the user despite the CD contents actually containing upper case characters.
 
Another (perhaps little-known and little-utilized) feature of the ISO 9660 file system is that a single file system can span multiple CDs. This is dealt with via ''set numbers''.
 
=== Sector size ===
Line 103 ⟶ 100:
 
=== Filenames ===
Filenames must be in the 8.3 format (a name of 8 characters, followed by a period, followed by an extension of 3 characters), and use d-character encoding (strD)., plus dot and semicolon
which have to occur exactly once per filename.
Filenames are composed of a File Name, a dot, a File Name Extension,
a semicolon; and a version number in decimal digits. The latter two
are usually not displayed to the user.
 
There are three Levels of Interchange defined. Level 1 allows filenames
with a File Name length of 8 and an extension length of 3 (like MS-DOS).
Levels 2 and 3 allow File Name and File Name Extension to have a combined
length of up to 30 characters.
 
The ECMA-119 Directory Record format can hold composed names of up to 222
characters. This would violate the specs but must nevertheless be handled
by a reader of the filesystem.
 
=== Size Limitations ===
ISO 9660 filesystems can have up to 2 exp 32 blocks, i.e. 8 TiB.
Normally they will be restricted to the size of optical media.
(Currently up to 100 GiB with 4-layer BD-R.)
 
The maximum size of data files depends on the Level of Interchange
that is intended for the ISO filesystem. Levels 1 and 2 allow for
4 GiB - 1, because a single Directory Record can claim up to that
number of bytes. Level 3 allows to have multiple consequtive
Directory Records with the same name. They all are to be concatenated
to a single data file. This means that a single data file can nearly
fill up the full 8 TiB of image size.
 
== System Area ==
Line 118 ⟶ 141:
When preparing to mount a CD, your first action will be reading the volume descriptors (specifically, you will be looking for the ''Primary Volume Descriptor'').
 
Since sectors 0x00-0x0F of the CD are reserved as System Area,
Sectors 0x00-0x0F of the CD are reserved for system use. This means that the Volume Descriptors can be found starting at sector 0x10 (16). The format of the volume descriptors is as follows:
 
{| {{wikitable}}
Line 181 ⟶ 205:
| 71 || 1977 || Boot System Use || - || Custom - used by the boot system.
|}
 
The most common Boot System Use specification is [[El-Torito|El Torito]].
It records at bytes 71 to 74 as little-endian 32-bit number the
block address of the El Torito Boot Catalog. This catalog lists the
available boot images, which serve as starting points of booting systems.
 
=== The Primary Volume Descriptor ===
Line 226 ⟶ 255:
| 152 || 4 || Location of Optional Type-M Path Table || int32_MSB || LBA location of the optional path table. The path table pointed to contains only big-endian values. Zero means that no optional path table exists.
|-
| 156 || 34 || Directory entry for the root directory || - || Note that this is not an LBA address, it is the actual Directory Record, which contains a zero-lengthsingle byte Directory Identifier (0x00), hence the fixed 34 byte size.
|-
| 190 || 128 || Volume Set Identifier || strD || Identifier of the volume set of which this volume is a member.
Line 236 ⟶ 265:
| 574 || 128 || Application Identifier || strA || Identifies how the data are recorded on this volume. For extended information, the first byte should be 0x5F, followed by the filename of a file in the root directory. If not specified, all bytes should be 0x20.
|-
| 702 || 3837 || Copyright File Identifier || strD || Filename of a file in the root directory that contains copyright information for this volume set. If not specified, all bytes should be 0x20.
|-
| 740739 || 3637 || Abstract File Identifier || strD || Filename of a file in the root directory that contains abstract information for this volume set. If not specified, all bytes should be 0x20.
|-
| 776 || 37 || Bibliographic File Identifier || strD || Filename of a file in the root directory that contains bibliographic information for this volume set. If not specified, all bytes should be 0x20.
Line 304 ⟶ 333:
 
== Directories ==
At some point when reading from an ISO 9660 CD, you will need a directory record to locate a file, even if you generally use the path table to locate the directory initially. Unlike the path tables, there is only one version of each directory table, and multi byte numbers are in both-endian format. Every directory will start with 2 special entries: an empty string, describing the "." entry, and the string "\1" describing the ".." entry. A directory record is laid out as follows:
 
{| {{wikitable}}
!Offset
!Size
!Type
!Description
|-
| 0 || 1 || int8 || Length of Directory Record.
|-
| 1 || 1 || int8 || Extended Attribute Record length.
|-
| 2 || 8 || int32_LSB-MSB || Location of extent (LBA) in both-endian format.
|-
| 10 || 8 || int32_LSB_MSB || Data length (size of extent) in both-endian format.
|-
| 18 || 7 || see format below || Recording date and time (see format below).
|-
| 25 || 1 || File flags (see below) || File flags.
|-
| 26 || 1 || int8 || File unit size for files recorded in interleaved mode, zero otherwise.
|-
| 27 || 1 || int8 || Interleave gap size for files recorded in interleaved mode, zero otherwise.
|-
| 28 || 4 || int16_LSB-MSB || Volume sequence number - the volume that this extent is recorded on, in 16 bit both-endian format.
|-
| 32 || 1 || int8 || Length of file identifier (file name). This terminates with a ';' character followed by the file ID number in ASCII coded decimal ('1').
|-
| 33 || (variable) || strD || File identifier.
|-
| (variable) || 1 || -- || Padding field - zero if length of file identifier is oddeven, otherwise, this field is not present. This means that a directory entry will always start on an even byte number.
|-
| (variable) || (variable) || -- ||
System Use -
The remaining bytes up to the maximum record size of 255 may be used
for extensions of ISO 9660. The most common one is the System Use Share
Protocol (SUSP) and its application, the Rock Ridge Interchange Protocol
(RRIP).
|}
 
Line 395 ⟶ 432:
# Repeat steps 3 and 4 for the file identifier 'MYLOADER;1'.
# Scan the 'MYLOADER' directory for 'STAGE2.BIN;1'. If found, you can now use the LBA value to load your file in to memory.
 
== Rock Ridge and Joliet ==
There are two enhancements for ISO 9660 which make it more suitable for
the worlds of Unix and of MS-Windows. Both can be combined in the same
filesystem. So the reader often has the choice between three file name
spaces: Plain ISO, Rock Ridge, Joliet.
 
ISO and Rock Ridge will show the same tree of files but with different names.
Joliet can show a completely different tree than ISO.
 
Rock Ridge allows for file names of up to 255 characters of 8 bit. Only
the 0-byte and the slash ("/") may not be used. Further it adds the
file attributes which are specified by POSIX (owner, group, permissions,...)
and it allows for symbolic links.
 
Rock Ridge is an application of SUSP. It may be accompanied by other
SUSP applications like zisofs (compression of data files, Linux
specific), Apple ISO 9660 Extensions, Amiga AS entries, or Arbitrary
Attribute Interchange Protocol (AAIP: Extended Attributes and ACLs).
A reader of SUSP entries shall simply ignore all entry types
which it does not expect.
 
Joliet was defined by Microsoft Inc. to allow for filenames with
up to 64 UCS-2 characters (16 bit). It is implemented as separate
tree of Directory Records which begins by a root record in a
Supplementary Volume Descriptor. That descriptor is similar to a
Primary Volume Descriptor, but has a Type Code of 2.
 
== See Also ==
=== Articles ===
* [[El-Torito]], a standard for creating bootable CD-ROMs
* [[Mkisofs]], about ISO 9660 producing programs: mkisofs, genisoimage, xorriso
* [[Optical Drive]], an overview about how to operate optical drives and media
 
=== External links ===
* [http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-119.pdf ISO 9660 (ECMA-119) specification]
* [[wikipedia:ISO 9660|ISO 9960 on Wikipedia]]
* [https://dev.lovelyhq.com/libburnia/libisofs/raw/master/doc/boot_sectors.txt Boot entry points in ISO 9660 filesystems]
* [ftp://ftp.ymi.com/pub/rockridge/susp112.ps SUSP 1.12 (entries CE , PD , SP , ST , ER , ES)]
* [ftp://ftp.ymi.com/pub/rockridge/rrip112.ps Rock Ridge: RRIP 1.12 (SUSP entries PX , PN , SL , NM , CL , PL , RE , TF , SF , obsolete: RR)]
* [http://www.estamos.de/makecd/Rock_Ridge_Amiga_Specific Amiga SUSP entry AS]
* [https://dev.lovelyhq.com/libburnia/libisofs/raw/master/doc/susp_aaip_2_0.txt libisofs SUSP application AAIP (SUSP entry AL)]
* [http://www.buildorbuy.org/pdf/joliet.pdf Joliet addon-on specifications]
 
[[de:ISO9660]]
Anonymous user