FileCore Log File
-----------------

Changes leading to version 2.05
-------------------------------

 *  Fix FileCore to make use of Hdr: constants where they're defined.
 *  FileCore extended to support FSControl CanonicaliseDiscAndPath and ResolveWildcard.
 *  FileCore DiscOp 9, CachedReadSectors added.
 *  FileCore_DiscardReadSectorsCache added.
 *  TickerEntry fixed to process TickerState properly

Changes leading to version 2.06
-------------------------------

 *  Fix UnLinkByDisc/Drive to handle uncertain discs properly. Symptoms of bug: occasional broken directory errors.

Changes leading to version 2.07
-------------------------------

 *  Fix UnLinkByDisc/Drive to only dismount Data discs after unlinking -
this was in before, but had a bug in it. Symptoms of bug: when doing a
SaveCreate to floppy the floppy root directory got written to the hard disc
root directory. How: SaveCreate started a FindDisc whilst BufDir was valid -
the FindDisc Unlinked the old disc from the drive and thus dismounted it
invalidating BufDir. However, CritBufDir was pointing to the hard disc's
root directory and SaveCreate continued assuming BufDir was still valid.
Eventually the modified dir was written out using the CritBufDir address
which wasn't modified to be the correct value due to BufDir being corrupted.

 *  Fix InitZoneObj to return the *correct* end of map bits offset for the
given zone. InitZoneObj returns the information to start a walk through the
fragment list for a given zone. One of the parameters returned is the end
offset. It used to return the beginning of the next zone as the end offset,
which was wrong as it took no account of ZoneSpare - the indicator of how
many junk bits there are on the end of each map block.

Changes leading to version 2.08
-------------------------------

 *  Fix BeforeAlster/ReadFsMap to lock the correct controller while doing
this. Symptom: address exception when accessing a floppy on a configured
winnies 0 system.

Changes leading to version 2.09
-------------------------------

 *  Fix/extend FileCore_LayoutStructure to handle hard disc-like formats.
 *  Fix defectspace to have enough room for floppy defect lists.
 *  Remove *noURD, *NoLib, *NoDir and *Title, these being made redundent.
 *  Add F-format to list of formats supplied.
 *  Add handling of format-parameter hangover. This feature holds some of
        the fields from a WrtTrkOp (format a track) in readiness for the
        mount after format which is assumed to be going to lay out a disc
        structure. Any non-verify op cancels the stored values. Whilst the
        last op was a WrtTrkOp the disc will automatically mount and remain
        unchanged with the format parameters and will be forced to be a data
        disc. Dismount cancels this.

Changes leading to version 2.10
-------------------------------

 *  Fix Floppy/WinnieOpDone to preserve r2 as the PRM says they should.
 *  Fix FileCore_LayoutStructure to round up the boot block object's size correctly.
 *  Fix *Verify to use ZoneSpare correctly.
 *  Fix CanonicaliseSpecialAndDisc to correctly terminate at 10 chars
 *  Fix IdentifyDisc on E format floppies with a non-0 boot option to work.

Changes leading to version 2.11
-------------------------------

 *  Exists due to version system use cockup

Changes leading to version 2.12
-------------------------------

 *  Fix CachedReadSecsOp to handle SectorSize, Heads or SecsPerTrk being 0 (uses values of 10, 1 and 1)
 *  Fix Mount to copy DiscSize for old filing systems which don't support hard disc mounting.
 *  Remove (now redundent) handling of ReadCSDName, ReadDiscName and ReadLibName
 *  Fix DoOsFunBootup to IdentifyCurrentDisc for the disc to boot.
 *  Fix fsentry_func to allow reentrance on CanonicaliseSpecialAndDisc
 *  Fix CanonicaliseSpecialAndDisc to use FindDiscByName rather than FullLookup for safety of reentrance
 *  Fix IdentifyCurrentDisc to use FileSwitch to get the current disc.
 *  A a subsequence of the above these *-commands/interfaces now work properly with the new FileSwitch:
        checkmap, compact, dismount, free, map, verify, fsfunc_Opt.
 *  Enable reentrance on fsfile_Load and fsfile_ReadInfo.
 *  Add support for fsfile_readblocksize.
 *  Fix bug whereby defects at the end of fragments were incorrectly
handled: If the defect was in a free fragment which was the last fragment in
a zone and it was within one MinMapObj of the end then there was a stiff up.
 *  Add support for:
        fsfunc_DefectList
        fsfunc_AddDefect
        fsfunc_ReadBootOption
        fsfunc_WriteBootOption
        fsfunc_UsedSpaceMap
 *  Optimise F format parameters - for reliability and speed across machines
 *  Internationlise it

Changes leading to version 2.13
-------------------------------

 *  Fix SWI entries to be not very 'inside' FileCore, ie allowing entrance
even if any interlocks are set or if there's a locked disc. This enables
DiscOp to be externally entered whilst doing an IdentifyDisc.
 *  Fix Identification of FileCore discs to SWI DiscOp rather than branching
to the internal routine RetryDriveOp.

Changes leading to version 2.14
-------------------------------

 *  Insert ChkKernelVersion in init sequence.

Changes leading to version 2.15
-------------------------------

 *  If *Backup if Same Disc situation then returns to ask for disc again
        rather than bombing out.
 *  Escape when waiting for a user response now acknowledged and returned as
        and error.
 *  Wait for key pressed after checkmap gave good answer no longer takes place
 *  Fix UpCalling to return a correct media type ('disc' for example).
 *  Separate the message handling code into a different source file.
 *  Get *Free to UpCall through to FileSwitch for the information.
 *  Fix Light entries (eg DiscOp) to allow reentrance to a level of 4.
 *  Fix error generation to give error numbers of the form &0001ffee, not &0000ffee
 *  Use FileSwitch NameDisc interface for *NameDisc, and add support for the
        lower level version
 *  Fix OSFile_WriteInfo on a disc's root object to stamp the disc with a
        new disc id.
 *  Fix matching of a new disc with an old record to set NeedNewIdFlag to
        ensure a different machine sees a different Id when the disc gets
        updated.
 *  Add call to FSControl_StampImage_NextUpdate on identifying an old
        non-FileCore disc.
 *  Add support for fsargs_ImageStampIs.
 *  Prevent non-auto-errors from error in vetting SWI
 *  Fix SWI dispatch code to only resolve r8-WP style SWIs if its one
        listed, not if its not one listed. This aids robustness.


Changes leading to version 2.16
-------------------------------

 *  Fix identification sequence to strcmp disc name rather than memcmp the
        discname field.
 *  Fix DiscOp to complain about FileCore in use if locked disc mismatches
        DiscOp disc.
 *  Lighten up some of the File and Func entries to enable
        FSControl_StampImage to work better.
 *  Make writes to disc images non-background to avoid data lost on disc
        image files.


Changes leading to version 2.17
-------------------------------

 *  Fix handling of Service_IdentifyDisc to not corrupt r7
 *  Add support for FSEntry_func 33 (ObjectAtOffset)
 *  Add support for FileSwitch Truncate bit.
 *  Fix bug whereby a reference to a bad drive (single drive character)
        caused a please insert disc 'N' rather than returning a bad drive
        error.
 *  Remove Kludges and implement support for removable winnies and winnies
        which support mount properly.

Version 2.18

 *  Fix bug whereby fsfunc_ResolveWildcard returned FileCore error rather
        than the actual error generated.
 *  Fix bug whereby fsfunc_ResolveWildcard returned NotFoundErr rather than
        r2=-1 when the directory wasn't found which contained the wildcard
        which wanted resolving.
 *  Change text of 'File Core error' to 'FileCore error'
 *  Fix *Mount to explicitly do *Dir :<disc>.$, *Lib :<disc>.$.Library, *NoURD
 *  Fix bug whereby when a file is closed which has been truncated to 0
        length, then its buffers are released, free.
 *  Fix the 'foo' 'blah' bug. This bug was characterised by a program which
        openned a file, wrote 'blah' to it, closed it, openned it, read it,
        printed the result, truncated it, closed it, openned a file, wrote
        'blah' to it, closed it, openned it, read it, printed the result,
        truncated it, closed it then repeated. The expected output was
        'blah', 'foo', 'blah', ...., but sometimes 'blah', 'blah', ... would
        come out. The actual bug was that when a file was closed and
        and truncated, the internal Fcb didn't have its buffers junked.
        These buffers were incorrectly picked up later as the contents of
        the file - hence the problem.
 *  Fix bug whereby when a file was closed and converted to a shared object
        the Fcb didn't follow it. Consequence was buffers were held up
        attached to Fcbs which shouldn't have been.
 *  Fix bug in responding to FSArgs_ImageStampIs.
 *  Get FileCore_FreeSpace to indirect through FSControl_ReadFreeSpace.
 *  Tidy up menu text of formats.
 *  Fix *free to handle non-:-prefixed disc specifiers.

Version 2.19

 *  Fix PutBytesEntry to trash any buffers on a image disc. This prevents
inconsistencies creeping into the buffer cache.
 *  Fix silly mistake which broke FileCore_DiscOp.

Version 2.20

 *  Fix corrupt to broken in relevant messages.
 *  Fix handling on unidentified discs such that a disc will only be
        remounted if it has changed as indicated by the lower level drivers,
        and a disc will be identified only if needed. This fixes a problem
        in desktop verify whereby after pausing and waiting for the disc
        light to go out then restarting the verify continues with a seek to
        track 0 before each verify - this was a mount happening. Now - and
        this is unfixable in FileCore - two seeks happen - one because the
        disc might have changed as the drive wasn't spinning and disc
        changed and one as the drive was span up in the changed doesn't work
        and the motor was off state.
 *  Fix bug whereby *help format gave address exception.
 *  Remove duff 'feature' whereby if a mount failed the error was propogated
        through all future mounts until the disc might have changed.
 *  Fix bug whereby FSControl_StampImage didn't.
 *  Add section to doc.SwiChanges regarding extention of WrtTrackOp.
 *  When detaching disc from drive ensure drive gets 'LastDiscOpWasFormat'
        cleared.
 *  Issue Service_DiscDismounted on *Dismount and shutdown.
 *  Fix disc identification to cope with 1-zone hard discs with the root
        directory positioned after the boot block.
 *  Fix FileCore_LayoutStructure to be able to layout 1-zone hard discs and
        D format hard discs.
 *  Fix FileCore to respond to FileSwitch informing it of disc name changes
        of MultiFS images FileCore has open.
 *  Fix handling of LastDiscOpWasFormat disc record parameter propogation
        scheme to correctly drop that flag when the disc changes.
 *  Fix dismounting to dismount the disc (bug introduced in
        Service_DiscDismounted code).

Version 2.21

 *  Fix bug in identifying hard discs whereby the defect list sanity check
        managed to be ignored when identifying a D format hard disc.
 *  Slacken D and L format floppy detection to accept any D or L-like disc
        which claims its disc size is less than or equal to 4 tracks-worth
        over a standard D or L floppy's size. This slackening is to
        accomodate some applications which use sectors beyond the end of the
        recorded disc size as a protection mechanism. An extra 4 tracks is
        allowed to accomodate formats which use more than 80 tracks -
        the number 4 being the number of extra tracks a couple of floppy
        drives which were tried would allow.

Version 2.22

 *  Fix bug such that error from mount wasn't propogated up properly which
        lead to FileCore trying to use internal structures which hadn't been
        set up properly ending up at an address exception. Short description
        of bug fixed: click on floppy disc icon gives address exception,
        icon disappears and get FileCore in use errors.

Version 2.23

 *  Fix acceptance of D-format discs to reject those with 0-filled sectors.
 *  Fix bug in hard disc free space evaluations which would give address
        exception on D-format hard discs.
 *  Fix bug in fsfunc_ResolveWildcard to give DirNotFound rather than broken dir.
 *  Filter out 0-byte foreground transfer ops (read/write/verify). Gets
        round bug in ADFS whereby it didn't call FileCore's release FIQ
        routine in this situation. This lead to FIQ claimed and Econet being
        stiffed as a consequence. This happened when stretching a 0-size
        file on a D-format disc where two 0-size transfers were requested to
        move the file from position 0 on the disc to the place where the
        free space had been allocated.
 *  Only look up a disc name for CanonicaliseSpecialAndDisc when the
        supplied name is a drive or wildcarded disc name. This prevents
        unwanted remounts of discs.
 *  Split FileCore50 into InitDieSvc and Commands.
 *  Fix *Backup to handle F and foreign disc formats.

Version 2.24

 *  Slacken off check of boot parameters to accept hard discs with more than
        0 sectors per track, rather than more than 4. This gets round daft
        parameters put onto SCSI discs.

Version 2.25

 *  Improve disc identification as follows:
        Don't try to identify a hard disc with a floppy disc format.
        When identifying E floppies ignore sectors per track - copy
                protection schemes can confuse this value.
        Copy sectors per track from E format into internal disc record to
                robistfy against copy protection schemes.
 *  Don't swallow errors from winnie mounts.
 *  Fully identify disc for DiscOps.
 *  Fix response to Service_EnumerateFormats to not trash the list so far.
 *  Return to RiscOS 2.00 Ambiguous disc response to avoid clashes with some
        copy protection schemes.
 *  Ensure disc Id is updated whenever necessary. The following cases were
        not covered in Risc OS 2.00:
        *  Close of a modified file whose size hadn't changed.
        *  Modification of a file (before close).
 *  Trim workspace down.

Version 2.26
 *  Set fsextra_DoFileInfoForMe.
 *  When stretching a scatter entry, don't do it if its of 0 length.
 *  Fix bug in FSFunc_ResolveWildcard when old directory names weren't
        masked when copied into the buffer.
 *  Fix bug whereby break action got set to &22 by incorrect nesting in
        WriteDir.
 *  Fix set attributes on a disc to handle non-FileCore discs properly.
 *  Fix bug whereby if, during write behind, the low level driver transfered
        exactly 128k bytes and finished after FileCore started looking at
        the background process after it had decided to wait for it to catch
        up so it could stretch it with more buffers then FileCore would fail
        to notice and wait for ever.
 *  Stop scatter list extension except by add new scatter pairs. Extending
        the last pair caused bad headaches for filing systems so this
        feature has been removed.
 *  Fix bug where small files when converted to shared on close didn't keep
        the FcbBufSz up to date with the change. The consequence of this is
        a stiff when the file is next read using GBPBs.
 *  Fix bug where sometimes formatting a disc with defects would fail, but
        appear to succeed. Bug was in FileCore_LayoutStructure's handling of
        the addition of defects.
 *  Fix convert to shared file on close to always update the Fcb, not just
        when there's a move of data to be done to do the conversion.
 *  Fix ReleaseFcbBuffersInRange to wait for active Fcb buffers to be passed
        through the process before moving them into the empty chain. This
        avoids them being moved into the empty chain (and off the Fcb's
        chain) before being moved to, say, the read ahead chain, and so
        being on the read ahead chain, but off any Fcb chain, and thus lost
        to the world.
 *  Support extension to Service_IdentifyDisc which enables a text
        identifier for the disc format to be returned.

Version 2.27
 *  Fix bug where FileCore could stiff on a write to a foreign disc.
 *  On format track dismount any attached disc.

Version 2.28
 *  Only cancel LastDiscOpWasFormat on Changed or empty, but not on
        MayBeChanged. Prevents problems during format sequence if disc was
        write protected at the start.
 *  Ignore error from StampImage_NextUpdate issued from WhatDisc. Prevents
        disc not being seen when accessed as a file which isn't FileSwitch's
        image file for that disc.

Version 2.29
 *  Fixed bug in CachedReadSecs which caused corruption in tight memory
        situations.
 *  Fix bug in PutBytes on foreign floppies where cached read-ahead sectors
        weren't correctly discarded. Caused DOSFS horrible problems!

Version 2.30
 *  Fixed bug whereby ReadAhead restart failed to notice a lack of available
        buffers until it had shook ADFS's arm and caused the floppy light to
        stay on.
 *  Fix response to Service_IdentifyDisc to make no assumption about which
        incarnation is being used - enables ADFSFiler's current format menu
        box work properly.

Version 2.31
 *  Fix buffer allocation to not push its luck with RMA and system heap.
        Algorithm claims all but last 2k of largest blocks in these heaps.
        This causes *backup to work, and other parts of the system don't get
        bad headaches when backup goes on.

Version 2.32
 *  Adjust identify disc to report ADFS 1.6M on hard discs to get ADFSFiler
        menu current format to report sensible value.

Version 2.33
 *  Fix ReleaseAllFcbBuffersInRange (and, consequently ReleaseAllFcbBuffers)
        to preserve r0 like it was supposed to before it was broken by an
        earlier fix for a different bug. Prevents free space map rot when
        closing files which have been truncated to 0 length - the freed
        space gets freed.

Version 2.34
 *  Add PreferredDisc code to conteract ambiguous disc name problems.
        Basically CanonicaliseSpecialAndDisc of a drive number prefers the
        found disc, and of a disc name causes no disc to be preferred. When
        FindDiscByName-ing the preferred disc (if present) is checked first
        (no ambiguity possible), then all are checked (ambiguity possible).
 *  Handle case insensitivity in an international fashion.

Version 2.35
 *  Extend the process scatter buffer to be large enough for the un-merged
        sub-buffers of the file cache. Avoids address exceptions with IDE
        ADFS.
 *  Fix to CachedReadSecsOp in memory-tight situations: avoid sector
        skipping on multi-sector operations, and thus stopping hard discs
        being recognised.

Version 2.36
 *  Make use of *Format parameter supplied flag in enumformats block to
        support desktop non-interactive *Format.
 *  Fix FSControl_FreeSpaceMap to work on a full D or L format disc (fixes
        backup on these varieties of disc) - change in FileCore60. Problem
        was routine expected 1 or more free space entries, not 0 or more.
 *  Remove check on disc size being < 512M so that large discs with UNIX
        partitions work again (RP-0711).

Version 2.37
 *  Remove 'Same disc' check from *Backup. Avoids discs from filing systems
        which can't provide a good disc uniqueness cycle number from causing
        embarasment when backing up onto a backup of that disc (ie always
        allow a backup even if the destination looks like the source).
 *  Enable *Backup to work more reliably. Problems were caused by
        uninitialised memory. (Symptom: click Y to perform backup, disc
        spins and that's it, or you get a 'Protected disc' error).

Version 2.38
 *  Calculate file allocated size on open accurately for RP-0966.
 *  Adjust size of open file after allocation based on actual allocation
        amount, not amount requested RP-0966.

Version 2.39
 *  Use RMA rater than system heap for file control block allocations.
        Prevent unexpected (and apparently random) No free memory (in heap)
        errors.

Version 2.40
 *  Remove 1K of junk from workspace.

Version 2.41
 *  Fix disc map breaking in CloseFileEntry. Problem was release of disc
        space on close wasn't releasing enough due to length of allocated
        space being guessed at rather than using the accurate amount held in
        the file control block.
