Commit 799ee76e authored by Simon Proven's avatar Simon Proven
Browse files

Binary-chop dir scanning fixed. (BigLexEqv fixed so that it doesn't try to...

Binary-chop dir scanning fixed.  (BigLexEqv fixed so that it doesn't try to compare the dir separator '.' in eg "Default.Thing" with another object called "Default+" (was breaking binary chop dir search).

Fixed IdentifyDisc (s.Identify); old behaviour left the RootDir field
invalid (the disc bits were an external drive number, instead of an
internal disc number).  This causes problems if the disc fails to mount
due to, for example, memory problems, as the illegal value never gets
fixed (normally, MountDiscOnDrive would end up correcting the problem).
parent 95f9b5b6
;>Version Version file for FileCore
GBLS version
version SETS "3.08"
version SETS "3.09"
GBLA Version
Version SETA 308
Version SETA 309
GBLS date
date SETS "30 Jan 1998"
date SETS "11 Feb 1998"
GBLL test_version
......
......@@ -433,8 +433,8 @@ ReadBigDirEntries ROUT
30
; end of dir
LDR R8, [sp, #3*4] ; old offset in dir
SUB R5, R9, R8 ; number of names transferred
MOV R9, #-1 ; finished
SUBS R5, R9, R8 ; number of names transferred
MOVEQ R9, #-1 ; finished
B %FT95 ; and exit
40
......@@ -481,8 +481,8 @@ ReadBigDirEntries ROUT
50
; end of dir
LDR R8, [sp, #3*4] ; old offset in dir
SUB R5, R9, R8 ; number of names transferred
MOV R9, #-1 ; finished
SUBS R5, R9, R8 ; number of names transferred
MOVEQ R9, #-1 ; finished
B %FT95 ; and exit
......@@ -563,8 +563,8 @@ ReadBigDirEntries ROUT
70
; end of dir
LDR R8, [sp, #3*4] ; old offset in dir
SUB R5, R9, R8 ; number of names transferred
MOV R9, #-1 ; finished
SUBS R5, R9, R8 ; number of names transferred
MOVEQ R9, #-1 ; finished
B %FT95 ; and exit
......@@ -944,11 +944,17 @@ LookUpBigDir ROUT
BEQ %FT75
; name>wild. range becomes below r8
[ DebugXb
DLINE "name>wild"
]
SUB r8, r8, r9, LSR #1
MOV r9, r9, LSR #1
B %BT05
20
[ DebugXb
DLINE "name<wild"
]
CMPS r9, #1
BEQ %FT70
; name<wild. range becomes above r8
......@@ -969,6 +975,9 @@ LookUpBigDir ROUT
80
; Match, but...
[ DebugXb
DLINE "Match, but..."
]
BL ReadBigDirIntAtts ; read the attributes
;LR=Atts
......
......@@ -95,20 +95,20 @@ $a SETL F
MEND
Debug1 switch F ;communication with parent module
Debug1 switch T ;communication with parent module
Debug2 switch F ;SWI call processing
Debug2D switch F ;DiscOp SWI call processing
Debug3 switch F ;disc accesses
Debug3L switch F ;low level discops into parent
Debug4 switch F ;disc and drive record operations
Debug5 switch F ;old free space map operations
Debug4 switch T ;disc and drive record operations
Debug5 switch T ;old free space map operations
Debug6 switch T ;pathname and directory operations
Debug6f switch F ; FindDiscByName
Debug6f switch T ; FindDiscByName
Debug7 switch T ;OsFile operations
Debug8 switch F ;File Level Disc Ops
Debug9 switch F ;Misc useful routines
DebugA switch F ;OsFun operations
DebugB switch T ;Random access files
DebugA switch T ;OsFun operations
DebugB switch F ;Random access files
DebugBA switch F ;OS_Args specifically
DebugBE switch F ;BPut/BGet entry
DebugBc switch F ;CloseAllByDisc
......@@ -124,16 +124,16 @@ DebugEx switch F ; verbose new free space map
DebugEs switch F ; debugging of SortDir use in NewClaimFree
DebugF switch F ;new free space map auto compact
DebugFx switch F ;new free space map: check for this bug
DebugG switch T ;verbose file cache
DebugGu switch T ;UpdateProcess only
DebugGs switch T ; UpdateProcess scatter list ends only
DebugG switch F ;verbose file cache
DebugGu switch F ;UpdateProcess only
DebugGs switch F ; UpdateProcess scatter list ends only
DebugH switch F ;terse file cache
DebugI switch F ;terse FIQ claim/release
DebugJ switch T ;file cache consistency checks
DebugJ switch F ;file cache consistency checks
DebugK switch F ;setting of Interlocks
DebugL switch F ; Mounting/Identifying/Dismounting/Verifying
DebugLi switch F ; Changes to DiscId information in disc records
DebugLm switch F ; matching disc agianst other records
DebugL switch T ; Mounting/Identifying/Dismounting/Verifying
DebugLi switch T ; Changes to DiscId information in disc records
DebugLm switch T ; matching disc agianst other records
DebugM switch F ; MultiFS extensions
DebugMt switch F ; MultiFS extensions (terse)
DebugN switch F ; Disc insertion / request for insertion thread
......@@ -149,7 +149,7 @@ DebugDL switch F ; check for data lost problems with atapi
DebugX switch F ; debug long filenames
DebugXg switch F ; debug long filenames - growin dirs
DebugXm switch F ; debug long filenames - memory problems
DebugXb switch F ; debug long filenames - binary chop dir search
DebugXb switch T ; debug long filenames - binary chop dir search
DebugCW switch F ; debug write cacheing of dirs
......@@ -192,9 +192,9 @@ $GetAroundBleedingAAsmYetAgain
[ Debug
; Set to true for dubugging through the tube
Host_Debug SETL True
Host_Debug SETL T
Debug_MaybeIRQ SETL True
Debug_MaybeIRQ SETL T
]
GBLS Host_Inclusion
......
......@@ -288,6 +288,7 @@ BadFs bit 31 ;set if corrupt on disc
EmptyFs bit 30 ;set if FS map buffer empty for old maps
FsMapMaxSize * 4*1024*1024
[ DynamicMaps
MemErrorFs bit 29 ;set if failed to load FSmap due to errors with dynamic areas
NewHiFsBits * BadFs :OR: EmptyFs
|
HiFsBits * BadFs :OR: EmptyFs
......
......@@ -127,6 +127,9 @@ WhatDiscCommon
BL SetVOnR0
[ Debug4 :LOR: DebugL
LDR lr, [r5, #RootDir]
DREG lr, "RootDir on Exit WhatDisc is: "
DREG R1, "<WhatDisc(Drv=",cc
DREG R2, ",Dsc=",cc
DREG R3, ",Rec=",cc
......@@ -245,6 +248,10 @@ DetermineDiscType ROUT
STRNE lr, [r5, #DiscSize]
]
[ DebugLm
DLINE "Blanking out disc name"
]
; Blank out the disc name
MOV lr, #0
ASSERT ?DiscName = 10
......@@ -466,6 +473,11 @@ DetermineDiscType ROUT
STRB r2, [r4, #DrvsDisc]
STRB r1, [r5, #DiscsDrv]
[ DebugL
DREG r1, "************************ DiscsDrv set to ",cc
DLINE " in DetermineDiscType *****************************"
]
; Make sure it isn't discarded too soon!
MOV r0, r2
BL UpdatePriority
......@@ -818,6 +830,8 @@ MountDiscOnDrive ROUT
STRB r0, [r5, #DiscUsage]
STRB r1, [r5, #DiscsDrv]
[ DebugL
DREG r1, "************************* DiscsDrv set to",cc
DLINE " in MountDiscOnDrive *************************"
DREG r2, "DrvsDisc set to "
]
STRB r2, [r4, #DrvsDisc]
......@@ -1145,6 +1159,10 @@ AdjustFsSpace ROUT
Pull "R1, R3-R8"
LDRVS lr, [r4, #DrvsFsMapFlags] ; set the 'map memory error' bit
ORRVS lr, lr, #MemErrorFs ;
STRVSB lr, [r4, #DrvsFsMapFlags]
BVS %FT90
; work out the size the area must grow or shrink by
......@@ -1153,9 +1171,23 @@ AdjustFsSpace ROUT
Push "R1"
SUB R1, R3, R2 ; amount to change size by
[ DebugL
DREG R1, "Area size to change by: "
]
LDR R0, [R4, #DrvsFsMapArea] ; area number
BL OnlyXOS_ChangeDynamicArea
[ DebugL
BVC %FT01
DebugError "AdjustFsSpace - OS_ChangeDynamicarea error "
01
]
LDR lr, [r4, #DrvsFsMapFlags] ; set/clear the 'map memory error' bit
ORRVS lr, lr, #MemErrorFs ;
BICVC lr, lr, #MemErrorFs ;
STR lr, [r4, #DrvsFsMapFlags] ;
Pull "R1"
BVS %FT90 ; error!
......@@ -1342,7 +1374,7 @@ FileType_FileCoreFloppyDiscStore
MOVNE r0, #D_Root
ORR r0, r0, r2, ASL #32-3
[ DebugL
DREG r0, "Setting RootDir to "
DREG r0, "Setting RootDir to (FileCore20, 1394) "
]
STR r0, [r5, #RootDir]
......@@ -1457,7 +1489,7 @@ FileType_FileCoreFloppyDiscStore
BIC r0, r0, #DiscBits
ORR r0, r0, r2, ASL #32-3
[ DebugL
DREG r0, "Setting RootDir to "
DREG r0, "Setting RootDir to (FileCore20, 1509) "
]
STR r0, [r5, #RootDir]
......@@ -1601,7 +1633,7 @@ StartupNonFileCoreDisc ROUT
[ DebugL
Push "r5"
MOV r5, lr
DREG r5, "Setting RootDir to "
DREG r5, "Setting RootDir to (FileCore20, 1653) "
Pull "r5"
]
STR lr, [r5, #RootDir]
......@@ -2321,6 +2353,10 @@ UnlinkCommon
MOV R2, #8
STRB R2, [LR, #DiscsDrv] ;disc in unknown drive
[ DebugL
DLINE "************** Setting DiscsDrv to 8 in UnlinkCommon *************"
]
; If unlinked a Data disc, then dismount it (and ignore any error back)
LDR R2, [LR, #DiscType]
LDR LR, =FileType_Data
......
......@@ -806,6 +806,10 @@ FindDiscByName
03
; It's a drive number and may be any drive (MustBeRefDisc is clear)
[ Debug6f
DLINE "It's a drive number, going to WhatDisc the drive"
]
; WhatDisc the specified drive
Push "R1"
MOV R1, R0
......@@ -1282,6 +1286,8 @@ BigLexEqv
10
BL NextChar
MOVCS R0, #0 ;replace terminators by 0, for name<wild check
TEQS R0, #DelimChar
MOVEQ R0, #0 ; delimiters must be replaced by 0 too
CMPS R0, #MultiWildChar
BEQ %FT30
BL %FT50 ;R9=next name char
......@@ -1316,6 +1322,8 @@ BigLexEqv
MOV R7, R1 ;Wild backtrack ptr -> wild card
BL NextChar ;Next wild
MOVCS R0, #0 ;replace terminators by 0, for wild<name check
TEQS R0, #DelimChar
MOVEQ R0, #0 ;delimiters must be replaced by 0 too
CMPS R0, #MultiWildChar
BEQ %BT30 ;deal with **
Internat_CaseConvertLoad LR,Upper
......@@ -1335,6 +1343,8 @@ BigLexEqv
AND R9, R9, R5 ;maybe mask out bit 7
Internat_CaseConvertLoad R11,Upper
Internat_UpperCase R9,R11
TEQS R9, #DelimChar
MOVEQ R9, #0
CMPS R9, #" "+1 ;name terminated by control code ?
MOVLO R9, #0 ;replace terminators by 0, for wild<name check
CMPHS R6, R4 ;name terminated by length ?
......@@ -1343,6 +1353,7 @@ BigLexEqv
;name terminated, has wildcard ?
CMPS R0, #DelimChar
CMPNE R0, #0
BLNE ThisChar
BCS %FT60 ;match
......
......@@ -170,6 +170,9 @@ DoSwiDiscOp ROUT
]
STRB r1, [sp, #ZoneSpare]
STRB r1, [sp, #ZoneSpare+1]
[ DebugL :LOR: Debug2D
DREG r1, "Setting RootDir to (GenSWIs, 160) "
]
STR r1, [sp, #RootDir]
LDR r1, [r4, #DoFormatCylindersPerDrive]
......@@ -386,6 +389,9 @@ DoSwiSectorDiscOp ROUT
]
STRB r1, [sp, #ZoneSpare]
STRB r1, [sp, #ZoneSpare+1]
[ DebugL :LOR: Debug2D
DREG r1, "Setting RootDir to: (GenSWIs, 379) "
]
STR r1, [sp, #RootDir]
LDR r1, [r4, #DoFormatCylindersPerDrive]
[ BigDisc
......
......@@ -37,7 +37,7 @@
; V not possible
;
IdentifyDisc ROUT
Push "r1,r2,r3,r8,lr"
Push "r1,r2,r3,r8,r9,lr"
[ DebugL
DREG R0, "Identifying drive ",cc
......@@ -54,9 +54,15 @@ IdentifyDisc ROUT
MOVNE r1, #Service_IdentifyDisc
BNE %FT50
LDR r9, [r5, #RootDir]
AND r9, r9, #DiscBits
; Generate an initial root dir address
MOV r1, r0, ASL #(32-3)
EOR r1, r1, #bit31 ; Convert to external numbering
[ DebugL
DREG r1, "Setting initial root dir address to: "
]
STR r1, [r5, #RootDir]
MOV r1, #Service_IdentifyDisc
......@@ -70,6 +76,15 @@ IdentifyDisc ROUT
MOVVS r1, #Service_IdentifyDisc
CLRV
LDR lr, [r5, #RootDir]
BIC lr, lr, #DiscBits
ORR lr, lr, r9
STR lr, [r5, #RootDir]
[ DebugL
DLINE "Restoring internal disc numbering of RootDir: "
]
50
; If not serviced then disc is just so much random data!
TEQ r1, #Service_Serviced
......@@ -86,7 +101,7 @@ IdentifyDisc ROUT
]
95
Pull "r1,r2,r3,r8,pc"
Pull "r1,r2,r3,r8,r9,pc"
LTORG
......@@ -975,6 +990,10 @@ SanityCheckEDiscRecord ROUT
LDR r1, [r5, #RootDir]
AND r1, r1, #DiscBits
ORR r0, r0, r1
[ DebugL
DREG r1, "DiscBits from disc record are: "
DREG r0, "Setting RootDir to: (Identify, 968) "
]
STR r0, [r5, #RootDir]
LDR r0, [sp, #DiscSize]
STR r0, [r5, #DiscSize]
......
......@@ -588,6 +588,9 @@ DieEntry
TEQS SB, #0
MOVEQS PC, LR ;if base incarnation
Push "R7-R11,LR"
[ Debug1
DLINE "FileCore DieEntry"
]
MOV LR, #1
STRB LR, ReEntrance
MOV R10,#0
......@@ -608,6 +611,10 @@ DieEntry
; Reentry point from init routine above on failure to register FS with FileSwitch
MOVVS R9, R0
[ Debug1
DLINE "FileCore killing parent"
]
; Delete the parent of this incarnation (eg ADFS)
LDR R1, ParentBase
LDR R0, [R1,#Module_Title]
......@@ -615,12 +622,29 @@ DieEntry
MOV R0, #ModHandReason_Delete
SWI XOS_Module
[ Debug
DebugError "killing (filecore's) parent error: "
]
[ BigDir
; free the dynamic area for the dir buffer
MOV R0, #1
LDR R1, DirBufferArea
TEQS R1, #0
BLNE OnlyXOS_DynamicArea
[ Debug1
BEQ %FT01
DREG R1, "Removing DirBufferArea: "
01
]
SWI XOS_DynamicArea
[ Debug1
DLINE "Removed DirBufferArea"
]
[ Debug
DebugError "Error from removing dir buffer area: "
]
]
[ NewFs
......@@ -636,7 +660,15 @@ DieEntry
MOV R0, #1
LDR R1, [R2, #DrvsFsMapArea]
TEQS R1, #0
[ Debug1
BEQ %FT01
DREG R1, "removing dynamic map: "
01
]
BLNE OnlyXOS_DynamicArea ; ditch the dynamic area
[ Debug
DebugError "Error from removing disc map area: "
]
|
LDR R2, [R2,#DrvsFsMap]
BICS R2, R2, #HiFsBits
......@@ -679,6 +711,9 @@ DieEntry
99
[ Debug
DebugError "FileCore init error:"
]
[ Debug1
DLINE "Exit from Filecore DieEntry"
]
Pull "R7-R11,PC"
......
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