Commit 45dadad2 authored by Robert Sprowson's avatar Robert Sprowson

Increase upper range of idlen to 21 bits

When 'BigMap' support was added drive sizes were such that (see table and discussion in Doc/BigDisc/BigDiscs) an upper maximum of 19 bits for idlen was appropriate. Now that drives of 2^29 sectors are readily available (the limit of 'BigDisc' support) the idlen limit of 19 has meant the minimum object size has grown too. This change uses the remaining 2 indirect disc address bits to get a factor x4 reduction in minimum object size, at the expense of a 4x larger map.

Defns.s: Parameterise idlen for big and small maps. Small's limit remains 15, big's limit raised from 19 to 21.
Identify.s: When mounting, use the parameterised idlen upper limits to decide whether it's a valid disc or not.
FileCore32.s: Adjust the BIC masks to knock out the extra 2 bits when forming the hash of the object id. Fix long standing bug updating the wrong entry in the hash table (due to LSL #2 giving 5x the entry index, rather than 3x).
FileCore15.s: Take care not to shift b20 of idlen into C as a side effect of a flags changing opcode. An audit of FileCore showed this to be the only site where the subsequent condition code(s) depended on C.
Tools/basic/DispMap: Updated to support BigMaps at all, previously it only worked with NewMap discs.

Tested with an assortment of drives with FSBash for 300k cycles of scrambling for idlen = 17, 19, 20 & 21.

Version 3.75. Tagged as 'FileCore-3_75'
parent bfa71eec
No preview for this file type
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "3.74"
Module_Version SETA 374
Module_MajorVersion SETS "3.75"
Module_Version SETA 375
Module_MinorVersion SETS ""
Module_Date SETS "16 Jun 2017"
Module_ApplicationDate SETS "16-Jun-17"
Module_Date SETS "06 Jul 2017"
Module_ApplicationDate SETS "06-Jul-17"
Module_ComponentName SETS "FileCore"
Module_ComponentPath SETS "castle/RiscOS/Sources/FileSys/FileCore"
Module_FullVersion SETS "3.74"
Module_HelpVersion SETS "3.74 (16 Jun 2017)"
Module_FullVersion SETS "3.75"
Module_HelpVersion SETS "3.75 (06 Jul 2017)"
END
/* (3.74)
/* (3.75)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 3.74
#define Module_MajorVersion_CMHG 3.75
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 16 Jun 2017
#define Module_Date_CMHG 06 Jul 2017
#define Module_MajorVersion "3.74"
#define Module_Version 374
#define Module_MajorVersion "3.75"
#define Module_Version 375
#define Module_MinorVersion ""
#define Module_Date "16 Jun 2017"
#define Module_Date "06 Jul 2017"
#define Module_ApplicationDate "16-Jun-17"
#define Module_ApplicationDate "06-Jul-17"
#define Module_ComponentName "FileCore"
#define Module_ComponentPath "castle/RiscOS/Sources/FileSys/FileCore"
#define Module_FullVersion "3.74"
#define Module_HelpVersion "3.74 (16 Jun 2017)"
#define Module_LibraryVersionInfo "3:74"
#define Module_FullVersion "3.75"
#define Module_HelpVersion "3.75 (06 Jul 2017)"
#define Module_LibraryVersionInfo "3:75"
......@@ -182,7 +182,12 @@ DrvsFsMap aw 4 ;ptr to free space maps
]
BadFs bit 31 ;set if corrupt on disc
EmptyFs bit 30 ;set if FS map buffer empty for old maps
FsMapMaxSize * 4*1024*1024
FsMapMaxObjects * 1:SHL:MaxIdLenBigMap
FsMapMinObjBits * MaxIdLenBigMap+1
FsMapZoneSpareBits * 64*8192 ; a lavish ZoneSpare and NZones value
; only relevant in the maximal map case
FsMapMaxBits * (FsMapMinObjBits * FsMapMaxObjects) + FsMapZoneSpareBits
FsMapMaxSize * FsMapMaxBits:SHR:3
[ DynamicMaps
MemErrorFs bit 29 ;set if failed to load FSmap due to errors with dynamic areas
NewHiFsBits * BadFs :OR: EmptyFs
......@@ -259,6 +264,8 @@ Check1 # 1 ;checksum on sector 1
; New map
MaxFreeLinkBits * 15 ; Though 'BigMaps' extend this limit
MaxIdLenSmlMap * 15
MaxIdLenBigMap * 21
ZoneDiscRecSz * 60 ;reserve additional bytes
Zone0Bits * ZoneDiscRecSz*8
......
......@@ -433,6 +433,7 @@ GenIndDiscOp
DREG r3," disc address is "
Pull "r0"
]
AND r3, r3, #DiscBits ;with IdLen=21 be careful to not set C during TEQ
TEQ lr, r3, LSR #(32-3)
BEQ %FT52
......
......@@ -64,9 +64,9 @@ PostId * 12
PostFrag * 16 ;map offset of start of fragment after gap
GapOff * 20 ;map offset of start of gap
JoinNext * 24
GapEntrySz * 28
GapEntrySz * 28
GapFrags # MaxGaps*GapEntrySz
;entry of 7 words for each gap, used to choose which fragment to move with
;entry of 8 words for each gap, used to choose which fragment to move with
;eventual aim of causing two gaps to join
;IF JoinNext<=2 this gap can't be joined to next gap by moving fragments to
;earlier gap since it is either first/last gap or defects separate them
......@@ -184,8 +184,8 @@ CompactZone ROUT
BLS %FT14 ;if defect or out of zone
[ BigMaps
ASSERT IdHashLen=6*K
BIC R0, R5, #&FF000
BIC R0, R0, # &800
BIC R0, R5, #&3F0000
BIC R0, R0, # &F800
ADD R0, R0, R0, LSL #1 ; multiply by three, to address entry in table
ADD R0, R0, #IdHash
LDRB R1, [R0,#0] ; then get first value
......@@ -270,9 +270,9 @@ CompactZone ROUT
[ BigMaps
ASSERT IdHashLen=6*K
BIC R0, R8, #&FF000
BIC R0, R0, #&00800
ADD R0, R0, R0, LSL #2
BIC R0, R8, #&3F0000
BIC R0, R0, #&00F800
ADD R0, R0, R0, LSL #1
ADD R0, R0, #IdHash
LDRB R1, [R0]
LDRB LR, [R0, #1]
......@@ -342,7 +342,7 @@ CompactZone ROUT
LDRB LR, [R5], #1
ORR R3, R3, LR, LSL #16
TSTS R3, R4
|
|
LDR R3, [R5],#4
TSTS R3, R4
]
......@@ -384,11 +384,11 @@ CompactZone ROUT
Stacked1 * 10*4
Push "R1-R5,R7-R9,R11,LR"
[ BigMaps
MOV R3, R3, LSL #(32-19) ;mask to bottom 19 bits
MOV R3, R3, LSR #(32-19)
MOV R3, R3, LSL #(32-MaxIdLenBigMap) ;mask id bits
MOV R3, R3, LSR #(32-MaxIdLenBigMap)
|
MOV R3, R3, LSL #17 ;mask to bottom 15 bits
MOV R3, R3, LSR #17
MOV R3, R3, LSL #(32-MaxIdLenSmlMap) ;mask id bits
MOV R3, R3, LSR #(32-MaxIdLenSmlMap)
]
MOV R7, #GapFrags
26
......@@ -1773,7 +1773,7 @@ DoCompMoves ROUT
]
Pull "R0-R2,R4-R11,PC"
|
| ; Optimised version of DoCompMoves below
; ===========
; DoCompMoves
......@@ -1825,11 +1825,11 @@ DoCompMoves ROUT
LDR R3, [R3,#DiscRecord_Root]
MOV R4, R9
[ BigDisc
; get the zone base address from the first move, and squirrel
; it away. Also place it in a spare register to help with
; generation of offsets.
[ BigDisc
LDR R11,[R4,#MoveDest] ; get a move address
BL MapPtrToZoneBase ; get base address of zone
ADR LR, DoCompZoneBase ;
......
......@@ -730,23 +730,23 @@ SanityCheckEDiscRecord ROUT
BNE %FT85
[ BigMaps
; Check 0 < idlen < 20
; Check idlen <= MaxIdLenBigMap
LDRB r0, [sp, #DiscRecord_IdLen]
CMP r0, #19
CMP r0, #MaxIdLenBigMap
[ DebugL
BLS %FT01
DLINE "Failed on idlen >= 20"
DLINE "Failed on idlen valid for big map"
01
]
|
; Check 0 < idlen < 16
; Check idlen <= MaxIdLenSmlMap
LDRB r0, [sp, #DiscRecord_IdLen]
CMP r0, #15
CMP r0, #MaxIdLenSmlMap
[ DebugL
BLS %FT01
DLINE "Failed on idlen >= 16"
DLINE "Failed on idlen valid for small map"
01
]
......@@ -833,8 +833,8 @@ SanityCheckEDiscRecord ROUT
[ BigMaps
LDRB r1, [sp, #DiscRecord_IdLen]
CMP r1, #15
BHI %FT10
CMP r1, #MaxIdLenSmlMap
BHI %FT10 ; tests for BigMap
LDRB r1, [sp, #DiscRecord_BigDir_DiscVersion]
TEQS r1, #0
......
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