Skip to content

IMG.CFG Configuration File

Keir Fraser edited this page Feb 1, 2023 · 13 revisions

FlashFloppy can usually automatically determine the layout of IMG/IMA/DSK files, based on their size and (optionally) a hint about the host they target (FF.CFG: host=).

However, there are such a wide range of systems that FlashFloppy cannot hope to support them all automatically. For example, the CP/M operating system does not have a standard disk layout, and these systems among others require a degree of manual configuration.

The solution is an INI-style configuration file called IMG.CFG, placed in the root folder or FF/ subfolder of your USB drive. An example is provided in the examples/ subfolder of the FlashFloppy distribution.

NOTE: If FF/ exists, IMG.CFG must reside there, as the root folder isn't searched.

Tags

The file is divided into sections, each starting with a tag in square brackets of the form [<tagname>][::<filesize>]. This matches files as follows:

  1. <tagname> matches images of the form *.<tagname>.{img,ima,dsk}
  2. Missing (empty) tagname matches any *.{img,ima,dsk} which is untagged or does not match any other defined tag.
  3. Tagnames and their matches are NOT case sensitive.
  4. <filesize>, if specified, must exactly match the image filesize.
  5. If an image matches no tag, FlashFloppy uses normal geometry auto-detection based on the host= setting in FF.CFG.

For example, [dsdd80::737280] matches images with both:

  1. Name of the form *.dsdd80.{img,ima,dsk}
  2. Size exactly 720kB (737280 bytes).

Geometry Parameters

Within each tagged section, a set of geometry parameters, mandatory and optional, are specified. These are listed below.

For optional parameters, the default values are marked by asterisk.

Image Scope

Image-scope parameters apply to whole disk images. They cannot appear in a tracks sub-section (as described below).

  • cyls = 1-255 (Mandatory)

    • Number of cylinders
  • heads = 1-2 (Mandatory)

    • Number of heads (aka sides)
  • step = 1-255 (1*)

    • Number of drive-head steps between cylinders
    • For example: step=2 simulates a 40-cyl disk in an 80-cyl drive
  • file-layout = interleaved* | sequential | reverse-sideN | sides-swapped

    • Image file track layout
    • Multiple values can be specified, separated by commas (eg. sequential,reverse-side1)
    • sequential: Sequential cylinder ordering: all side 0, then side 1
    • interleaved: Interleaved cylinder ordering: c0s0, c0s1, c1s0, c1s1, ...
    • reverse-sideN: Side-N cylinders are in reverse order (high to low) (N=0,1)
    • sides-swapped: Sides 0 and 1 ordering is swapped in the image file

Track Scope

Track-scope parameters are by default applied to all tracks unless preceded by a tracks declaration:

  • tracks = <track-list>
    • track-list ::= <track-range>[,<track-list>]
    • track-range ::= <cylinder>[.<head>] | <cylinder>-<cylinder>[.<head>]
    • cylinder ::= [0-9][0-9]*
    • head ::= 0|1
    • If no head is specified in a track-range, then all heads are assumed.
    • Examples:
      • 0-23.1,45.0 specifies head 1 of cyls 0-23 and head 0 of cyl 45.
      • 27-33 specifies all heads of cyls 27-33.

The track-scope parameters are:

  • secs = 0-256 (0*)

    • Number of sectors per track
  • bps = 128 | 256 | 512 | 1024 | 2048 | 4096 | 8192

    • Data bytes per sector
    • Mandatory if secs is non-zero
    • May be specified as a comma-separated list if sector sizes vary
      • For example: 512,512,512,512,512,512,512,512,256
  • img_bps = 0* | 128 | 256 | 512 | 1024 | 2048 | 4096 | 8192

    • Bytes occupied per sector in the IMG file
    • Smaller sectors will be padded
    • Default is 0: Sectors occupy precisely their data size, no padding
  • id = 0-255 (1*)

    • ID of the first sector on each track
    • Successive sectors are numbered sequentially upwards
    • Numbers may be expressed in hexadecimal with 0x prefix (eg. 0xab).
  • h = 0|1|auto (auto*)

    • Head number for all sectors on the track
    • auto: Use the physical drive head number
  • mode = fm | mfm*

    • Recording mode
  • interleave = 1-255 (1*)

    • Sector interleave (default is 1:1, which is no interleave)
  • cskew = 0-255 (0*)

    • Sector skew per cylinder (default is 0, which is no skew)
  • hskew = 0-255 (0*)

    • Sector skew per head (default is 0, which is no skew)
  • rpm = 1-1000 (300*)

    • Rotational RPM
  • gap2 = 0-255|auto (auto*)

    • Sector post-ID gap, in bytes.
    • auto: Auto-select based on recording mode and sector size
  • gap3 = 0-255|auto (auto*)

    • Sector post-data gap, in bytes.
    • auto: Auto-select based on recording mode and sector size
  • gap4a = 0-255|auto (auto*)

    • Post-index gap, in bytes.
    • auto: Auto-select based on recording mode and sector size
  • iam = yes* | no

    • yes: Index Address Mark included at the start of each track
  • rate = 0-1000 (0*)

    • Data rate in kHz (kbit/s).
      • eg. 250 is MFM DD, 500 is MFM HD, 125 is FM SD.
    • 0: Auto-select based on recording mode and size of track