Commit e952c055 authored by Jeffrey Lee's avatar Jeffrey Lee
Browse files

Make 'Hide' file feature more useful when SCSIFS in ROM

Detail:
  s/ScsiFs05, s/ScsiFs50 - Listen out for Service_BootChoicesVarsSet and use it as a trigger to check for any devices which should be hidden by the Hide file. This ensures that devices which are detected prior to the boot sequence starting will get Hide-processed
Admin:
  Tested on Raspberry Pi
  Partially resolves ticket #309 (there's still the problem that a multi-card reader could use up all available drive numbers during ROM init, preventing the boot drive from mounting)


Version 1.32. Tagged as 'SCSIFS-1_32'
parent 3a1ef8f7
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "1.31"
Module_Version SETA 131
Module_MajorVersion SETS "1.32"
Module_Version SETA 132
Module_MinorVersion SETS ""
Module_Date SETS "09 Sep 2017"
Module_ApplicationDate SETS "09-Sep-17"
Module_ComponentName SETS "SCSIFS"
Module_ComponentPath SETS "castle/RiscOS/Sources/FileSys/SCSIFS/SCSIFS"
Module_FullVersion SETS "1.31"
Module_HelpVersion SETS "1.31 (09 Sep 2017)"
Module_FullVersion SETS "1.32"
Module_HelpVersion SETS "1.32 (09 Sep 2017)"
END
/* (1.31)
/* (1.32)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 1.31
#define Module_MajorVersion_CMHG 1.32
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 09 Sep 2017
#define Module_MajorVersion "1.31"
#define Module_Version 131
#define Module_MajorVersion "1.32"
#define Module_Version 132
#define Module_MinorVersion ""
#define Module_Date "09 Sep 2017"
......@@ -18,6 +18,6 @@
#define Module_ComponentName "SCSIFS"
#define Module_ComponentPath "castle/RiscOS/Sources/FileSys/SCSIFS/SCSIFS"
#define Module_FullVersion "1.31"
#define Module_HelpVersion "1.31 (09 Sep 2017)"
#define Module_LibraryVersionInfo "1:31"
#define Module_FullVersion "1.32"
#define Module_HelpVersion "1.32 (09 Sep 2017)"
#define Module_LibraryVersionInfo "1:32"
......@@ -764,6 +764,28 @@ DoDetachedCallback
TEQ LR,R1 ; if this drive maps to the device
BNE %FT70 ; unmap it
BL DetachDevice
70 SUBS R3,R3,#1
BPL %BT20
80 SUBS R1,R1,#1
BPL %BT10
90
LDRB R0, DetCBCount
SUBS R0,R0,#1
STRGEB R0, DetCBCount
MOV R0,#ModHandReason_Free
Pull "R2"
SWI XOS_Module
Pull "R0-R5,PC"
; In:
; R1 = SCSI device ID
; R3 = FileCore drive number
; R5 -> drive record
DetachDevice
Entry "R0,R1,R4,R5,R8"
MOV LR,#-1 ; clear the device field
STDevNo LR,R5, R4
LDRB LR, [R5,#DrvFlags]
......@@ -772,28 +794,14 @@ DoDetachedCallback
sbaddr R5, BlockSizes
MOV LR, #0 ; blank the block size
STRB LR, [R5, R3]
Push "R0,R1,R8"
MOV R0, #2 ; release it (just in case)
MOV R8, R12
SWI XSCSI_Reserve
MOV R0, #UpCall_DriveRemoved
MOV R1, R3
BL UpcallDrive ; issue an upcall
Pull "R0,R1,R8"
70 SUBS R3,R3,#1
BPL %BT20
EXIT
80 SUBS R1,R1,#1
BPL %BT10
90
LDRB R0, DetCBCount
SUBS R0,R0,#1
STRGEB R0, DetCBCount
MOV R0,#ModHandReason_Free
Pull "R2"
SWI XOS_Module
Pull "R0-R5,PC"
; In: R0 = upcall number
; R1 = drive number
......
......@@ -247,6 +247,7 @@ ServiceTable
ASSERT Service_Reset < Service_ResourceFSStarting
ASSERT Service_ResourceFSStarting < Service_SCSIAttached
ASSERT Service_SCSIAttached < Service_SCSIDetached
ASSERT Service_SCSIDetached < Service_BootChoicesVarsSet
DCD 0
DCD ServiceEntry2 - Module_BaseAddr
DCD Service_Reset
......@@ -255,6 +256,7 @@ ServiceTable
]
DCD Service_SCSIAttached
DCD Service_SCSIDetached
DCD Service_BootChoicesVarsSet
DCD 0
;>>>>>>>>>>>>
......@@ -274,6 +276,8 @@ ServiceEntry
CMPNE R1,LR
ADDNE LR,LR,#Service_SCSIDetached - Service_SCSIAttached
CMPNE R1,LR
LDRNE LR,=Service_BootChoicesVarsSet
CMPNE R1,LR
Pull "PC",NE
Pull "LR"
......@@ -282,12 +286,17 @@ ServiceEntry2
TEQ R1, #Service_ResourceFSStarting
BEQ ServiceResFS
]
Push "LR"
LDR LR, =Service_BootChoicesVarsSet
TEQ R1, LR
BEQ ServiceChoicesVarsSet
TEQ R1, #Service_Reset
Pull "LR",NE
BNE ServiceAttachDetach
[ Debug1
mess ,"ServiceEntry, Service_Reset",NL
]
Push "R0-R5,R8,LR"
Push "R0-R5,R8"
getSB
;
;Reservations are lost over reset, so Re-reserve each device/drive with
......@@ -317,6 +326,27 @@ ServiceResFS
Pull "R0,PC"
]
ServiceChoicesVarsSet ROUT
Push "R0-R5" ; LR already stacked
; Check all attached devices against the Hide file
getSB
MOV R3, #MaxDriveNo-1
sbaddr R4, BlockSizes
10
LDRB LR, [R4, R3]
TEQ LR, #&FF
BEQ %FT90
DrvRecPtr R5,R3
mapDrvToDevLo R1,R3,R5
BL CheckDriveAllowed
BNE %FT90
BL DoDismount
BLVC DetachDevice
90
SUBS R3, R3, #1
BGE %BT10
Pull "R0-R5,PC"
DoSwiRetryDiscOp ROUT
Push "R8,LR"
LDR R8, FileCorePrivate
......
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