Commit 48d890c1 authored by Jeffrey Lee's avatar Jeffrey Lee
Browse files

Strip some old code and options

Detail:
  Since we only really care about the RISC OS 5 version of this module, there are various old switches stretching back 20+ years which can be removed to make the sources a bit easier on the eye:
  * OpticalMemorySupport (-> {TRUE})
  * IgnoreRecoveredError (-> {TRUE})
  * FloppySupport (-> {TRUE})
  * MediaLocking (-> {TRUE})
  * BigDisc (-> {TRUE})
  * AutoDetect (-> {TRUE})
  * HotPlug (-> {TRUE})
  Files changed:
  HelpText, hdr/mymacros, s/Fixes, s/Hdr_fst, s/ScsiFs00, s/ScsiFs05, s/ScsiFs15, s/ScsiFs20, s/ScsiFs50
Admin:
  Resulting binary unchanged (for default options, at least)


Version 1.29. Not tagged
parent f7507077
......@@ -9,14 +9,6 @@ SCSIFSBuffers_Syntax DCB "SBu", 0
]
SCSIFSDirCache_Help DCB "HDC", 0
SCSIFSDirCache_Syntax DCB "SDC", 0
[ :LNOT:HotPlug
[ FloppySupport
SCSIFSFloppies_Help DCB "HFl", 0
SCSIFSFloppies_Syntax DCB "SFl", 0
]
SCSIFSDiscs_Help DCB "HDi", 0
SCSIFSDiscs_Syntax DCB "SDi", 0
]
SCSIFSDrive_Help DCB "HDr", 0
SCSIFSDrive_Syntax DCB "SDr", 0
|
......@@ -49,27 +41,6 @@ SCSIFSDirCache_Syntax
= TokenEscapeChar,Token0
= " <size>[K]",0
[ :LNOT:HotPlug
[ FloppySupport
SCSIFSFloppies_Help
= "*Configure "
= TokenEscapeChar,Token0
= " sets the number of SCSI discs attached.",13
SCSIFSFloppies_Syntax
= "Syntax: *Configure "
= TokenEscapeChar,Token0
= " <SCSI discs>",0
]
SCSIFSDiscs_Help
= "*Configure "
= TokenEscapeChar,Token0
= " sets the number of SCSI discs attached.",13
SCSIFSDiscs_Syntax
= "Syntax: *Configure "
= TokenEscapeChar,Token0
= " <SCSI discs>",0
]
SCSIFSDrive_Help
= "*Configure "
= TokenEscapeChar,Token0
......
......@@ -138,11 +138,7 @@ $label MVN $t1,#&FF00 ;a3=&FFFF00FF
;
MACRO
$label DoSCSIOp
[ FloppySupport
$label BL SCSIOp_HandlingAtn
|
$label SWI XSCSI_Op
]
MEND
;
......
; Copyright 1996 Acorn Computers Ltd
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
; http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.
;
;>Fixes Modification history of SCSIFS since V 1.03
MACRO
applyfix $number,$state,$description
GBLL fix_$number
fix_$number SETL $state
[ fix_$number
! 0,"Apply fix $number $description"
]
MEND
; ----------------------------------------------------------
;
; Version 1.03
; released dated 20 Oct 1989
;
; ----------------------------------------------------------
applyfix 1,{TRUE}, Support devices that return 'Optical memory'
applyfix 2,{TRUE}, Replace ORR/BIC with EOR for remapping
applyfix 3,{TRUE}, Ignore 'Recovered error' messages
applyfix 10,{TRUE}, Support for floppies
applyfix 11,{TRUE}, Do not let SCSIDriver source padding data
LNK ScsiFs00.s
......@@ -40,7 +40,4 @@
GBLL test_version
test_version SETL {FALSE}
GBLA max_fix
max_fix SETA 11
LNK Fixes.s
LNK ScsiFs00.s
......@@ -16,20 +16,8 @@
TTL "Declarations and workspace allocation"
GBLL OpticalMemorySupport
OpticalMemorySupport SETL fix_1
GBLL IgnoreRecoveredError
IgnoreRecoveredError SETL fix_3
GBLL UseSpecialScatterBlk
UseSpecialScatterBlk SETL fix_11
GBLL FloppySupport
FloppySupport SETL fix_10
GBLL MediaLocking
MediaLocking SETL {TRUE}
UseSpecialScatterBlk SETL {TRUE}
GBLL DoBuffering
DoBuffering SETL {FALSE} ;Read-ahead/write-behind not supported
......@@ -46,15 +34,6 @@ XferLenMax64K SETL {TRUE}
GBLL RetryIfBusy
RetryIfBusy SETL {TRUE}
GBLL BigDisc
BigDisc SETL {TRUE}
GBLL AutoDetect
AutoDetect SETL {TRUE}
GBLL HotPlug
HotPlug SETL AutoDetect :LAND: {TRUE}
GBLL AllowPartitions
AllowPartitions SETL {TRUE}
......@@ -154,13 +133,8 @@ EscapeBit bit 6 ;escape if this bit set in ESC_Status
K * 1024
M * K*K
[ BigDisc
BigBit * CreateFlag_BigDiscSupport
NewErrorBit * CreateFlag_NewErrorSupport
|
BigBit * 0
NewErrorBit * 0
]
[ Ejecting
EjectBit * CreateFlag_FloppyEjects
......@@ -205,9 +179,7 @@ CMOSflags # 1
; b7 unused
FileCMOS # 1 ;number of additional file cache buffers
DirCMOS # 1 ;dir cache size
[ :LNOT: BigDisc
MapSizeCMOS # 4 ;map sizes of discs in units of 256 bytes
]
# 4 ;spare (was used for map sizes, pre-BigDisc)
Service_SCSIAttached * &20102
Service_SCSIDetached * &20103
......@@ -390,16 +362,11 @@ ParkDiscAdd # 4
^ 0, SB
SCSIFSWorkBase # 0
BlockSizes a4 MaxDriveNo ;log2 of block size for device or 0 if not mounted yet
[ :LNOT: BigDisc
MapSizes a4 4
]
FileCorePrivate a4 4
WinnieCallAfter a4 4
[ BigDisc
FCFeatures a4 4
FC_Big * bit0
FC_NewErrors * bit1
]
[ AllowPartitions
PartitionBaseAdd a4 4*MaxDriveNo
]
......@@ -412,7 +379,6 @@ WriteScatBlk a4 6*4 ;Here is the scatter special block
MsgFileOpen a4 4
MsgFileBlock a4 4*4
[ HotPlug
AttCBCount # 1
DetCBCount # 1
Dieing # 1
......@@ -421,15 +387,12 @@ allowdupID # 1 ; next time through the loop will use same scsi
|
myalign # 1
]
]
;Low level workspace
Winnies # 1
[ FloppySupport:LOR:AutoDetect
Floppies # 1
# 2
DrvRecs # SzDrvRec*MaxDriveNo
]
[ UseSpecialScatterBlk
; Block of 0's used for padding writes in special scatter blocks
......@@ -481,14 +444,6 @@ CTL_cnvt EQU 21 ;Shift (left) factor
; $rdr = Drive record ptr (optional)
; Out:
; $rd = SCSI device ID
; mapDevToDrvLo:
; In:
; $rs = SCSI device ID
; Out:
; $rd = FileCore drive number, or MaxDriveNo if not found
[ AutoDetect
MACRO
$lab mapDrvToDevLo $rd, $rs, $rdr
[ "$rdr" = ""
......@@ -502,6 +457,11 @@ $lab mapDrvToDevLo $rd, $rs, $rdr
MOV $rd, $rd, ASR #8
MEND
; mapDevToDrvLo:
; In:
; $rs = SCSI device ID
; Out:
; $rd = FileCore drive number, or MaxDriveNo if not found
MACRO
$lab mapDevToDrvLo $rd, $rs
ASSERT $rd = R1
......@@ -509,31 +469,6 @@ $lab mapDevToDrvLo $rd, $rs
$lab BIC R1, R1, #&FF000000
BL MapDevToDrv
MEND
|
; Non-AutoDetect uses a fixed mapping of drives 4-7 to SCSI devices 0-3
MACRO
$lab mapDrvToDevLo $rd, $rs
[ fix_2
$lab EOR $rd, $rs, #4
|
$lab BIC $rd, $rs, #4 ;map drives 4 to 7 to devices 0 to 3
]
MEND
MACRO
$lab mapDevToDrvLo $rd, $rs
[ fix_2
$lab EOR $rd, $rs, #4
|
$lab ORR $rd, $rs, #4 ;map drives 4 to 7 to devices 0 to 3
]
MEND
MACRO
$lab mapDrvToDevImm $rd, $im
$lab MOV $rd, $im :EOR: 4
MEND
]
LNK ScsiFs05.s
......@@ -201,12 +201,9 @@ SetVOnR0
; exit R0,V result
; R2 = full byte
; R4 = number of drives
; R5 = default drive
[ FloppySupport
; R3 = number of removable media drives (floppies)
; R4 = number of fixed media drives (winnies)
]
; R5 = default drive
ReadCMOSflags ROUT
Push "R1,LR"
MOV R0, #OsByte_ReadCMOS
......@@ -214,55 +211,17 @@ ReadCMOSflags ROUT
SWI XOS_Byte ; (R0-R2->R0-R2,V)
MOVVS R2, #2_01000001 ; default NoDir, one drive
BVS %FT95
[ FloppySupport
MOV R3, R2, LSR #6
]
AND R4, R2, #2_00000111
CMPS R4, #4
MOVHI R4, #1
AND R5, R2, #2_00111000
MOV R5, R5, LSR #3
[ FloppySupport
|
CMPS R5, R4
MOVHS R5, #0
ADD R5, R5, #4
]
95
[ HotPlug
MOV R3, #4
MOV R4, #4
]
Pull "R1,PC"
[ :LNOT: BigDisc
; ===============
; ReadMapSizeCMOS
; ===============
; exit R0,V if error, R6 map size bytes
ReadMapSizeCMOS ROUT
Push "R1-R3,LR"
MOV R0, #OsByte_ReadCMOS
MOV R3, #3*8
MOV R6, #0
10
MOV R1, #MapSizeCMOS
ADD R1, R1, R3, LSR #3
SWI XOS_Byte ; (R0-R2->R0-R2,V)
BVS %FT95
ORR R6, R6, R2, LSL R3
SUBS R3, R3, #8
BPL %BT10
[ Debug2
wrhex R6
mess ,"MAP SIZES",NL
]
95
Pull "R1-R3,PC"
]
; ============
; ReadFileCMOS
......@@ -358,11 +317,7 @@ ParseAnyDrive ROUT
; Entry: R1-> string
; Exit: R1-> first char after
[ FloppySupport
; good => R0 drive number, V=0
|
; good => R0 drive number-4, V=0
]
; bad => R0 -> error, V=1
BL SkipSpaces ; (R1->R0,R1,C)
......@@ -376,13 +331,8 @@ ParseAnyDrive ROUT
SUBHS R0, R0, #"a"-"A"
CMPS R0, #"A"
SUBHS R0, R0, #"A"-"0"
[ FloppySupport
SUBS R0, R0, #"0"
RSBCSS LR, R0, #7
|
SUBS R0, R0, #"4"
RSBCSS LR, R0, #3
]
Pull "PC",CS
10
ADRL R0, ErrorBlock_SCSIFSBadDrive
......@@ -412,7 +362,6 @@ WrDec ROUT
STRVS R0,[SP]
Pull "R0-R2,PC"
[ AutoDetect
; In:
; R1 = SCSI device ID
; Out:
......@@ -464,7 +413,6 @@ ScanLoop
TEQ R8, LR
BNE ScanNext
[ HotPlug
[ AllowPartitions
LDRB R8, allowdupID
TEQ R8, #0
......@@ -479,7 +427,6 @@ ScanLoop
BNE ScanNext
[ AllowPartitions
BypassCheck
]
]
; I don't use SCSI_Initialise 2 as it will report errors from
......@@ -509,51 +456,28 @@ ScanCheck
mess ,"Type",NL
]
TEQ LR, #DevDirectAccess
[ OpticalMemorySupport
TEQNE LR, #DevOpticalMemory
]
BNE ScanNext
[ FloppySupport
LDRB LR, [SP, #1]
TST LR, #&80 ; Removable bit
BNE AddRemovable
]
AddFixed
[ Debug7
wrhex R6
mess ,"Adding fixed",NL
]
[ HotPlug
MOV R0, #4
BL MapInDevice
ADDNE R6, R6, #1
|
CMP R6, R4
BHS ScanNext
ADD LR, R6, #4
DrvRecPtr R0, LR
STDevNo R1,R0, LR
ADD R6, R6, #1
]
[ FloppySupport
B ScanNext
AddRemovable
[ Debug7
wrhex R5
mess ,"Adding removable",NL
]
[ HotPlug
MOV R0, #0
BL MapInDevice
ADDNE R5, R5, #1
|
CMP R5, R3
BHS ScanNext
DrvRecPtr R0, R5
STDevNo R1,R0, LR
ADD R5, R5, #1
]
]
ScanNext
[ PartitionManager
Push "R2"
......@@ -600,11 +524,6 @@ CDB_Inquiry
DCB 36
DCB 0
ALIGN
] ; AutoDetect
[ HotPlug
[ {TRUE}
; check if this drive is 'disabled'. A drive is 'disabled' if its
......@@ -708,9 +627,6 @@ CDANotAllowed
ChoicesHide
DCB "Choices:SCSIFS.Hide",0
ALIGN
]
......@@ -899,6 +815,5 @@ UpcallDrive
SCSIPath_Template
DCB "SCSI::n",0 ; 2 words
] ; HotPlug
LNK ScsiFs15.s
......@@ -48,13 +48,11 @@ LowLevelOp2 ;another internal entry point
mess , "LowLevelEntry/LowLevelOp - "
]
[ HotPlug
MOV LR,R2,LSR #(32-3)
DrvRecPtr LR,LR
mapDrvToDevLo LR,LR,LR
CMP LR,#-1
BEQ BadDrive
]
CMPS R4, #0 ; IF 0 length
BICEQ R7, R1, #NoTimeOut :OR: NoEscape :OR: ScatterBit :OR: AltDefectBit
......@@ -64,26 +62,6 @@ LowLevelOp2 ;another internal entry point
CMPEQS R7, #DiscOp_ReadTrk ; AND verify, read/write secs, not background
Pull "R0-R8,R9,PC",LO ; THEN nothing to do
[ :LNOT: BigDisc
[ FloppySupport
TST R2, #bit31
BEQ %FT10
]
TEQS R6, #NIL
BEQ %FT10 ; if mount
LDRB R7, [R5,#Zones] ; Here we check that the winnie map size held in
LDRB R8, [R5,#SectorSize] ; CMOS is up to date
MOV R8, R7, LSL R8
MOVS R8, R8, LSR #8
MOVEQ R8, #2
sbaddr R7, MapSizes-4 ; N.B. R2 LSR #(32-3) gives winnie drive number 4..7
LDRB LR, [R7,R2, LSR #(32-3)]
TEQS LR, R8
BLNE UpdateMapSize ; (R2,R7,R8) if not we update it
10
]
sbaddr R7, BlockSizes ; if not examined drive yet
LDRB R8, [R7,R2, LSR #(32-3)]
......@@ -91,16 +69,12 @@ LowLevelOp2 ;another internal entry point
BLEQ Examine ; (R2,R7->R0,R8,V) then do it now
BVS LowError
[ BigDisc
LDR R7, FCFeatures
]
ANDS R5, R1, #OpMask
CMPS R5, #DiscOp_Restore+1 ; moan if bad reason code
; LDRCCB R0, Winnies
;>>> RSBCCS R0, R0, R2, LSR #29 ; or if bad drive
[ FloppySupport
;>>>what about highest floppy number?
]
BCS BadParameters
MOV R0, R2, LSR #29
......@@ -117,11 +91,9 @@ LowLevelOp2 ;another internal entry point
BHS %FT20
;convert byte disc address to block address
BIC LR, R2, #DiscBits
[ BigDisc
TST R7, #FC_Big
MOVNE R7, LR
BNE %FT20
]
MOV R7, LR, LSR R8 ; block number
TEQS LR, R7, LSL R8
BNE BadParameters
......@@ -180,10 +152,8 @@ WriteTrackCase
B DoNOP
SeekCase
[ MediaLocking
MOV R1, R0
BL UnLockMedia
]
[ SeekIsNOP
[ Debug3
mess , "Seek !!NOT SUPPORTED - NOP !!", NL
......@@ -352,11 +322,7 @@ DontNeedScatBlk
SUBS R6,R4,R5,LSL R8
SUBGT R4,R4,R6
MOVLT R6,#0
[ BigDisc
Push "R6,R8"
|
Push "R6"
]
MOV R5, #0
......@@ -371,10 +337,8 @@ DontNeedScatBlk
30
Push "R0-R4" ; Stack incase we need to retry
DoSCSIOp
[ IgnoreRecoveredError
BLVS CheckRecovered ; If error is 'Recovered error' clear
; V and pretend it never happened
]
BVC %FT35 ; OK, so ditch stacked R0-R4 and continue
BL CheckRetry
Pull "R0-R4",VC ; Retry with stacked R0-R4
......@@ -384,10 +348,8 @@ DontNeedScatBlk
ADD SP,SP,#5*4 ; Ditch stacked R0-R4 before reporting error
|
DoSCSIOp
[ IgnoreRecoveredError
BLVS CheckRecovered ; If error is 'Recovered error' clear
; V and pretend it never happened
]
LDR LR, FCFeatures
]
......@@ -398,11 +360,7 @@ DontNeedScatBlk
TST LR, #FC_NewErrors
ORREQ R0, R0, #ExternalErrorBit
MOVVC R0, #0
[ BigDisc
LDR R8, [SP], #16 ; Pull blocksize & discard stacked CBD
|
ADD SP,SP,#12 ; Discard the stacked CBD
]
LDMIB SP, {R1-R2,R6-R7}
[ UseSpecialScatterBlk
......@@ -422,13 +380,9 @@ DontNeedScatBlk
]
SUB R7, R7, R4 ; Amount Xfered
[ BigDisc
TST LR, #FC_Big
ADDNE R2, R2, R7, LSR R8 ; Inc. disc address by amount transfered
ADDEQ R2, R2, R7 ; Inc. disc address by amount transfered
|
ADD R2, R2, R7 ; Inc. disc address by amount transfered
]
STMIA SP, {R0,R1-R2,R3-R4}
[ XferLenMax64K
......@@ -479,31 +433,11 @@ BadParameters
BL SetV
B LowError
[ HotPlug
BadDrive
MOV R0, #BadDriveErr
BL SetV
B LowError
]
[ :LNOT: BigDisc
UpdateMapSize
Push "R0-R2,LR"
STRB R8, [R7,R2, LSR #(32-3)]
MOV R0, #OsByte_WriteCMOS
MOV R1, R2, LSR #(32-3)
[ Debug2
wrhex R1
wrhex R8
mess ,"oldsize drive newsize",NL
]
ADD R1, R1, #MapSizeCMOS-4
MOV R2, R8
SWI XOS_Byte ; (R0-R2->R0-R2,V)
Pull "R0-R2,PC"
]
[ IgnoreRecoveredError
;
; CheckRecovered
; ==============
......@@ -520,7 +454,6 @@ CheckRecovered
Pull "R0,R1"
CMPEQ R0,#0 ; pretend it never happened (clear V)
MOV PC,LR ; else keep the error
]
;
; CheckRetry
......@@ -574,7 +507,6 @@ Wait_10
Pull "R0,R1,PC",AL
[ FloppySupport
; =============
; DoPollChanged
; =============
......@@ -757,6 +689,5 @@ SCSIOp_HandlingAtn
Pull "R0-R4" ; restore entry registers
SWI XSCSI_Op ; retry the operation
Pull "R9,PC"
]
LNK ScsiFs20.s
......@@ -45,19 +45,11 @@ MiscEntry ROUT
B %FT90
MiscTable
Misc Mount