1. 15 Aug, 2020 1 commit
    • Timothy E Baldwin's avatar
      Fix cleaning · 774c67f3
      Timothy E Baldwin authored
      Move .gitignore file to root and populate with all temporary paths.
      This fixes .gitignore files being deleted during a ROM build.
      Version 1.14. Not tagged
  2. 24 Jul, 2018 1 commit
    • Robert Sprowson's avatar
      Fix pointer compare confusion · f14730d1
      Robert Sprowson authored
      OpsFunc.c: don't compare fname with a null string, when a NULL pointer was intended
      Found by cppcheck static analysis.
      Version 1.14. Tagged as 'DOSFS-1_14'
  3. 19 Feb, 2018 2 commits
    • Jeffrey Lee's avatar
      Remove redundant NULL pointer check · 9f6e8ade
      Jeffrey Lee authored
        c/DOSdirs - Now that nbuff is an array held on the stack, there's no need for findSUBDIR to check whether it's a null pointer
        Builds, untested
        Issue spotted by Dominic Plunkett
      Version 1.13. Tagged as 'DOSFS-1_13'
    • Jeffrey Lee's avatar
      Reject overly-large discs, and other invalid things · eb3e3485
      Jeffrey Lee authored
        c/Accessors, h/Accessors, Makefile - Added some simple 'image accessor' routines to abstract over accessing the underlying disc/image file. These accept 64bit disc addresses and will check to make sure any size limits imposed by the lower-level API are adhered to (512MB limit for FileCore_DiscOp, or extent of image file for OS_GBPB)
        h/MsgTrans, Resources/Germany/Messages, Resources/UK/Messages - Add a couple of new error messages
        h/Helpers - Add a couple of macros to simplify reading 16/32bit values that are split into multiple bytes in struct definitions. Change writeWORD & loadWORD to accept void* instead of char* so they can be used with other types like 'byte'
        h/DOSshape - Add '0' suffix to some struct members so they can be used with new READ_0123 macro
        h/ADFSshape - Make sure put_doublestep is safe to use with bools
        c/DOSdirs - Remove pointless malloc of small temporary array
        c/DOSclusters - Use new READ_ macros in max_sector()
        c/DOSFS - Use new READ_ macros so code is less painful to read. Use new image accessor system to get rid of some boilerplate for reading from the disc (+ extra error checks). Change 32bit values to 64bit where it looks like it's necessary, and use bools in place of a couple of 0/1 ints. Reject any discs which are too big for the 32bit fields in the ADFS disc record.
        c/OpsFunc - Update DOSFS_image_open in ways similar to the code in c/DOSFS, making use of READ_, image accessor, 64bit values, and adding extra error checks.
        Tested with assorted large & small image files & SD cards on a BB-xM, and some DOS/Atari floppy discs on a RiscPC
        FAT partitions larger than 4GB (or which extend past the 4GB FileSwitch limit) are now rejected, as are image files which have been truncated
        A future improvement could be to lift the disc/partition identification code out of c/DOSFS and c/OpsFunc and unify it, since both files contain fairly similar code
        German messages are in need of translation
      Version 1.12. Tagged as 'DOSFS-1_12'
  4. 17 Dec, 2017 1 commit
    • Robert Sprowson's avatar
      No longer offer PCMCIA SRAM card as a format option · c030e516
      Robert Sprowson authored
      Untangle the PCMCIATRUE misnomer - what it really meant was "offer PCMCIA card as an option for *Format AND allow non floppy geometries".
      Nothing has shipped with PCCardFS since October 1994, so stop offering it as a possible *Format.
      However, we do rely on the non floppy geometries for things like SD cards and USB sticks, so retain that with a new switch (permanently enabled) called NONFLOPPIES.
      Tested with a Pi SD card and a 4GB USB stick.
      Version 1.11. Tagged as 'DOSFS-1_11'
  5. 21 Nov, 2017 1 commit
    • Robert Sprowson's avatar
      Allow mounting discs with 1 letter names, and 2x buffer overrun fixes · 8e566c40
      Robert Sprowson authored
      DOSFS would prefer to use the disc title from the volume name entry in the root directory, even if this reduced to 1 letter, which would then lead to "Disc drive not known" errors. Since the disc couldn't be mounted it couldn't be renamed either, requiring a trip to a PC to do so.
      Now, if the cleaned up name is < 2 characters long, ignore it and use the one based on the volumeid, and if that doesn't exist, use the default one ("Untitled") from the Messages file.
      In OpsFunc.c used memset() in place of a byte set loop.
      Ref https://www.riscosopen.org/forum/forums/4/topics/9503
      DOSFS.c, line 621: remove the excess NULL so the sprintf fits into the 10 byte buffer, not 11.
      DOSFS.c, line 1556: restore the original intent for *CopyBoot in light of the structure/union reorg DOSshape.h revision 4.7 in DOSFS-0_79. Previously the boot code was copied in its entirity as an opaque blob, but the loop was left unchanged, overrunning the sector buffer.
      A useful example of the extent of the boot code is given in
      which shows the code uses up every last byte of the sector.
      Tested with a disc called "R", which can now be mounted. A floppy with no name and no volume id, and one with no name and a volume id.
      Version 1.10. Tagged as 'DOSFS-1_10'
  6. 18 Mar, 2016 1 commit
  7. 02 Nov, 2014 2 commits
    • Robert Sprowson's avatar
      Fixes to stop DOSFS erroneously claiming partitions that aren't valid · dac80f3c
      Robert Sprowson authored
      In particular with ADFS, attempting to format an ATA drive purchased from a PC box shifter would often lead to the machine hanging on startup meaning you can't get as far as running !HForm. Further analysis showed that the problem was caused by DOSFS latching onto the PC partition table and attempting to claim the Service_IdentifyDisc. This would then be followed by trying to load the FAT via FileCore in situations where the FAT to load were bigger than the disc size represented by the disc record FileCore has attached to the disc.
      This primarily concerns things with partition tables (like a fixed disc).
      Things got off to a bad start, some inaccurate keyboard mashing meant the definition for DOS_bootsector added up to 520 bytes, and this was loaded into a malloc'd 512 byte buffer.
      The representation of the disc size (bbsize) was being kept in a signed integer, so the single (rather weak) test of checking the boot block declared size (bbsize) being greater than the partition declared size (winisize) would always be accepted for partitions > 2GB.
      Additionally, the bbsize was multiplied by DOSsecsize and performed as a byte compare rather than a sector compare, leading to overflow.
      Invariably this check would pass (either due to the sign bit being set, or overflow) and DOSFS would claim the service and go ahead and try to read in an unfeasibly large FAT.
      DOSFS is now much more strict about checking
      * be sure bbsize can fit in the partition by comparing as unsigned number of sectors, convert to bytes later
      * be sure bbsize is non zero
      * be sure the FAT isn't bigger than bbsize
      * be sure the root directory isn't bigger than bbsize
      only then claim the service.
      Correct the size of the DOS_bootsector back to 512 bytes.
      Remove unused grubby FileCore constants, especially as we're not likely to encounter any 256B/sector drives!
      Add the extra disc record fields to get us up to 'BigDisc' in FileCore parlance.
      If the rootsize is zero, have a go at using the FAT32 ones instead. Previously this logic only triggered if the FAT32 extended signature was present, but that signature is for the fields that follow it - the FAT size preceeds.
      Only update the return variables if we're confident we're going to claim the service.
      Remove dead variable 'notracks'.
      Tested on a sample of 4 ATA drives > 10GB from different vendors previously used in PCs. All 4 used to hang when installed, now they do not.
      Version 1.08. Tagged as 'DOSFS-1_08'
    • Robert Sprowson's avatar
  8. 25 Jun, 2014 2 commits
    • Robert Sprowson's avatar
      Change last couple of uses of trace macros to use DebugLib · e06e5d22
      Robert Sprowson authored
      This town ain't big enough for the two of us.
      Version 1.07. Tagged as 'DOSFS-1_07'
    • Robert Sprowson's avatar
      Revise filename shortening rules · fde44225
      Robert Sprowson authored
      The rules DOSFS used to create the short name version of a long filename were quite wide of the recommendations from Microsoft. This causes problems in particular with bootloaders that are a little more simplistic and use the short name form, only to find "BOOTCODE.BIN" has been replaced by "BOOTCO~1.BIN" by DOSFS.
      Also, the long filename entried created for new long filenames left the reserved fields unset. Some of these seem to have special meanings to Windows which faults them ("extended attribute handle invalid") when running chkdsk.
      DOSnaming.c: replaced the shorten_lfn function, sprinkled in a few token consts, set the reserved fields in long file names to 0
      DOSclusters.c/OpsFunc.c/OpsFile.c: remove shorttemp[14] no longer needed, simplify sprintf/memcpy/memcpy into a single sprintf
      DOSFS.h: familiar MIN/MAX maxros added
      Tested in isolation in harness "test/shorten" and comparing floppy discs generated with "test/shortgen" from Windows and DOSFS.
      Fixes ticket #313.
      Version 1.06. Tagged as 'DOSFS-1_06'
  9. 24 Jun, 2014 2 commits
    • Robert Sprowson's avatar
      Hypothetical C syntax swapped for reality · 05e22692
      Robert Sprowson authored
      Nice though it would be to be able to use logical or to test multiple characters at once, that expression simply evaluates to "TRUE" in the real world, so the substitution for underscore never worked when shortening filenames.
      The function still doesn't follow Microsoft's rules (see ticket #313) yet.
    • Robert Sprowson's avatar
      Added some doxygen comments · f7bb3d25
      Robert Sprowson authored
      Also corrected various confusions about NULL (a pointer) and the ASCII character 0.
      Reindented consistently.
      Version 1.05. Tagged as 'DOSFS-1_05'
  10. 31 May, 2014 2 commits
  11. 22 May, 2014 1 commit
  12. 15 Oct, 2013 1 commit
    • Ben Avison's avatar
      Fix divide-by-zero bug · 82a0cd80
      Ben Avison authored
        Somewhere in the process of adding FAT16/FAT32 support, a bug was
        was introduced where an attempt was made to calculate the number of
        sectors in a cluster before the cluster size (in bytes) had been
        determined. This affected invalid (e.g. blank) image files, as well as
        old 160K/320K DOS floppies that aren't supposed to contain a valid boot
        Issue raised by the Raspberry Pi NOOBS team when they failed to set up
        the DOS partition where FileCore was expecting it to be.
      Version 1.02. Tagged as 'DOSFS-1_02'
  13. 13 Jan, 2013 4 commits
    • Robert Sprowson's avatar
      Add missing message, use central allocations for DOSFS' FS number · 6d572cd3
      Robert Sprowson authored
      Missing 'Stack full' error message added (German translation needed).
      Use DOSFS FS number from headers.
      Tested with floppy disc (FAT12), 1GB image file (FAT16) and 4GB image file (FAT32) with no issues seen.
      Version 1.01. Tagged as 'DOSFS-1_01'
    • Robert Sprowson's avatar
      Allow RAM builds with messages in, fix for saving to images > 2G · 631ad37c
      Robert Sprowson authored
      RAM build include messages.
      Removed atexit() handler, in favour of finalisation-code option in CMHG file.
      Changed cluster rounding in saveFILE() to deal with extents > 2G.
      Version 1.00. Tagged as 'DOSFS-1_00'
    • Robert Sprowson's avatar
      Add some comments (!) and reindent FileSwitch interface · 6f9ea986
      Robert Sprowson authored
        DOSFS_put_bytes no longer passes an unnecessary dummy argument.
        Doxygen comments added to FileSwitch layer.
        Suggested buffer to FileSwitch is now 1x512 sector (rather than 256).
        Note - nothing seems to use the cluster buffering code in DOSFS,
      indeed nothing ever malloc()s a buffer.
        Check at line 237 of OpFind would never be true since FILE_subdir is
      not 1, fixed.
        Return an error if the handle to close is invalid.
        Doxygen comments added to FileSwitch layer.
        Doxygen comments added to FileSwitch layer.
        A failure to find a slot to set the disc title now reports "Dir full"
      not "Disc full"
        Doxygen comments added to FileSwitch layer.
      Version 0.99. Tagged as 'DOSFS-0_99'
    • Robert Sprowson's avatar
      Rationalise some defines · 41c45883
      Robert Sprowson authored
      Many magic numbers changed to exported defines.
      Eliminated unused "BOOTblock.h" (was just nesting 1 include file).
      Moved non ASCII definitions out of "ASCII.h" then found the remainder weren't used => eliminated.
      Version 0.98. Tagged as 'DOSFS-0_98'
  14. 07 Dec, 2012 2 commits
    • Robert Sprowson's avatar
      Makefile recreated from fragments · 82f8405a
      Robert Sprowson authored
      Replaced 'lk' register name with 'lr', now APCS is not set to -none.
      Inverted the sense of the conditional in CMHG file, following the more common ROM predefine use (eg. the Toolbox).
      Removed obsolete NoFAT32 obey files - the switch remains but there's little point omitting that now (since the switch actually leaves most of the code in anyway).
      Tested in IOMD ROM build (export, resources, ROM phases) mounting a DOS floppy and 1GB image file.
      Version 0.97. Tagged as 'DOSFS-0_97'
    • Robert Sprowson's avatar
      Source file subdivision · eea0d135
      Robert Sprowson authored
      The sources to DOSFS had become rather jumbled and monolithic
      * Split FileSwitch interface out into seperate ops source files.
      * Combined international error lookup with MsgTrans code.
      * Split utility functions into 'Helpers.c' along with wildcard matching functions.
      * Moved DOS naming functions into, erm, 'DOSnaming.c'.
      * Makefile tweaked to remove 'symbols' on clean.
      * Obsolete 'Help' and 'Syntax' placed in attic.
      RAM, debug, and ROM targets built. RAM target tested with a DOS floppy disc.
      Version 0.96. Tagged as 'DOSFS-0_96'
  15. 02 Sep, 2012 1 commit
    • Ben Avison's avatar
      Fixed support for certain sized DOS discs · 96a65e55
      Ben Avison authored
        In the code which determined the bitmask to apply to cluster numbers, the
        calculation of the number of clusters in the data area (which is the
        deciding factor between FAT12, FAT16 and FAT32) contained an operator
        precedence error in the calculation of the root directory size. The result
        was that if the disc size was within approx 8 MB of the FAT type threshold
        then the wrong mask was selected. (For clusters of 4*512 bytes, the FAT12/16
        threshold is about 8 MB, so discs between 8 and 16 MB would fail.)
        * Fixed the module base address and offsets registered with FileSwitch -
          previously the static data relocation offset was incorrectly applied.
          FileSwitch didn't actually care as long as they added up to the right
          address, but it was still wrong.
        * 32-bitting was incorrectly done using the No26bitCode switch rather than
          the No32bitCode switch, meaning that softloadable builds of this module
          were not 32-bit compatible. Softloadable builds now work on anything from
          RISC OS 3.5 onwards.
        Tested on Raspberry Pi and Iyonix.
      Version 0.95. Tagged as 'DOSFS-0_95'
  16. 06 Aug, 2012 1 commit
  17. 23 Jul, 2012 1 commit
  18. 21 Jul, 2012 1 commit
    • Jeffrey Lee's avatar
      Fix null pointer dereference in findSUBDIR · bd9673f5
      Jeffrey Lee authored
        c/DOSFSops - The while() loop in findSUBDIR now bails immediately if getnextDIRentry() returns NULL. Avoids null pointer dereference when calling buildFILEname().
        Tested on Raspberry Pi with high processor vectors
      Version 0.92. Tagged as 'DOSFS-0_92'
  19. 14 Jul, 2012 1 commit
    • Jeffrey Lee's avatar
      Fix packdir peeking and potentially poking the reset vector · 136bde25
      Jeffrey Lee authored
        c/DOSFSops - packdir() was treating its optional 'preserve' parameter as mandatory, leading to peeking (and potentially poking) of null pointers
        Tested on Raspberry Pi with high processor vectors
      Version 0.91. Tagged as 'DOSFS-0_91'
  20. 10 Jun, 2012 1 commit
    • Ben Avison's avatar
      Fixed timestamping · 0dbabf61
      Ben Avison authored
        Renamed function "localTIME" to "get_RISCOS_TIME" since it has nothing to do
        with local time. This function used to call the C library function
        localtime(), but until recently the C library was non-conformant to the
        C standard, and simply produced a year/month/day/hour/minute/second breakdown
        as UTC. When this was fixed (RISC_OSLib 5.68) it changed DOSFS's behaviour;
        it was first detected because the reverse operation is implemented locally
        within DOSFS, so a read-modify-write of file attributes leads to the
        modification time being skewed by an amount equal to the difference between
        UTC and local time. Arguments can be made either to treat the on-disc time as
        local time (for compatibility with Windows and Mac OS) or as UTC (for
        compatibility with Linux or older RISC OS systems); I have opted to return
        behaviour to UTC. Also placed a lower limit on dates of the earliest date
        supported by FAT (1980), so for example if your system clock is set to 1970,
        as it will be if there is no RTC and NetTime is not operational, then you
        don't end up creating dates in the far future due to underflow.
        Tested on a beagleboard
      Version 0.90. Tagged as 'DOSFS-0_90'
  21. 14 Apr, 2012 1 commit
  22. 13 Apr, 2012 1 commit
    • Ben Avison's avatar
      Changed *OPT 4 setting · 0a026da4
      Ben Avison authored
        DOS-formatted discs don't have a FileCore boot block, so there's nowhere
        to store the *OPT 4 setting. Up till now, it's been hard-coded to 0; this
        commit changes it to a hard-coded 2, which means that (at least in theory)
        it is now possible to construct a bootable DOS-formatted medium - like, say,
        the same SD card that contains a beagleboard ROM image.
        Verified the reported boot option using *Cat.
      Version 0.88. Tagged as 'DOSFS-0_88'
  23. 19 Jan, 2010 1 commit
    • ROOL's avatar
      Incremented version number, no other change. · ad1c94cc
      ROOL authored
      Previous changes were untagged, but incrementing the version number gives
      us a tag we can associate with the official RISC OS 5.16 release.
      Version 0.87. Tagged as 'DOSFS-0_87'
  24. 11 Jun, 2009 1 commit
    • Ben Avison's avatar
      #include file pathnames changed · 72e15bd2
      Ben Avison authored
        Uses suffixed file extensions for compatiblity with both Norcroft and GCC.
        Supplied by Peter Naulls, tested at ROOL
      Version 0.86. Not tagged
  25. 17 May, 2009 1 commit
    • Ben Avison's avatar
      Architecture-based optimisation · bc6d110a
      Ben Avison authored
        Unaligned word loads and stores have been optimised if only pre-ARMv6 or
        if only ARM6+ arachitectures need be supported.
        Builds but untested
      Version 0.86. Tagged as 'DOSFS-0_86'
  26. 19 Oct, 2007 2 commits
  27. 09 Nov, 2004 1 commit
  28. 04 Nov, 2004 1 commit
    • John Ballance's avatar
      now ensures that any long name that doesn't match the linked shortname is... · ba439592
      John Ballance authored
      now ensures that any long name that doesn't match the linked shortname is markee erased. This then copes with images where a longnamed file is deleted on shortname filing system, thus leaving several longname name entries 'hanging around'
               tested at castle.. castle added IP
      Version 0.84. Tagged as 'DOSFS-0_84'
  29. 29 Oct, 2004 1 commit
    • John Ballance's avatar
      repair DOSMap display/output prior to rom inclusion · cde23f48
      John Ballance authored
             the DOSMap command had a couple of *8 multipliers which
             thus wrongly indexed dos extent info in printout.
             long file name dosfs beta tested in the field .. appears fit
             for purpose.. Also tested at castle
             castle added IP
      Version 0.83. Tagged as 'DOSFS-0_83'
  30. 25 Oct, 2004 1 commit