------------------------ AmigaOS 3.2 project -------------------------

DAControl 1.21 (25.4.2020)

- First regular AmigaOS 3.2 build for DAControl

DAControl 1.22 (28.4.2020)

- Added a workaround for opening disk image files which contain
  wildcard characters. If a file can be opened right away, it
  will be used as is. This avoids involving the pattern matching
  directory scanning functions in dos.library which might otherwise
  try to find a match for the supposed wildcard pattern and fail.

DAControl 1.23 (29.4.2020)

- The STOP option now checks if no unit or device was provided,
  just to be safe.

- Stopping a unit now prints the actual unit number in its
  error message, if there is an error.

- When processing the list of files to mount, etc. a [Ctrl]+C
  prior to the Lock() test. This makes sure that you can
  even abort the processing if MatchFirst()/MatchNext() is
  never used.

- Seems that reusing a unit/AmigaDOS file system device could
  deviate when mounting a disk image file.

DAControl 1.24 (30.4.2020)

- When using the CREATE option, the label text is now considered
  invalid if its length is 0.

- A device name with length 0 is considered invalid now.

- For extra paranoia, we now check if a NUL-terminated BCPL
  string is really NUL-terminated.

- The START option now has the effect of remembering the name
  of the AmigaDOS file system device started. It didn't do
  that before.

- Added extra parameter checking for the EJECT and CHANGE options.

- When storing the name of the last AmigaDOS file system device,
  the terminating ":" could have been omitted by accident.

- PROTECT is now an alias for the WRITEPROTECTED option. This
  goes both for the command line parameter and the icon tool
  type entry.

- If no device name is provided to open_and_mount_disk_image_file()
  it will no longer attempt to print its name in verbose mode.

- insert_media() now updates the state information just like it's
  done for the MatchFirst/MatchNext loop to follow. This means that
  the number of parameters processed will be updated with each
  entry and processing will stop if the number of file names
  given is limited.

- If mount_floppy_file() fails to start the file system for the
  AmigaDOS file system device, it will no longer accidentally free
  the memory allocated for the device node data structure. Now it
  makes sure that the device node data structure will stick around.

- Added a whole lot of assertions which I hope will never
  get triggered...

dacontrol 1.25 (1.5.2020)

- Replaced the DeviceNode startup field wrangling with one single
  function responsible for the whole affair. This renders two
  different implementations of the same basic silly walk code
  obsolete.

- Updated the documentation.

dacontrol 1.26 (1.5.2020)

- The START option now requires a unit number to make sense,
  unless it is paired with the LOAD or CHANGE options.

- Added more assertions and debug code.

dacontrol 1.27 (2.5.2020)

- Added the OVERWRITE option which changes how the CREATE
  option deals with existing image files.

- If possible, the AmigaDOS file system device name ("DA0", etc.)
  corresponding to a unit number will be picked up and used in
  error and progress messages.

- If the START option combined with the LOAD/CHANGE options
  should fail to set up the AmigaDOS file system device name,
  it will now show an error message rather than cause the
  medium insertion go awry.

- Added more progress messages which are shown if the VERBOSE
  option is used.

dacontrol 1.28 (2.5.2020)

- If no device/unit option is provided, we now default again
  to the behaviour of UNIT=ANY.

dacontrol 1.29 (3.5.2020)

- Removed the lonely PrintFault("DAControl", error) which produced
  an error message without indicating what it referred to. Since
  DAControl normally produces specific error messages for anything
  but the simple errors (out of memory, [Ctrl]+C was hit, etc.)
  this PrintFault() had to go.

- Removed the duplicate error_code/error variable declarations which
  seem to be leftovers from copy & paste code :-/

dacontrol 1.30 (5.5.2020)

- Added the BOOTABLE/INSTALL option, so that you can now create
  a bootable disk image without having to go through the
  "Install" command first.

DAControl 1.31 (6.5.2020)

- The safe minimum stack size for DAControl turned out to be
  more than 4100 bytes, which is why it now makes sure that
  it has at least that much memory available for use,
  plus a safety margin.

- Added the FILESYSTEMTYPE option which works in conjunction
  with the CREATE option. For example FILESYSTEMTYPE=FFS+INTL
  will format the disk image created using the FFS in
  international mode.

DAControl 1.32 (7.5.2020)

- Moved the Workbench icon handling into a separate function.

- Changed the optimization options for the default build to
  use optimization for time, and not to allow for local functions
  to be inlined. This caused stack size usage to plummet from
  4K to barely 2.5K and rendered the stack swapping measures
  redundant.

- When 'formatting' a disk image file the label is now
  printed correctly.

- Fixed a "free twice" error in the icon processing code.

- The icon processing code could end up closing the file it
  had just handed over to a trackfile.unit. Fixed.

- Added more debug output.

dacontrol 1.33 (10.5.2020)

- When using the CREATE option, DISKFORMAT=FFS now actually works
  and won't format the disk image as OFS.

- When using the INSTALL option, the boot block initialization
  will no longer have the effect of resetting the file system
  type to OFS.

DAControl 1.34 (16.5.2020)

- Installing a boot block does not need to involve an
  Inhibit() operation. That is required only for the formatting
  process.

DAControl 1.35 (23.5.2020)

- Added the FILESYSTEM option which can be used to load a
  specific file system (e.g. "L:FastFileSystem") for the
  purpose of testing. The default is to always use the
  default (of course!) ROM file system. Please note that
  the file system you can pick is assumed to be compatible
  with the FastFileSystem on disk, and that it does not use
  BCPL style file system linkage. In other words, it should
  be written in 'C' or assembly language and execution should
  start with the very first word of the binary.

DAControl 1.36 (23.5.2020)

- If the VERBOSE option is in use, mounting a file system
  will now state if a device is mounted using the custom
  file system specified through the FILESYSTEM option. Also,
  if the choice of the custom file system was overridden
  by the FileSystem.resource database verbose output will
  state so.

DAControl 1.37 (23.5.2020)

- The EJECT and CHANGE options now tell the file system device,
  if it's active and listening, to let go of the device driver
  unit before the disk image file is ejected. Just like it's
  supposed to work, if the file system is responsive. Trying
  to replicate the behaviour of real disk drives is not
  enough...

DAControl 1.38 (24.5.2020)

- Converting a string representing a number now actually works
  for numbers larger than 9, including overflow detection.
  Thank you, Camilla!

DAControl 1.39 (25.5.2020)

- Updated the documentation, which now also covers the
  FILESYSTEM option in detail.

- If the file system cannot be started, DAControl will no longer
  release the memory allocated for the entire DeviceNode data
  structure it just added. This had nasty side-effects :-(

- Starting the file system for which mount information was
  just added now happens UnLockDosList() has been called,
  instead of with the list locked.

- Simplified how the file system just mounted is accessed, by
  switching to a single global variable which is updated as
  needed. Also, instead of DeviceProc() we now use the
  safer GetDeviceProc() function instead.

- Moved all the packet operations into a separate function
  which automatically does the right thing if the file system
  to send them to is not yet known.

DAControl 1.40 (25.5.2020)

- So starting the file system didn't work because the file
  system device name was empty...

DAControl 1.41 (28.5.2020)

- First steps towards breaking up this monolithic command into
  more manageable portions.

DAControl 1.42 (28.5.2020)

- Now in a bit more manageable form. "cmd_main.c" is still a lot
  larger than it needs to be, though :-/

DAControl 1.43 (30.5.2020)

- When creating a new disk image file, the file's protection
  bits are now updated after the file has been closed. Previously,
  the change would not necessarily take effect because the file
  was still open for exclusive access.

- FreeGlobalData() now also replies the Workbench startup message,
  if there is one. This resolves a use-after-free bug in the
  program's startup code which could manifest itself if DAControl
  was launched from Workbench.

- insert_media_by_name() could return with a FileLock still
  in use. Fixed.

 - Updated the code documentation.

DAControl 2.1 (31.5.2020)

- Updated to support the optional USECHECKSUMS feature for
  detecting identical disks, which usually spell big trouble
  for the Amiga ROM file system (it crashes).

- Icon tool types can now use the FILESYSTEM option, too,
  in order to specify exactly which disk-loaded file system
  to use.

- An empty FILESYSTEM name is now flagged as an error.

DAControl 2.2 (1.6.2020)

- Changed the USECHECKSUMS option to use YES and NO as
  parameters, and also documented it. The USECHECKSUMS option
  now also works in icon tool types.

DAControl 2.3 (7.6.2020)

- Made the cleanup code in mount_floppy_file() safer to use,
  since it's not a given that AddDosNode() failing will set
  the IoErr() code to a non-zero value. The new code now
  avoids freeing any of the memory allocated if AddDosNode()
  has succeeded.

- When started from Workbench as the default tool of a disk
  image file project icon, DAControl now shows error messages
  instead of just skipping images for which errors occur.
  The error requester will display the name of the disk image
  file, which hopefully will be noticed and helpful...

  If more than one disk image file icon was selected, DAControl
  will show an error requester which gives the user a choice
  to continue processing the remaining icons, or to stop processing
  entirely.

DAControl 2.4 (11.6.2020)

- The test which verifies that the disk image file size
  matches what trackfile.device can support now uses the
  new trackfile.device API for this purpose. This keeps
  the behaviour consistent and avoids code duplication.

- Now opens trackfile.device very early, and also requires
  trackfile.device V2 (or higher) to run now.

- Standardized the DosList scanning procedure.

DAControl 2.5 (13.6.2020)

- Actually, the API feature which DAControl now depends upon
  in trackfile.device needs more specific version and revision
  checks. You now need trackfile.device 2.12 or higher for
  DAControl to work.

DAControl 2.6 (14.6.2020)

- Now requires trackfile.device 2.15 or higher to work,
  so that we can support "dacontrol change protected=no da0:"
  and see something happening as a result.

- Added support for changing the write protection of a
  disk image without ejecting and reload it. We just
  take the file system offline briefly, change the
  state of the protection, then reactivate the
  device's file system again. Or that's the theory.
  Documentation still needs to be updated for this,
  and it also needs to be tested.

DAControl 2.7 (28.6.2020)

- You can now start a unit or load a file for a specific unit by entering,
  for example, "dacontrol load disk.adf device da0:", instead of using
  "dacontrol load disk.adf unit 0".

  This works even if "DA0:" is not currently operational. DAControl will
  examine the device name given and pick up the unit number from it. For
  this to work, the device name must begin with "DA" (case not important),
  with the remainder being a number (digits only); the ":" at the end will
  be ignored anyway.

  Thanks go to Gerben van Kesteren who suggested this feature, which
  provides consistency with the other DAControl commands that require a
  device name. The device name is arguably easier to use than the unit
  number.

DAControl 2.8 (3.7.2020)

- Added restrictions to how the unit number derived from the device
  option may be used. It only makes sense for the start, load and create
  operations to begin with. If the respective file system device
  is already mounted, that knowledge will override the unit number
  derived from the device option.

  This still needs testing, though.

DAControl 2.9 (4.7.2020)

- The AmigaDOS file system device names used by DAControl now
  always correspond exactly to the respective trackfile.device
  unit numbers they are associated with. Previously, they
  were allowed to differ if necessary. "Necessary" meaning that
  rather than not mounting a file system under the name
  suggested by the unit number (it may have been taken by a
  different file system already), the AmigaDOS device name
  would have been adapted so that the file system could be
  mounted.

- Added an extra to check for disk image files to be created
  so that empty file names will be rejected.

- The random disk label which may be assigned to a disk image
  created through the CREATE option now benefits from a bit
  more randomness through the use of a compact pseudo-random
  number generator.

- When sending an "inhibit" packet to a file system to make it
  let go of the disk device, DAControl now always makes sure
  that it knows the respective file system Process. Previously,
  that information could have been cached and might have
  possibly been stale.

- Updated the code documentation.

DAControl 2.10 (4.7.2020)

- I broke the ACTION_FORMAT operation by mistake, which means
  that the CREATE option hasn't worked for the past few versions.
  Also, error reporting for that failure was unreliable. What
  a single typo can do :-(

- Verified that "dacontrol create ram:example.adf device da5:"
  indeed starts unit #5 as specified even if that file
  system device name does not exist at this point. Likewise,
  "dacontrol load ram:example.adf device da0:" will later
  start and mount an image file even though this device
  name does not yet exist.

DAControl 2.11 (8.7.2020)

- Added list sort code (the nice, scalable kind) in preparation
  for coming attractions. No sorting takes place yet, though...

- Replaced DOS packet I/O with proper calls to Inhibit()
  and Format() commands. Turns out that the individual operations
  involving calling GetDeviceProc() and DoPkt(), etc. within
  dos.library were almost identical to what I had written to
  substitute them anyway.

DAControl 2.12 (9.7.2020)

- Updated to use TFExamineFileSize() with new TFEFS_Unsupported
  constant.

DAControl 2.13 (9.7.2020)

- Lucky number 13!

- The INFO option now shows the unit information in ascending
  unit number order again.

DAControl 2.14 (9.7.2020)

- The INFO option now shows the trackfile checksum for the
  medium, if a medium is present and checksums are enabled for
  the respective unit. If a checksum is displayed, it will
  consist of a 11 character "digest". Otherwise, there will
  just be a "-" instead.

- After ejecting a medium, DAControl will now wait a second and
  a bit before it loads a new medium. This might help applications
  which cannot respond quickly enough to a medium change
  directly followed by another medium change.

DAControl 2.15 (11.7.2020)

- Added the SAFEEJECT option, which can be either YES or NO.
  SAFEEJECT=NO is the default, which mimics the removal from
  a floppy disk drive by waiting until the drive motor has
  been turned off, indicating that it is safe to remove
  the medium. This is the behaviour of DAControl up to and
  including version 1.36. SAFEEJECT=YES will first tell the
  file system to shut down (Inhibit(.., DOSTRUE)) before
  proceeding to remove the medium, if possible. This approach
  is faster and safer because it involves the file system instead
  of expecting that the disk can be safely ejected. However,
  DirOpus is apparently unable to deal with it robustly :-(

- Removed the short delay after ejecting a medium, prior to
  inserting a new one since it had no positive impact at all.

- Added the SHOWCHECKSUMS option which has the effect of showing
  the disk checksum as part of the INFO output. The new default
  behaviour is to omit the checksum, keeping the info output
  shorter.

DAControl 2.16 (11.7.2020)

- Removed extra line feed characters from error messages.

DAControl 2.17 (13.7.2020)

- Fixed the broken icon tool type test for disabling the write
  protection. Thanks go to Mikhail Malyshev for raising the issue.

- Added more diagnostic output to the icon tool type processing.

- The icon tool type processing now ignores those types which have
  no valid parameter string to offer.

- If icon.library V44 or better is available, DAControl will now try
  to read the default icon, including its tool types, if no icon for the
  disk image file is available.

DAControl 2.18 (16.7.2020)

- Added new error codes which hopefully better describe the issue of
  duplicate image file contents and volume data (name and creation date).

- Mounting a file system no longer holds onto the global write-access
  lock for the DOS list. The dos.library/AddDosNode() call which caps
  the mount procedure handles duplicate detection all on its own.

- Workbench startup did not check for the proper minimum version of
  trackfile.device which is 2.15. It only checked for version 2. Fixed.

- Workbench startup did not unload an unused file system, leading to
  a memory leak. Fixed.

- Command line startup could unload a custom file system IF it was
  used, instead of only unloading it if it was NOT used. Fixed.

DAControl 2.19 (17.7.2020)

- The "dacontrol info" command no longer shows the unit number, since
  the device name (e.g. "DA2") now always corresponds to the unit
  number anyway.

- And we're back to stack swapping & testing how much stack space
  has been used. Turns out that the command uses almost 4000 bytes
  of stack space, which is rather dangerous. Added new code to
  allocate a larger stack (8000 bytes) if the stack size available
  at startup appears to be smaller than this minimum.

DAControl 2.20 (18.7.2020)

- Added the SHOWVOLUMES and SHOWBOOTBLOCKS options which will display
  this information, if available, if the INFO option is used.
  If there ever was a reason for getting a wide screen format monitor,
  here it is ;-)

DAControl 2.21 (19.7.2020)

- open_and_mount_disk_image_file() now reuses the already existing
  AnchorPath's embedded FileInfoBlock.

- Documented how the boot block checksum algorithm works and also
  how it is used for testing and calculating a new checksum. This
  must correspond to how trackfile.device 2.23 does this, too.

DAControl 2.22 (29.7.2020)

- Moved the code which releases the DOS list lock to run
  as early as possible in start_unit().

- mount_floppy_file() now scans the FileSystem.resource list
  for the best entry which matches the file system signature
  of the new mount entry. The best entry is the one with the
  highest respective version and revision number.

- Changed the default boot priority of the absolutely not
  bootable DAx: mount record to -128 to make the point ;-)

DAControl 2.23 (1.8.2020)

- The debug build now shows the name, version and date information
  embedded in a loaded file system. This could become more useful
  in the non-debug version.

- Changed how the MatchFirst()/MatchNext() processing works which
  was previously geared towards not bothering much about missing
  files or files matching a wildcard pattern being unavailable.
  It now follows the practice of, for example, the List and
  Type commands which stop as soon as they find that the path name
  does not exist or the file/directory does not exist. An error message
  is printed which names the file in question.

- Added the IGNORE option which changes the behaviour of DAControl
  not to stop and exit in the manner of the Type and List commands.
  It may still print an error message, and it will still stop and
  exit if the problem is more serious than missing files or
  unsuitable files.

DAControl 2.24 (9.8.2020)

- Added experimental disk image file cache control options which
  only work if enabled at compile time. These features correspond to
  the trackfile.device 2.35 build which in order to work at all also
  need to be enabled at compile time in trackfile.device.

  The new cache options are CACHESIZE=<number>, ENABLECACHE=<yes|no>
  and PREFILLCACHE=<yes|no>. The cache size (minimum = 45056) only
  takes effect *once* when the first unit is started and cannot be
  changed afterwards (at least the current state of the trackfile.device
  API does not support changing the cache size or disabling the cache
  yet). The first unit you start and specify the maximum cache size for
  will set the limits for all others. ENABLECACHE will enable/disable the
  use of the cache for this particular unit at medium insertion time. Same
  thing for the PREFILLCACHE option, which also works at medium insertion
  time. Please note that PREFILLCACHE=yes also implies ENABLECACHE=yes and
  will even override the ENABLECACHE=no option.

  Prefilling the cache for a unit makes sense only if the size of the
  cache is 901,120 bytes or higher since the prefill operation will
  otherwise replace cache entries which it previously created...

- Added a fallback for ExamineFH() not working on old file systems,
  when mounting disk image files via Workbench project icons.

DAControl 2.25 (9.8.2020)

- The maximum cache size value didn't get transmitted to
  trackfile.device when a unit was started. Fixed.

- The percentage figure calculated for the cache hit ratio was
  too far off. Fixed.

DAControl 2.26 (10.8.2020)

- Preparations for changing the cache size after it has
  been set.

- The cache-enabled build now uses a dedicated header
  file ("cache.h") which contains the preprocessor
  definition which enables the cache.

- The minimum cache size constant has moved to the
  <devices/trackfile.h> header file.

DAControl 2.27 (10.8.2020)

- Integration of "cache.h" into the build could have worked
  better...

- Adjusted the size of the "Cache rate" column to have room
  for up to 11 characters; used to be 9 characters.

DAControl 2.28 (13.8.2020)

- Updated the code documentation.

- Modest changes prompted by testing with clang.

- A cache size of 0 is now a valid number.

- Renamed the local versions of strlcpy(), strlcat(), vsnprintf(),
  vsprintf() and strtok_r() so that they no longer clash with a
  true C99 compliant set of header files.

DAControl 2.29 (13.8.2020)

- Added the missing pieces needed to let you change the shared
  cache size or enable/disable caching for a particular unit after
  you have started the first unit and loaded a medium. Now
  it's time to figure out if these changes actually out as intended...

DAControl 2.30 (15.8.2020)

- Changing the maximum cache size and whether or not the caching is
  enabled now actually works.

- The minimum useful cache size is now 46000 bytes.

- The cache feature is now enabled by default.

DAControl 2.31 (16.10.2020)

- The error requester display was slightly broken because
  the intuition.library/EasyRequest function had been used
  instead of the more appropriate EasyRequestArgs function.


DAControl 2.32 (7.1.2021)

- Before calling MatchFirst(), the AnchorPath structure passed to
  is always cleared and reinitialized. This is necessary because
  the AnchorPath structure is reused for all the files or directories
  which may need to be copied and the last call to MatchNext() may
  have set flags which are still set when MatchFirst() is called
  again.


DAControl 2.33 (7.1.2021)

- Failing to find a file to open would print an error message and
  then get stuck in the loop which examined what was found. Fixed.
  Thanks go to Mikhail Malyshev for finding the problem.


DAControl 2.34 (7.1.2021)

- Fixed "dacontrol change device=da0: protect=yes" which was
  broken because of a faulty parameter test for the "protect"
  argument. Thanks go to Mikhail Malyshev for finding the problem.
