Personal #cd dvd 4 min

BIN and ISO CD images

Translation of the original in Catalan. Read it in: CatalàCastellano

All my life I had heard that CD images, when they are written to a file, have the .iso extension and sometimes some other proprietary format like .nrg, which is basically the same as the iso but with some header changed, but that it can be used between different programs that burn isos without problems. At least that's what I had come across until now. The thing is that some time ago I saw that there were some images called .bin and I had always wondered what the hell is different between .bin and .iso, so with this article I try to explain it a little bit.

In order to understand the reason for the two systems what we have to look at are the sectors a CD has. That is, the information is stored just like on hard disks, in sectors. Which for the uninitiated ends up being translated as audio 'frames'. As I already commented in the article: Different CD-ROM formats there are two ways of burning CDs, 1 and 2, these modes make the sectors different depending on the mode.

At a normal playback speed (1x), 75 sectors per second are read. At 2x 150sectors per second are read, etc. The seek time, while the disc is spinning they require a starting position, that reduces the speed increases.

Since CDs are initially designed to play audio when we use them to store data we need some additional headers and error correction in each of these sectors. Next you can see the differences there are between the sectors according to modes 1 and 2.

cdsectors.gif

The text that follows I have taken directly from: The Code Project - Bin2Iso.

Mode 1 Sectors

Mode 1 sectors are intended for the storage of computer data and contain the following fields.

  • Sync (12 bytes) which is used to enable the player to identify the start of each sector.
  • Header (4 bytes) consisting of Minutes, Seconds, Sectors and Mode (= 1).
  • ECC (Error Correction Code - 276 bytes), which comprises an additional level of CIRC error protection.
  • EDC (Error Detection Code - 4 bytes) for detecting errors to be corrected.

Mode 1 sectors are the simplest type and are used for most CD-ROM based formats which follow the Yellow Book.

Mode 2 Sectors

Mode 2 sectors are used for those formats based on CD-ROM XA and can be either Form 1 or 2.

  • Mode 2 Form 1 sectors contain 2048 bytes with the same ECC as Mode 1 sectors.
  • Mode 2 Form 2 sectors contain 2324 bytes of user data per sector, with no ECC are suitable only for data where errors can be concealed (eg audio or video data).

Mode 2 sectors comprise the following fields:

  • Sync (12 bytes) which is used to enable the player to identify the start of each sector.
  • Header (4 bytes) consisting of Minutes, Seconds, Sectors and Mode (= 1).
  • Subheader (8 bytes) contains content related parameters eg data type.
  • ECC (Error Correction Code - 276 bytes) which comprises an additional level of CIRC error protection for Form 1 only.
  • EDC (Error Detection Code) for Forms 1 and 2.

Note that Mode 1 and Mode 2 Form 1 use the same error correction so can be used interchangeably, but not within the same track and preferably not on the same disc. Software used to write CD-Rs can be set for Mode 1 or Mode 2 Form 1. Almost all PCs and Macs will read Mode 2 Form 1 CD-ROMs as well as Mode 1.

Note that any CD-ROM will contain at least some Mode 1 or Mode 2 Form 1 sectors.

Capacity

The capacity of a CD-ROM depends on whether it is a Mode 1 CD-ROM or Mode 2 CD-ROM XA. Assuming the maximum size is 76 minutes 30 seconds (as recommended) this means that there are 336,300 sectors on a CD-ROM. From this must be subtracted 166 sectors at the start of track 1 plus a few sectors for the file system, amounting to, say, 200 sectors leaving 336,100 sectors for user data.

  • Mode 1 sectors contain 2048 bytes per sector giving a total capacity of 688,332,800 bytes or 656MB (where 1 MB = 1024 * 1024).
  • Mode 2 sectors contain either 2048 or 2324 bytes per sector so will have a somewhat higher data capacity depending on the mix of the two types of sector.

The above assumes a CD-ROM comprising a single track in a single session. For multiple track/session discs the data capacity will be reduced.

With this information, now it is easy to develop a program to convert one image format to another.