Commit 8f7b5469 authored by Robert Sprowson's avatar Robert Sprowson

Fix for nonsense sector offsets (and abort) with *Map of old map disc

For new map discs NextFs returns the address of the map zone in R10, which was being used to lookup entries in the disc record. However, for old map discs R10 is a multiple-of-3 offset into the free space map. This was aborting on the 2nd call due to an unaligned LDR at line 3205.
Even on platforms that permit unaligned loads the printed results were wrong because the disc address for an old map disc is in bytes but the value printed out was shifted up by Log2SectorSize. A DD floppy disc could have free space fragments starting at 7M - nonsense.
Fixed by checking the DiscFlags and only reading from the map zone/sector shifting for new map.
Tested with an ADFS-L floppy disc.

Version 3.71. Tagged as 'FileCore-3_71'
parent 74902d1e
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "3.70"
Module_Version SETA 370
Module_MajorVersion SETS "3.71"
Module_Version SETA 371
Module_MinorVersion SETS ""
Module_Date SETS "24 Jul 2016"
Module_ApplicationDate SETS "24-Jul-16"
Module_Date SETS "16 Dec 2016"
Module_ApplicationDate SETS "16-Dec-16"
Module_ComponentName SETS "FileCore"
Module_ComponentPath SETS "castle/RiscOS/Sources/FileSys/FileCore"
Module_FullVersion SETS "3.70"
Module_HelpVersion SETS "3.70 (24 Jul 2016)"
Module_FullVersion SETS "3.71"
Module_HelpVersion SETS "3.71 (16 Dec 2016)"
END
/* (3.70)
/* (3.71)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 3.70
#define Module_MajorVersion_CMHG 3.71
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 24 Jul 2016
#define Module_Date_CMHG 16 Dec 2016
#define Module_MajorVersion "3.70"
#define Module_Version 370
#define Module_MajorVersion "3.71"
#define Module_Version 371
#define Module_MinorVersion ""
#define Module_Date "24 Jul 2016"
#define Module_Date "16 Dec 2016"
#define Module_ApplicationDate "24-Jul-16"
#define Module_ApplicationDate "16-Dec-16"
#define Module_ComponentName "FileCore"
#define Module_ComponentPath "castle/RiscOS/Sources/FileSys/FileCore"
#define Module_FullVersion "3.70"
#define Module_HelpVersion "3.70 (24 Jul 2016)"
#define Module_LibraryVersionInfo "3:70"
#define Module_FullVersion "3.71"
#define Module_HelpVersion "3.71 (16 Dec 2016)"
#define Module_LibraryVersionInfo "3:71"
......@@ -3131,7 +3131,7 @@ Map_Code ROUT
; r0 = 0 - not a new filecore disc
; r0 = 1 - big dirs, small map
; r0 = 2 - big map, small dirs, this case is only valid for IdLen=16
; r0 = 3 - bit map, big dirs
; r0 = 3 - big map, big dirs
TEQS r0, #1
baddr r0, MC4, EQ ;( start, length) new map, big directories
BEQ %FT07
......@@ -3199,10 +3199,15 @@ Map_Code ROUT
[ BigDisc ; SBP: Thu 15th December 1994 - walked thru, doesn't seem
; to support >4G discs. Changed to support them.
Push "R1,R2"
LDR R1, [R10, #ZoneHead+DiscRecord_BigMap_DiscSize2] ; discsize2 field
BL DiscAddToRec ;(R3->LR)
LDRB R1, [LR, #DiscFlags]
TSTS R1, #OldMapFlag
BNE %FT18 ; old map, indirect disc addresses are in bytes already
LDR R1, [LR, #DiscRecord_BigMap_DiscSize2]
MOVS R1, R1
LDRB LR, [LR, #DiscRecord_Log2SectorSize]
MOVEQ R0, R0, LSL LR
BEQ %FT18 ; small disc
LDRB LR,[R10,#ZoneHead+DiscRecord_Log2SectorSize] ; sector size
MOV R1, R0,LSL LR
RSB LR, LR, #32
MOVS R0, R0, LSR LR
......@@ -3221,13 +3226,7 @@ Map_Code ROUT
SUBS R0, R0, #1
BNE %BT17
MOV R0, R1
BL PutHex2
B %FT19
; here when small disc
18
LDRB LR,[R10,#ZoneHead+DiscRecord_Log2SectorSize] ; sector size
MOV R0, R0, LSL LR
BL PutHex2
; here when finished address and want to do length
19
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment