Commits (6)
  • John Ballance's avatar
    Small changes to enable interaction with PartMan module · a290d023
    John Ballance authored
    Detail:
      Changes are compile time enabled with the compile time option
      PartitionManager set TRUE
    Admin:
    
    
    Version 1.29. Tagged as 'SCSIFS-1_29'
    a290d023
  • Jeffrey Lee's avatar
    Tidy things up a bit · f7507077
    Jeffrey Lee authored
    Detail:
      s/ScsiFs00, ScsiFs05, ScsiFs15, ScsiFs20, ScsiFs50 - Add comments for some of the different IDs which are used. Add MaxDriveNo constant, and make use of it where appropriate. Make BlockSizes non-braindead.
    Admin:
      Cosmetic changes only, binary unchanged.
    
    
    Version 1.29. Not tagged
    f7507077
  • Jeffrey Lee's avatar
    Strip some old code and options · 48d890c1
    Jeffrey Lee authored
    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
    48d890c1
  • Jeffrey Lee's avatar
    Fix memory corruption when encountering a floppy-type device with SCSI ID >= 4 · 09740560
    Jeffrey Lee authored
    Detail:
      s/ScsiFs20 - Fix UnlockMedia to perform the correct translation between SCSI ID and FileCore drive number
    Admin:
      Tested on Raspberry Pi
      Fixes issue reported on forums when many drives connected:
      https://www.riscosopen.org/forum/forums/4/topics/3831
    
    
    Version 1.30. Tagged as 'SCSIFS-1_30'
    09740560
  • Jeffrey Lee's avatar
    Minor improvements · 3a1ef8f7
    Jeffrey Lee authored
    Detail:
      hdr/mymacros, s/ScsiFs05 - Remove some unused 26bit-only macros. Use REV instruction in RevBytes macro when possible. Replace most manual PSR manipulation with common macros.
      s/Hdr_fst, s/ScsiFs15 - Use Portable_Idle within 1s wait loop, to avoid thrashing the CPU
    Admin:
      Tested on Raspberry Pi
    
    
    Version 1.31. Tagged as 'SCSIFS-1_31'
    3a1ef8f7
  • Jeffrey Lee's avatar
    Make 'Hide' file feature more useful when SCSIFS in ROM · e952c055
    Jeffrey Lee authored
    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'
    e952c055
...@@ -28,12 +28,14 @@ new Service Call is issued: ...@@ -28,12 +28,14 @@ new Service Call is issued:
Service_SCSIMounting &20104 Service_SCSIMounting &20104
R2 = SCSIFS disc icon (0..7) which is about to be mounted. R2 = SCSIFS disc icon (0..7) which is about to be mounted.
R3 = SCSI ID for this drive proposed
If a helper App wishes to mount a partition other than the base one If a helper App wishes to mount a partition other than the base one
it should issue SWI SCSIFS_Partitions with it should issue SWI SCSIFS_Partitions with
R0 = 0 R0 = 0
R1 = SCSIFS disc icon (0..7) (R2 from the service call) R1 = SCSIFS disc icon (0..7) (R2 from the service call)
R2 = Desired sector offset to disc image base. R2 = Desired sector offset to disc image base.
R3 = SCSI ID for this drive
This SWI MUST be issued immediately. On return from the service call This SWI MUST be issued immediately. On return from the service call
SCSIFS will use this value to mount the disc. SCSIFS will use this value to mount the disc.
\ No newline at end of file
...@@ -9,14 +9,6 @@ SCSIFSBuffers_Syntax DCB "SBu", 0 ...@@ -9,14 +9,6 @@ SCSIFSBuffers_Syntax DCB "SBu", 0
] ]
SCSIFSDirCache_Help DCB "HDC", 0 SCSIFSDirCache_Help DCB "HDC", 0
SCSIFSDirCache_Syntax DCB "SDC", 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_Help DCB "HDr", 0
SCSIFSDrive_Syntax DCB "SDr", 0 SCSIFSDrive_Syntax DCB "SDr", 0
| |
...@@ -49,27 +41,6 @@ SCSIFSDirCache_Syntax ...@@ -49,27 +41,6 @@ SCSIFSDirCache_Syntax
= TokenEscapeChar,Token0 = TokenEscapeChar,Token0
= " <size>[K]",0 = " <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 SCSIFSDrive_Help
= "*Configure " = "*Configure "
= TokenEscapeChar,Token0 = TokenEscapeChar,Token0
......
...@@ -11,13 +11,13 @@ ...@@ -11,13 +11,13 @@
GBLS Module_HelpVersion GBLS Module_HelpVersion
GBLS Module_ComponentName GBLS Module_ComponentName
GBLS Module_ComponentPath GBLS Module_ComponentPath
Module_MajorVersion SETS "1.28" Module_MajorVersion SETS "1.32"
Module_Version SETA 128 Module_Version SETA 132
Module_MinorVersion SETS "" Module_MinorVersion SETS ""
Module_Date SETS "06 Oct 2013" Module_Date SETS "09 Sep 2017"
Module_ApplicationDate SETS "06-Oct-13" Module_ApplicationDate SETS "09-Sep-17"
Module_ComponentName SETS "SCSIFS" Module_ComponentName SETS "SCSIFS"
Module_ComponentPath SETS "castle/RiscOS/Sources/FileSys/SCSIFS/SCSIFS" Module_ComponentPath SETS "castle/RiscOS/Sources/FileSys/SCSIFS/SCSIFS"
Module_FullVersion SETS "1.28" Module_FullVersion SETS "1.32"
Module_HelpVersion SETS "1.28 (06 Oct 2013)" Module_HelpVersion SETS "1.32 (09 Sep 2017)"
END END
/* (1.28) /* (1.32)
* *
* This file is automatically maintained by srccommit, do not edit manually. * This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1. * Last processed by srccommit version: 1.1.
* *
*/ */
#define Module_MajorVersion_CMHG 1.28 #define Module_MajorVersion_CMHG 1.32
#define Module_MinorVersion_CMHG #define Module_MinorVersion_CMHG
#define Module_Date_CMHG 06 Oct 2013 #define Module_Date_CMHG 09 Sep 2017
#define Module_MajorVersion "1.28" #define Module_MajorVersion "1.32"
#define Module_Version 128 #define Module_Version 132
#define Module_MinorVersion "" #define Module_MinorVersion ""
#define Module_Date "06 Oct 2013" #define Module_Date "09 Sep 2017"
#define Module_ApplicationDate "06-Oct-13" #define Module_ApplicationDate "09-Sep-17"
#define Module_ComponentName "SCSIFS" #define Module_ComponentName "SCSIFS"
#define Module_ComponentPath "castle/RiscOS/Sources/FileSys/SCSIFS/SCSIFS" #define Module_ComponentPath "castle/RiscOS/Sources/FileSys/SCSIFS/SCSIFS"
#define Module_FullVersion "1.28" #define Module_FullVersion "1.32"
#define Module_HelpVersion "1.28 (06 Oct 2013)" #define Module_HelpVersion "1.32 (09 Sep 2017)"
#define Module_LibraryVersionInfo "1:28" #define Module_LibraryVersionInfo "1:32"
...@@ -14,51 +14,6 @@ ...@@ -14,51 +14,6 @@
; ;
; >AdfsMacros ; >AdfsMacros
MACRO
SetBorder $r,$g,$b,$cond
Push "R0,R1",$cond
LDR$cond R0, =VIDC
MOV$cond R1, #bit30
ORR$cond R1, R1, #$g * 16 + $r
ORR$cond R1, R1, #$b * 256
STR$cond R1, [R0]
Pull "R0,R1",$cond
MEND
MACRO ;set some PSR bits
$lab setpsr $bits,$tempreg,$cond
$lab MOV$cond $tempreg,#$bits
ORR$cond $tempreg,$tempreg,PC
TEQ$cond.P PC,$tempreg
MEND
MACRO ;clear some PSR bits
$lab clrpsr $bits,$tempreg,$cond
$lab MVN$cond $tempreg,#$bits
TST$cond.P $tempreg,PC
MEND
MACRO ;toggle some PSR bits
$lab togpsr $bits,$tempreg,$cond
$lab MOV$cond $tempreg,#$bits
TEQ$cond.P $tempreg,PC
MEND
MACRO
$lab retfiq $cc
$lab SUB$cc.S PC, LR, #4
MEND
MACRO
nop
MOVNV R0,R0
MEND
;do an operation with 16 bit width const as an 8 bit width if possible ;do an operation with 16 bit width const as an 8 bit width if possible
MACRO MACRO
...@@ -126,10 +81,14 @@ $lab * 1 :SHL: ($bitnum) ...@@ -126,10 +81,14 @@ $lab * 1 :SHL: ($bitnum)
; ;
MACRO MACRO
$label RevBytes $arm, $t1,$t2 $label RevBytes $arm, $t1,$t2
[ NoARMv6
$label MVN $t1,#&FF00 ;a3=&FFFF00FF $label MVN $t1,#&FF00 ;a3=&FFFF00FF
EOR $t2,$arm,$arm,ROR #16 EOR $t2,$arm,$arm,ROR #16
AND $t2,$t1,$t2,LSR #8 AND $t2,$t1,$t2,LSR #8
EOR $arm,$t2,$arm,ROR #8 EOR $arm,$t2,$arm,ROR #8
|
$label REV $arm,$arm
]
MEND MEND
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
...@@ -138,11 +97,7 @@ $label MVN $t1,#&FF00 ;a3=&FFFF00FF ...@@ -138,11 +97,7 @@ $label MVN $t1,#&FF00 ;a3=&FFFF00FF
; ;
MACRO MACRO
$label DoSCSIOp $label DoSCSIOp
[ FloppySupport
$label BL SCSIOp_HandlingAtn $label BL SCSIOp_HandlingAtn
|
$label SWI XSCSI_Op
]
MEND MEND
; ;
...@@ -210,12 +165,7 @@ $label SWI XSCSI_Op ...@@ -210,12 +165,7 @@ $label SWI XSCSI_Op
] ]
Pull "LR" Pull "LR"
15 15
[ No32bitCode RestPSR R0,,cf
TEQP PC, R0 ;restore PSR
nop ;delay in case mode change
|
MSR CPSR_cf, R0
]
Pull "R0,R1,LR" Pull "R0,R1,LR"
21 21
] ]
......
; 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
...@@ -34,13 +34,11 @@ ...@@ -34,13 +34,11 @@
GET Hdr:SCSI GET Hdr:SCSI
GET Hdr:SCSIErr GET Hdr:SCSIErr
GET Hdr:OSRSI6 GET Hdr:OSRSI6
GET Hdr:Portable
GET VersionASM GET VersionASM
GBLL test_version GBLL test_version
test_version SETL {FALSE} test_version SETL {FALSE}
GBLA max_fix LNK ScsiFs00.s
max_fix SETA 11
LNK Fixes.s
...@@ -16,20 +16,8 @@ ...@@ -16,20 +16,8 @@
TTL "Declarations and workspace allocation" TTL "Declarations and workspace allocation"
GBLL OpticalMemorySupport
OpticalMemorySupport SETL fix_1
GBLL IgnoreRecoveredError
IgnoreRecoveredError SETL fix_3
GBLL UseSpecialScatterBlk GBLL UseSpecialScatterBlk
UseSpecialScatterBlk SETL fix_11 UseSpecialScatterBlk SETL {TRUE}
GBLL FloppySupport
FloppySupport SETL fix_10
GBLL MediaLocking
MediaLocking SETL {TRUE}
GBLL DoBuffering GBLL DoBuffering
DoBuffering SETL {FALSE} ;Read-ahead/write-behind not supported DoBuffering SETL {FALSE} ;Read-ahead/write-behind not supported
...@@ -46,18 +34,13 @@ XferLenMax64K SETL {TRUE} ...@@ -46,18 +34,13 @@ XferLenMax64K SETL {TRUE}
GBLL RetryIfBusy GBLL RetryIfBusy
RetryIfBusy SETL {TRUE} RetryIfBusy SETL {TRUE}
GBLL BigDisc
BigDisc SETL {TRUE}
GBLL AutoDetect
AutoDetect SETL {TRUE}
GBLL HotPlug
HotPlug SETL AutoDetect :LAND: {TRUE}
GBLL AllowPartitions GBLL AllowPartitions
AllowPartitions SETL {TRUE} AllowPartitions SETL {TRUE}
[ :LNOT: :DEF: PartitionManager
GBLL PartitionManager
PartitionManager SETL {FALSE}
]
GBLL Ejecting GBLL Ejecting
Ejecting SETL {FALSE} Ejecting SETL {FALSE}
...@@ -72,6 +55,7 @@ international_help SETL {TRUE} ; Default to RISC OS 3.60+ international ...@@ -72,6 +55,7 @@ international_help SETL {TRUE} ; Default to RISC OS 3.60+ international
GBLL Dev GBLL Dev
Dev SETL test_version Dev SETL test_version
;Debug message switches ;Debug message switches
[ Dev [ Dev
GBLL Debug GBLL Debug
...@@ -149,13 +133,8 @@ EscapeBit bit 6 ;escape if this bit set in ESC_Status ...@@ -149,13 +133,8 @@ EscapeBit bit 6 ;escape if this bit set in ESC_Status
K * 1024 K * 1024
M * K*K M * K*K
[ BigDisc
BigBit * CreateFlag_BigDiscSupport BigBit * CreateFlag_BigDiscSupport
NewErrorBit * CreateFlag_NewErrorSupport NewErrorBit * CreateFlag_NewErrorSupport
|
BigBit * 0
NewErrorBit * 0
]
[ Ejecting [ Ejecting
EjectBit * CreateFlag_FloppyEjects EjectBit * CreateFlag_FloppyEjects
...@@ -188,6 +167,8 @@ OpMask * 2_1111 ;ops 0-15 ...@@ -188,6 +167,8 @@ OpMask * 2_1111 ;ops 0-15
DiscBits * 2_111 :SHL: (32-3) ;In all disc addresses DiscBits * 2_111 :SHL: (32-3) ;In all disc addresses
MaxDriveNo * 8 ; FileCore drive numbers 0-7
; CMOS allocation ; CMOS allocation
^ ScsiFsCMOS ^ ScsiFsCMOS
...@@ -198,14 +179,15 @@ CMOSflags # 1 ...@@ -198,14 +179,15 @@ CMOSflags # 1
; b7 unused ; b7 unused
FileCMOS # 1 ;number of additional file cache buffers FileCMOS # 1 ;number of additional file cache buffers
DirCMOS # 1 ;dir cache size DirCMOS # 1 ;dir cache size
[ :LNOT: BigDisc # 4 ;spare (was used for map sizes, pre-BigDisc)
MapSizeCMOS # 4 ;map sizes of discs in units of 256 bytes
]
Service_SCSIAttached * &20102 Service_SCSIAttached * &20102
Service_SCSIDetached * &20103 Service_SCSIDetached * &20103
[ AllowPartitions [ AllowPartitions
Service_SCSIMounting * &20104 Service_SCSIMounting * &20104
]
[ PartitionManager
XPartMan_MorePartitions * &79AC0
] ]
AREA |!!!SCSIFSModule|, CODE, READONLY, PIC AREA |!!!SCSIFSModule|, CODE, READONLY, PIC
...@@ -327,12 +309,14 @@ LostUnitAtn bit 0 ...@@ -327,12 +309,14 @@ LostUnitAtn bit 0
ASSERT MiscOp_PollChanged_EmptyWorks_Flag = bit6 ASSERT MiscOp_PollChanged_EmptyWorks_Flag = bit6
ASSERT MiscOp_PollChanged_ChangedWorks_Flag = bit7 ASSERT MiscOp_PollChanged_ChangedWorks_Flag = bit7
DevNo # 3 DevNo # 3 ; SCSI device ID
;HeadPosition # 4 ;HeadPosition # 4
;PositionUnknown * bit31 ;PositionUnknown * bit31
DrvSequenceNum # 4 DrvSequenceNum # 4
SzDrvRec # 0 SzDrvRec # 0
; $rdr = drive record ptr
; $rd = SCSI device ID
MACRO MACRO
$lab STDevNo $rd,$rdr,$rtemp,$c $lab STDevNo $rd,$rdr,$rtemp,$c
ASSERT $rtemp<>$rdr ASSERT $rtemp<>$rdr
...@@ -344,6 +328,7 @@ $lab LDRB$c $rtemp,[$rdr,#DrvFlags] ...@@ -344,6 +328,7 @@ $lab LDRB$c $rtemp,[$rdr,#DrvFlags]
;point Rptr to start of drive record Rindex, must preserve flags ;point Rptr to start of drive record Rindex, must preserve flags
; $Rindex = FileCore drive number
MACRO MACRO
$lab DrvRecPtr $Rptr,$Rindex,$cond $lab DrvRecPtr $Rptr,$Rindex,$cond
...@@ -376,21 +361,14 @@ ParkDiscAdd # 4 ...@@ -376,21 +361,14 @@ ParkDiscAdd # 4
^ 0, SB ^ 0, SB
SCSIFSWorkBase # 0 SCSIFSWorkBase # 0
Padding # 4 ;>>>RCM stop 'sbaddr R7, BlockSizes-4' in ScsiFs15 from failing BlockSizes a4 MaxDriveNo ;log2 of block size for device or 0 if not mounted yet
BlockSizes a4 4 ;log to base two of block size for device or 0 if not
;mounted yet
[ :LNOT: BigDisc
MapSizes a4 4
]
FileCorePrivate a4 4 FileCorePrivate a4 4
WinnieCallAfter a4 4 WinnieCallAfter a4 4
[ BigDisc
FCFeatures a4 4 FCFeatures a4 4
FC_Big * bit0 FC_Big * bit0
FC_NewErrors * bit1 FC_NewErrors * bit1
]
[ AllowPartitions [ AllowPartitions
PartitionBaseAdd a4 4*8 PartitionBaseAdd a4 4*MaxDriveNo
] ]
[ UseSpecialScatterBlk [ UseSpecialScatterBlk
ScatterFlag a4 4 ;Are we converting a save to use scatterblk ? ScatterFlag a4 4 ;Are we converting a save to use scatterblk ?
...@@ -401,20 +379,20 @@ WriteScatBlk a4 6*4 ;Here is the scatter special block ...@@ -401,20 +379,20 @@ WriteScatBlk a4 6*4 ;Here is the scatter special block
MsgFileOpen a4 4 MsgFileOpen a4 4
MsgFileBlock a4 4*4 MsgFileBlock a4 4*4
[ HotPlug
AttCBCount # 1 AttCBCount # 1
DetCBCount # 1 DetCBCount # 1
Dieing # 1 Dieing # 1
[ AllowPartitions
allowdupID # 1 ; next time through the loop will use same scsi id
|
myalign # 1 myalign # 1
] ]
;Low level workspace ;Low level workspace
Winnies # 1 Winnies # 1
[ FloppySupport:LOR:AutoDetect
Floppies # 1 Floppies # 1
# 2 # 2
DrvRecs # SzDrvRec*8 DrvRecs # SzDrvRec*MaxDriveNo
]
[ UseSpecialScatterBlk [ UseSpecialScatterBlk
; Block of 0's used for padding writes in special scatter blocks ; Block of 0's used for padding writes in special scatter blocks
...@@ -460,7 +438,12 @@ CTL_BACKGROUND EQU &01 :SHL: 29 ...@@ -460,7 +438,12 @@ CTL_BACKGROUND EQU &01 :SHL: 29
; ;
CTL_cnvt EQU 21 ;Shift (left) factor CTL_cnvt EQU 21 ;Shift (left) factor
[ AutoDetect ; mapDrvToDevLo:
; In:
; $rs = FileCore drive number
; $rdr = Drive record ptr (optional)
; Out:
; $rd = SCSI device ID
MACRO MACRO
$lab mapDrvToDevLo $rd, $rs, $rdr $lab mapDrvToDevLo $rd, $rs, $rdr
[ "$rdr" = "" [ "$rdr" = ""
...@@ -474,6 +457,11 @@ $lab mapDrvToDevLo $rd, $rs, $rdr ...@@ -474,6 +457,11 @@ $lab mapDrvToDevLo $rd, $rs, $rdr
MOV $rd, $rd, ASR #8 MOV $rd, $rd, ASR #8
MEND MEND
; mapDevToDrvLo:
; In:
; $rs = SCSI device ID
; Out:
; $rd = FileCore drive number, or MaxDriveNo if not found
MACRO MACRO
$lab mapDevToDrvLo $rd, $rs $lab mapDevToDrvLo $rd, $rs
ASSERT $rd = R1 ASSERT $rd = R1
...@@ -481,30 +469,6 @@ $lab mapDevToDrvLo $rd, $rs ...@@ -481,30 +469,6 @@ $lab mapDevToDrvLo $rd, $rs
$lab BIC R1, R1, #&FF000000 $lab BIC R1, R1, #&FF000000
BL MapDevToDrv BL MapDevToDrv
MEND MEND
|
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 LNK ScsiFs05.s
...@@ -41,15 +41,11 @@ PHEX ...@@ -41,15 +41,11 @@ PHEX
BNE PHEXIT1 ; return if IRQ thread BNE PHEXIT1 ; return if IRQ thread
] ]
MOV R3, LR MOV R3, LR
; Switch to SVC mode, preserving flags (+ disabling IRQs?)
[ No32bitCode [ No32bitCode
ASSERT SVC_mode=3 SetMode SVC_mode, R0
ORR R0, LR, #SVC_mode
TEQP PC, R0 ; go to SVC mode preserving flags
nop
| |
MRS R0, CPSR SetModeSEI SVC32_mode, R0
ORR R0, R0, #SVC26_mode :OR: I32_bit
MSR CPSR_c, R0
] ]
Push "LR" Push "LR"
[ SpoolOff [ SpoolOff
...@@ -111,9 +107,9 @@ Mess1 ;R0,R1,LR stacked ...@@ -111,9 +107,9 @@ Mess1 ;R0,R1,LR stacked
[ No32bitCode [ No32bitCode
ORR LR, LR, #SVC_mode :OR: Z_bit ORR LR, LR, #SVC_mode :OR: Z_bit
TEQP PC, LR ; go to supervisor mode, preserve FI, set EQ TEQP PC, LR ; go to supervisor mode, preserve FI, set EQ
nop ; delay for mode change MOV R0, R0 ; delay for mode change
| |
ORR LR, LR, #Z_bit ORR LR, R0, #Z_bit
ORR LR, LR, #SVC26_mode :OR: I32_bit ORR LR, LR, #SVC26_mode :OR: I32_bit
MSR CPSR_cf, LR MSR CPSR_cf, LR
] ]
...@@ -201,12 +197,9 @@ SetVOnR0 ...@@ -201,12 +197,9 @@ SetVOnR0
; exit R0,V result ; exit R0,V result
; R2 = full byte ; R2 = full byte
; R4 = number of drives
; R5 = default drive
[ FloppySupport
; R3 = number of removable media drives (floppies) ; R3 = number of removable media drives (floppies)
; R4 = number of fixed media drives (winnies) ; R4 = number of fixed media drives (winnies)
] ; R5 = default drive
ReadCMOSflags ROUT ReadCMOSflags ROUT
Push "R1,LR" Push "R1,LR"
MOV R0, #OsByte_ReadCMOS MOV R0, #OsByte_ReadCMOS
...@@ -214,55 +207,17 @@ ReadCMOSflags ROUT ...@@ -214,55 +207,17 @@ ReadCMOSflags ROUT
SWI XOS_Byte ; (R0-R2->R0-R2,V) SWI XOS_Byte ; (R0-R2->R0-R2,V)
MOVVS R2, #2_01000001 ; default NoDir, one drive MOVVS R2, #2_01000001 ; default NoDir, one drive
BVS %FT95 BVS %FT95
[ FloppySupport
MOV R3, R2, LSR #6 MOV R3, R2, LSR #6
]
AND R4, R2, #2_00000111 AND R4, R2, #2_00000111
CMPS R4, #4 CMPS R4, #4
MOVHI R4, #1 MOVHI R4, #1
AND R5, R2, #2_00111000 AND R5, R2, #2_00111000
MOV R5, R5, LSR #3 MOV R5, R5, LSR #3
[ FloppySupport
|
CMPS R5, R4
MOVHS R5, #0
ADD R5, R5, #4
]
95 95
[ HotPlug
MOV R3, #4 MOV R3, #4
MOV R4, #4 MOV R4, #4
]
Pull "R1,PC" 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 ; ReadFileCMOS
...@@ -358,11 +313,7 @@ ParseAnyDrive ROUT ...@@ -358,11 +313,7 @@ ParseAnyDrive ROUT
; Entry: R1-> string ; Entry: R1-> string
; Exit: R1-> first char after ; Exit: R1-> first char after
[ FloppySupport
; good => R0 drive number, V=0 ; good => R0 drive number, V=0
|
; good => R0 drive number-4, V=0
]
; bad => R0 -> error, V=1 ; bad => R0 -> error, V=1
BL SkipSpaces ; (R1->R0,R1,C) BL SkipSpaces ; (R1->R0,R1,C)
...@@ -376,13 +327,8 @@ ParseAnyDrive ROUT ...@@ -376,13 +327,8 @@ ParseAnyDrive ROUT
SUBHS R0, R0, #"a"-"A" SUBHS R0, R0, #"a"-"A"
CMPS R0, #"A" CMPS R0, #"A"
SUBHS R0, R0, #"A"-"0" SUBHS R0, R0, #"A"-"0"
[ FloppySupport
SUBS R0, R0, #"0" SUBS R0, R0, #"0"
RSBCSS LR, R0, #7 RSBCSS LR, R0, #7
|
SUBS R0, R0, #"4"
RSBCSS LR, R0, #3
]
Pull "PC",CS Pull "PC",CS
10 10
ADRL R0, ErrorBlock_SCSIFSBadDrive ADRL R0, ErrorBlock_SCSIFSBadDrive
...@@ -412,7 +358,10 @@ WrDec ROUT ...@@ -412,7 +358,10 @@ WrDec ROUT
STRVS R0,[SP] STRVS R0,[SP]
Pull "R0-R2,PC" Pull "R0-R2,PC"
[ AutoDetect ; In:
; R1 = SCSI device ID
; Out:
; R1 = FileCore drive number, or MaxDriveNo if not found
MapDevToDrv ROUT MapDevToDrv ROUT
Push "R2,R3,LR" Push "R2,R3,LR"
MOV R2, #0 MOV R2, #0
...@@ -420,7 +369,7 @@ MapDevToDrv ROUT ...@@ -420,7 +369,7 @@ MapDevToDrv ROUT
mapDrvToDevLo R3, R2 mapDrvToDevLo R3, R2
TEQ R3, R1 TEQ R3, R1
ADDNE R2, R2, #1 ADDNE R2, R2, #1
TEQNE R2, #8 TEQNE R2, #MaxDriveNo
BNE %BT01 BNE %BT01
MOV R1, R2 MOV R1, R2
Pull "R2,R3,PC" Pull "R2,R3,PC"
...@@ -460,12 +409,20 @@ ScanLoop ...@@ -460,12 +409,20 @@ ScanLoop
TEQ R8, LR TEQ R8, LR
BNE ScanNext BNE ScanNext
[ HotPlug [ AllowPartitions
LDRB R8, allowdupID
TEQ R8, #0
MOVNE R8, #0
STRNEB R8,allowdupID
BNE BypassCheck ; partitions reuse same scsi drive
]
MOV R8, R1 ; check we've not already MOV R8, R1 ; check we've not already
BL MapDevToDrv ; spotted this drive BL MapDevToDrv ; spotted this drive
TEQ R1, #8 TEQ R1, #MaxDriveNo
MOV R1, R8 MOV R1, R8
BNE ScanNext BNE ScanNext
[ AllowPartitions
BypassCheck
] ]
; I don't use SCSI_Initialise 2 as it will report errors from ; I don't use SCSI_Initialise 2 as it will report errors from
...@@ -495,52 +452,39 @@ ScanCheck ...@@ -495,52 +452,39 @@ ScanCheck
mess ,"Type",NL mess ,"Type",NL
] ]
TEQ LR, #DevDirectAccess TEQ LR, #DevDirectAccess
[ OpticalMemorySupport
TEQNE LR, #DevOpticalMemory TEQNE LR, #DevOpticalMemory
]
BNE ScanNext BNE ScanNext
[ FloppySupport
LDRB LR, [SP, #1] LDRB LR, [SP, #1]
TST LR, #&80 ; Removable bit TST LR, #&80 ; Removable bit
BNE AddRemovable BNE AddRemovable
]
AddFixed AddFixed
[ Debug7 [ Debug7
wrhex R6 wrhex R6
mess ,"Adding fixed",NL mess ,"Adding fixed",NL
] ]
[ HotPlug
MOV R0, #4 MOV R0, #4
BL MapInDevice BL MapInDevice
ADDNE R6, R6, #1 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 B ScanNext
AddRemovable AddRemovable
[ Debug7 [ Debug7
wrhex R5 wrhex R5
mess ,"Adding removable",NL mess ,"Adding removable",NL
] ]
[ HotPlug
MOV R0, #0 MOV R0, #0
BL MapInDevice BL MapInDevice
ADDNE R5, R5, #1 ADDNE R5, R5, #1
|
CMP R5, R3
BHS ScanNext
DrvRecPtr R0, R5
STDevNo R1,R0, LR
ADD R5, R5, #1
]
]
ScanNext ScanNext
[ PartitionManager
Push "R2"
MOV R2, #1
SWI XPartMan_MorePartitions
TEQ R2, #0 ; SWI returns 0 if more partitions to mount
MOVEQ r2, #1
STREQB R2, allowdupID
Pull "R2" ; SWI returns 1 if no more, or error if swi not there
BEQ ScanLoop
]
ADD R1, R1, #&20 ; move to next LUN ADD R1, R1, #&20 ; move to next LUN
TST R1, #&100 TST R1, #&100
BEQ ScanLoop BEQ ScanLoop
...@@ -576,11 +520,6 @@ CDB_Inquiry ...@@ -576,11 +520,6 @@ CDB_Inquiry
DCB 36 DCB 36
DCB 0 DCB 0
ALIGN ALIGN
] ; AutoDetect
[ HotPlug
[ {TRUE}
; check if this drive is 'disabled'. A drive is 'disabled' if its ; check if this drive is 'disabled'. A drive is 'disabled' if its
...@@ -684,9 +623,6 @@ CDANotAllowed ...@@ -684,9 +623,6 @@ CDANotAllowed
ChoicesHide ChoicesHide
DCB "Choices:SCSIFS.Hide",0 DCB "Choices:SCSIFS.Hide",0
ALIGN ALIGN
]
...@@ -821,29 +757,14 @@ DoDetachedCallback ...@@ -821,29 +757,14 @@ DoDetachedCallback
10 AND LR,R1,R2 10 AND LR,R1,R2
TEQ LR,R0 ; if the device number fits the mask TEQ LR,R0 ; if the device number fits the mask
BNE %FT80 BNE %FT80
MOV R3,#7 ; then loop over all drives MOV R3,#MaxDriveNo-1 ; then loop over all drives
20 20
DrvRecPtr R5,R3 DrvRecPtr R5,R3
mapDrvToDevLo LR,R3,R5 mapDrvToDevLo LR,R3,R5
TEQ LR,R1 ; if this drive maps to the device TEQ LR,R1 ; if this drive maps to the device
BNE %FT70 ; unmap it BNE %FT70 ; unmap it
MOV LR,#-1 ; clear the device field BL DetachDevice
STDevNo LR,R5, R4
LDRB LR, [R5,#DrvFlags]
ORR LR, LR, #LostUnitAtn
STRB LR, [R5,#DrvFlags]
sbaddr R5, BlockSizes-4
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 70 SUBS R3,R3,#1
BPL %BT20 BPL %BT20
...@@ -859,6 +780,29 @@ DoDetachedCallback ...@@ -859,6 +780,29 @@ DoDetachedCallback
SWI XOS_Module SWI XOS_Module
Pull "R0-R5,PC" 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]
ORR LR, LR, #LostUnitAtn
STRB LR, [R5,#DrvFlags]
sbaddr R5, BlockSizes
MOV LR, #0 ; blank the block size
STRB LR, [R5, R3]
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
EXIT
; In: R0 = upcall number ; In: R0 = upcall number
; R1 = drive number ; R1 = drive number
UpcallDrive UpcallDrive
...@@ -875,6 +819,5 @@ UpcallDrive ...@@ -875,6 +819,5 @@ UpcallDrive
SCSIPath_Template SCSIPath_Template
DCB "SCSI::n",0 ; 2 words DCB "SCSI::n",0 ; 2 words
] ; HotPlug
LNK ScsiFs15.s LNK ScsiFs15.s
...@@ -48,13 +48,11 @@ LowLevelOp2 ;another internal entry point ...@@ -48,13 +48,11 @@ LowLevelOp2 ;another internal entry point
mess , "LowLevelEntry/LowLevelOp - " mess , "LowLevelEntry/LowLevelOp - "
] ]
[ HotPlug
MOV LR,R2,LSR #(32-3) MOV LR,R2,LSR #(32-3)
DrvRecPtr LR,LR DrvRecPtr LR,LR
mapDrvToDevLo LR,LR,LR mapDrvToDevLo LR,LR,LR
CMP LR,#-1 CMP LR,#-1
BEQ BadDrive BEQ BadDrive
]
CMPS R4, #0 ; IF 0 length CMPS R4, #0 ; IF 0 length
BICEQ R7, R1, #NoTimeOut :OR: NoEscape :OR: ScatterBit :OR: AltDefectBit BICEQ R7, R1, #NoTimeOut :OR: NoEscape :OR: ScatterBit :OR: AltDefectBit
...@@ -64,43 +62,19 @@ LowLevelOp2 ;another internal entry point ...@@ -64,43 +62,19 @@ LowLevelOp2 ;another internal entry point
CMPEQS R7, #DiscOp_ReadTrk ; AND verify, read/write secs, not background CMPEQS R7, #DiscOp_ReadTrk ; AND verify, read/write secs, not background
Pull "R0-R8,R9,PC",LO ; THEN nothing to do Pull "R0-R8,R9,PC",LO ; THEN nothing to do
[ :LNOT: BigDisc sbaddr R7, BlockSizes ; if not examined drive yet
[ 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-4 ; if not examined drive yet
LDRB R8, [R7,R2, LSR #(32-3)] LDRB R8, [R7,R2, LSR #(32-3)]
CMPS R8, #0 ; V=0 CMPS R8, #0 ; V=0
BLEQ Examine ; (R2,R7->R0,R8,V) then do it now BLEQ Examine ; (R2,R7->R0,R8,V) then do it now
BVS LowError BVS LowError
[ BigDisc
LDR R7, FCFeatures LDR R7, FCFeatures
]
ANDS R5, R1, #OpMask ANDS R5, R1, #OpMask
CMPS R5, #DiscOp_Restore+1 ; moan if bad reason code CMPS R5, #DiscOp_Restore+1 ; moan if bad reason code
; LDRCCB R0, Winnies ; LDRCCB R0, Winnies
;>>> RSBCCS R0, R0, R2, LSR #29 ; or if bad drive ;>>> RSBCCS R0, R0, R2, LSR #29 ; or if bad drive
[ FloppySupport
;>>>what about highest floppy number? ;>>>what about highest floppy number?
]
BCS BadParameters BCS BadParameters
MOV R0, R2, LSR #29 MOV R0, R2, LSR #29
...@@ -117,11 +91,9 @@ LowLevelOp2 ;another internal entry point ...@@ -117,11 +91,9 @@ LowLevelOp2 ;another internal entry point
BHS %FT20 BHS %FT20
;convert byte disc address to block address ;convert byte disc address to block address
BIC LR, R2, #DiscBits BIC LR, R2, #DiscBits
[ BigDisc
TST R7, #FC_Big TST R7, #FC_Big
MOVNE R7, LR MOVNE R7, LR
BNE %FT20 BNE %FT20
]
MOV R7, LR, LSR R8 ; block number MOV R7, LR, LSR R8 ; block number
TEQS LR, R7, LSL R8 TEQS LR, R7, LSL R8
BNE BadParameters BNE BadParameters
...@@ -180,10 +152,8 @@ WriteTrackCase ...@@ -180,10 +152,8 @@ WriteTrackCase
B DoNOP B DoNOP
SeekCase SeekCase
[ MediaLocking
MOV R1, R0 MOV R1, R0
BL UnLockMedia BL UnLockMedia
]
[ SeekIsNOP [ SeekIsNOP
[ Debug3 [ Debug3
mess , "Seek !!NOT SUPPORTED - NOP !!", NL mess , "Seek !!NOT SUPPORTED - NOP !!", NL
...@@ -352,11 +322,7 @@ DontNeedScatBlk ...@@ -352,11 +322,7 @@ DontNeedScatBlk
SUBS R6,R4,R5,LSL R8 SUBS R6,R4,R5,LSL R8
SUBGT R4,R4,R6 SUBGT R4,R4,R6
MOVLT R6,#0 MOVLT R6,#0
[ BigDisc
Push "R6,R8" Push "R6,R8"
|
Push "R6"
]
MOV R5, #0 MOV R5, #0
...@@ -371,10 +337,8 @@ DontNeedScatBlk ...@@ -371,10 +337,8 @@ DontNeedScatBlk
30 30
Push "R0-R4" ; Stack incase we need to retry Push "R0-R4" ; Stack incase we need to retry
DoSCSIOp DoSCSIOp
[ IgnoreRecoveredError
BLVS CheckRecovered ; If error is 'Recovered error' clear BLVS CheckRecovered ; If error is 'Recovered error' clear
; V and pretend it never happened ; V and pretend it never happened
]
BVC %FT35 ; OK, so ditch stacked R0-R4 and continue BVC %FT35 ; OK, so ditch stacked R0-R4 and continue
BL CheckRetry BL CheckRetry
Pull "R0-R4",VC ; Retry with stacked R0-R4 Pull "R0-R4",VC ; Retry with stacked R0-R4
...@@ -384,10 +348,8 @@ DontNeedScatBlk ...@@ -384,10 +348,8 @@ DontNeedScatBlk
ADD SP,SP,#5*4 ; Ditch stacked R0-R4 before reporting error ADD SP,SP,#5*4 ; Ditch stacked R0-R4 before reporting error
| |
DoSCSIOp DoSCSIOp
[ IgnoreRecoveredError
BLVS CheckRecovered ; If error is 'Recovered error' clear BLVS CheckRecovered ; If error is 'Recovered error' clear
; V and pretend it never happened ; V and pretend it never happened
]
LDR LR, FCFeatures LDR LR, FCFeatures
] ]
...@@ -398,11 +360,7 @@ DontNeedScatBlk ...@@ -398,11 +360,7 @@ DontNeedScatBlk
TST LR, #FC_NewErrors TST LR, #FC_NewErrors
ORREQ R0, R0, #ExternalErrorBit ORREQ R0, R0, #ExternalErrorBit
MOVVC R0, #0 MOVVC R0, #0
[ BigDisc
LDR R8, [SP], #16 ; Pull blocksize & discard stacked CBD LDR R8, [SP], #16 ; Pull blocksize & discard stacked CBD
|
ADD SP,SP,#12 ; Discard the stacked CBD
]
LDMIB SP, {R1-R2,R6-R7} LDMIB SP, {R1-R2,R6-R7}
[ UseSpecialScatterBlk [ UseSpecialScatterBlk
...@@ -422,13 +380,9 @@ DontNeedScatBlk ...@@ -422,13 +380,9 @@ DontNeedScatBlk
] ]
SUB R7, R7, R4 ; Amount Xfered SUB R7, R7, R4 ; Amount Xfered
[ BigDisc
TST LR, #FC_Big TST LR, #FC_Big
ADDNE R2, R2, R7, LSR R8 ; Inc. disc address by amount transfered ADDNE R2, R2, R7, LSR R8 ; Inc. disc address by amount transfered
ADDEQ R2, R2, R7 ; 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} STMIA SP, {R0,R1-R2,R3-R4}
[ XferLenMax64K [ XferLenMax64K
...@@ -479,31 +433,11 @@ BadParameters ...@@ -479,31 +433,11 @@ BadParameters
BL SetV BL SetV
B LowError B LowError
[ HotPlug
BadDrive BadDrive
MOV R0, #BadDriveErr MOV R0, #BadDriveErr
BL SetV BL SetV
B LowError 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 ; CheckRecovered
; ============== ; ==============
...@@ -520,7 +454,6 @@ CheckRecovered ...@@ -520,7 +454,6 @@ CheckRecovered
Pull "R0,R1" Pull "R0,R1"
CMPEQ R0,#0 ; pretend it never happened (clear V) CMPEQ R0,#0 ; pretend it never happened (clear V)
MOV PC,LR ; else keep the error MOV PC,LR ; else keep the error
]
; ;
; CheckRetry ; CheckRetry
...@@ -568,13 +501,13 @@ WaitOneSecond ...@@ -568,13 +501,13 @@ WaitOneSecond
SWI XOS_ReadMonotonicTime SWI XOS_ReadMonotonicTime
ADD R1,R0,#100 ADD R1,R0,#100
Wait_10 Wait_10
SWI XPortable_Idle
SWI XOS_ReadMonotonicTime SWI XOS_ReadMonotonicTime
CMP R0,R1 CMP R0,R1
BLO Wait_10 BLO Wait_10
Pull "R0,R1,PC",AL Pull "R0,R1,PC",AL
[ FloppySupport
; ============= ; =============
; DoPollChanged ; DoPollChanged
; ============= ; =============
...@@ -742,7 +675,7 @@ SCSIOp_HandlingAtn ...@@ -742,7 +675,7 @@ SCSIOp_HandlingAtn
Pull "R9,PC",NE Pull "R9,PC",NE
LDRB R2,[SP,#0] ; R2 = SCSI device of operation LDRB R2,[SP,#0] ; R2 = SCSI device of operation
MOV R1,#7 ; loop over 8 drives MOV R1,#MaxDriveNo-1 ; loop over 8 drives
05 05
mapDrvToDevLo R0,R1 mapDrvToDevLo R0,R1
TEQ R0,R2 ; were we talking to this drive's device? TEQ R0,R2 ; were we talking to this drive's device?
...@@ -757,6 +690,5 @@ SCSIOp_HandlingAtn ...@@ -757,6 +690,5 @@ SCSIOp_HandlingAtn
Pull "R0-R4" ; restore entry registers Pull "R0-R4" ; restore entry registers
SWI XSCSI_Op ; retry the operation SWI XSCSI_Op ; retry the operation
Pull "R9,PC" Pull "R9,PC"
]
LNK ScsiFs20.s LNK ScsiFs20.s
...@@ -45,19 +45,11 @@ MiscEntry ROUT ...@@ -45,19 +45,11 @@ MiscEntry ROUT
B %FT90 B %FT90
MiscTable MiscTable
Misc Mount Misc Mount
[ FloppySupport
Misc PollChanged Misc PollChanged
Misc LockDrive Misc LockDrive
Misc UnlockDrive Misc UnlockDrive
Misc PollPeriod Misc PollPeriod
Misc Eject Misc Eject
|
B %FT95
B %FT95
B %FT95
B %FT95
B %FT95
]
B %FT95 B %FT95
Misc DriveStatus Misc DriveStatus
90 90
...@@ -93,43 +85,37 @@ MiscTable ...@@ -93,43 +85,37 @@ MiscTable
DoMount ROUT DoMount ROUT
Push "R1-R4,R6-R8,LR" Push "R1-R4,R6-R8,LR"
[ HotPlug
BL Misc_CheckDrivePresent BL Misc_CheckDrivePresent
Pull "R1-R4,R6-R8,PC",VS Pull "R1-R4,R6-R8,PC",VS
]
[ BigDisc
MOV R8, #0 MOV R8, #0
LDR LR, FCFeatures LDR LR, FCFeatures
TST LR, #FC_Big TST LR, #FC_Big
BEQ %FT05 BEQ %FT05
; fudgery - Mount gets passed a byte address; we need to convert to the ; fudgery - Mount gets passed a byte address; we need to convert to the
; sector/block address that LowLevelOp expects. ; sector/block address that LowLevelOp expects.
sbaddr R7, BlockSizes-4 ; if not examined drive yet sbaddr R7, BlockSizes ; if not examined drive yet
LDRB R8, [R7,R2, LSR #(32-3)] LDRB R8, [R7,R2, LSR #(32-3)]
CMPS R8, #0 ; V=0 CMPS R8, #0 ; V=0
BLEQ Examine ; (R2,R7->R0,R8,V) then do it now BLEQ Examine ; (R2,R7->R0,R8,V) then do it now
Pull "R1-R4,R6-R8,PC",VS Pull "R1-R4,R6-R8,PC",VS
05 05
]
[ AllowPartitions [ AllowPartitions
Push "R0, R1,R2" Push "R0, R1,R2,R3"
MOV R2, R2, LSR #(32-3) ; disc number requested MOV R2, R2, LSR #(32-3) ; disc number requested
DrvRecPtr R1, R2
LDRB R3, [R1, #:INDEX:DevNo]
LDR R1, =Service_SCSIMounting LDR R1, =Service_SCSIMounting
SWI OS_ServiceCall ; announce our intentions SWI OS_ServiceCall ; announce our intentions
Pull "R0,R1,R2" Pull "R0,R1,R2,R3"
] ]
[ FloppySupport
TSTS R2, #bit31 TSTS R2, #bit31
BEQ %FT20 ; Floppy BEQ %FT20 ; Floppy
]
;read in the boot block as requested, will probably trigger Examine ;read in the boot block as requested, will probably trigger Examine
10 10
[ BigDisc
AND LR, R2, #DiscBits AND LR, R2, #DiscBits
BIC R2, R2, #DiscBits BIC R2, R2, #DiscBits
ORR R2, LR, R2, LSR R8 ORR R2, LR, R2, LSR R8
]
MOV R6, #NIL ; no defect list - empty for SCSI discs anyway MOV R6, #NIL ; no defect list - empty for SCSI discs anyway
MOV R1, #DiscOp_ReadSecs :OR: DiscOp_Op_IgnoreEscape_Flag MOV R1, #DiscOp_ReadSecs :OR: DiscOp_Op_IgnoreEscape_Flag
CMP R4, #0 CMP R4, #0
...@@ -142,7 +128,6 @@ DoMount ROUT ...@@ -142,7 +128,6 @@ DoMount ROUT
Pull "R1-R4,R6-R8,PC" Pull "R1-R4,R6-R8,PC"
[ FloppySupport
20 20
;Read from DefectListDiscAdd &C00, size SzDefectList &200 ;Read from DefectListDiscAdd &C00, size SzDefectList &200
; ;
...@@ -152,12 +137,8 @@ DoMount ROUT ...@@ -152,12 +137,8 @@ DoMount ROUT
mess ,NL mess ,NL
] ]
AND R2, R2, #DiscBits AND R2, R2, #DiscBits
[ BigDisc
MOV R4, #DefectListDiscAdd MOV R4, #DefectListDiscAdd
ORR R2, R2, R4, LSR R8 ORR R2, R2, R4, LSR R8
|
ORR R2, R2, #DefectListDiscAdd
]
MOV R3, #ScratchSpace MOV R3, #ScratchSpace
MOV R4, #SzDefectList MOV R4, #SzDefectList
MOV R1, #DiscOp_ReadSecs :OR: DiscOp_Op_IgnoreEscape_Flag MOV R1, #DiscOp_ReadSecs :OR: DiscOp_Op_IgnoreEscape_Flag
...@@ -220,7 +201,6 @@ DoMount ROUT ...@@ -220,7 +201,6 @@ DoMount ROUT
LDMFD SP, {R1-R4} LDMFD SP, {R1-R4}
B %BT10 B %BT10
[ HotPlug
Misc_CheckDrivePresent Misc_CheckDrivePresent
Push "LR" Push "LR"
mapDrvToDevLo LR,R1 mapDrvToDevLo LR,R1
...@@ -229,7 +209,6 @@ Misc_CheckDrivePresent ...@@ -229,7 +209,6 @@ Misc_CheckDrivePresent
MOV R0, #BadDriveErr MOV R0, #BadDriveErr
BL SetV BL SetV
Pull "PC" Pull "PC"
]
; ======== ; ========
; CheckSum ; CheckSum
...@@ -259,7 +238,6 @@ CheckSum ROUT ...@@ -259,7 +238,6 @@ CheckSum ROUT
CMPS R2, R3 ; check sum = old check byte ? CMPS R2, R3 ; check sum = old check byte ?
BLNE SetV BLNE SetV
Pull "R1,R3,PC" Pull "R1,R3,PC"
]
; ======= ; =======
; Examine ; Examine
...@@ -268,8 +246,8 @@ CheckSum ROUT ...@@ -268,8 +246,8 @@ CheckSum ROUT
;do any initialisation required for drive including reading block size ;do any initialisation required for drive including reading block size
;entry ;entry
; R2 drive (4 to 7) in top 3 bits ; R2 FileCore drive number in top 3 bits
; R7 -> BlockSizes-4 (see ScsiFs15) ; R7 -> BlockSizes
;exit ;exit
; R0, V set if error ; R0, V set if error
...@@ -319,9 +297,7 @@ Examine ...@@ -319,9 +297,7 @@ Examine
] ]
LDRB R0,[SP,#0] ; Device type LDRB R0,[SP,#0] ; Device type
CMP R0,#DevDirectAccess ; CMP R0,#DevDirectAccess ;
[ OpticalMemorySupport
CMPNE R0,#DevOpticalMemory CMPNE R0,#DevOpticalMemory
]
BNE %FT96 ; Error - 'Not a winnie' BNE %FT96 ; Error - 'Not a winnie'
LDR R0,[SP,#12] ; Block (sector) size LDR R0,[SP,#12] ; Block (sector) size
...@@ -375,7 +351,6 @@ Examine ...@@ -375,7 +351,6 @@ Examine
BL CopyError BL CopyError
B %BT95 B %BT95
[ FloppySupport
; =========== ; ===========
; DoLockDrive ; DoLockDrive
...@@ -465,8 +440,6 @@ DoEject ...@@ -465,8 +440,6 @@ DoEject
MOV PC, LR MOV PC, LR
] ]
]
; ============= ; =============
; DoDriveStatus ; DoDriveStatus
; ============= ; =============
...@@ -474,17 +447,13 @@ DoEject ...@@ -474,17 +447,13 @@ DoEject
;entry ;entry
; R1 drive 0..7 ; R1 drive 0..7
DoDriveStatus DoDriveStatus
CMP R1, #8 CMP R1, #MaxDriveNo
MOVHS R2, #2 MOVHS R2, #2
MOVHS PC, LR MOVHS PC, LR
[ HotPlug
mapDrvToDevLo R2, R1 mapDrvToDevLo R2, R1
CMP R2, #-1 CMP R2, #-1
MOVEQ R2, #2 MOVEQ R2, #2
MOVNE R2, #0 MOVNE R2, #0
|
MOV R2, #0
]
MOV PC, LR MOV PC, LR
; ;
...@@ -512,7 +481,7 @@ DoDismount ...@@ -512,7 +481,7 @@ DoDismount
ADD SP, SP, #(Dismount_end - Dismount_start) ADD SP, SP, #(Dismount_end - Dismount_start)
sbaddr R2, BlockSizes-4 ; Zero the BlockSize table entry, to force sbaddr R2, BlockSizes ; Zero the BlockSize table entry, to force
MOVVC R0, #0 ; an Examine and re-initialise of the MOVVC R0, #0 ; an Examine and re-initialise of the
STRVCB R0, [R2,R1] ; ScsiDriver on next ScsiFs access STRVCB R0, [R2,R1] ; ScsiDriver on next ScsiFs access
mapDrvToDevLo R1, R1 ; map drive onto device mapDrvToDevLo R1, R1 ; map drive onto device
...@@ -542,7 +511,6 @@ ReserveDevice ROUT ...@@ -542,7 +511,6 @@ ReserveDevice ROUT
MOV R3, R12 ; R12 } Dismount & ReleaseDevice MOV R3, R12 ; R12 } Dismount & ReleaseDevice
MOV R8, R12 ; Good value for the access key MOV R8, R12 ; Good value for the access key
SWI XSCSI_Reserve SWI XSCSI_Reserve
[ FloppySupport
BVS %FT95 BVS %FT95
LDR R3, [SP] LDR R3, [SP]
...@@ -551,23 +519,12 @@ ReserveDevice ROUT ...@@ -551,23 +519,12 @@ ReserveDevice ROUT
MOVEQ R2, #1 ; Floppy - Auto Request-Sense, Return Unit-Attention MOVEQ R2, #1 ; Floppy - Auto Request-Sense, Return Unit-Attention
MOVNE R2, #2 ; Winnie - Auto Request-Sense, Ignore Unit-Attention MOVNE R2, #2 ; Winnie - Auto Request-Sense, Ignore Unit-Attention
SWI XSCSI_Control SWI XSCSI_Control
[ MediaLocking
TST R3, #4 TST R3, #4
BLNE LockMedia ; Lock winnies in place BLNE LockMedia ; Lock winnies in place
]
|
MOVVC R0, #4 ; RC for ControlErrors
MOVVC R2, #2 ; Auto Request-Sense, Ignore Unit-Attention
SWIVC XSCSI_Control
[ MediaLocking
BLVC LockMedia
]
]
95 95
Pull "R2,PC" Pull "R2,PC"
[ MediaLocking
; ;
; On entry ; On entry
; R1 = Scsi deviceID ; R1 = Scsi deviceID
...@@ -604,7 +561,7 @@ UnLockMedia ...@@ -604,7 +561,7 @@ UnLockMedia
SavePSR R6 SavePSR R6
ADR R2, CDB_UnLockMedia ADR R2, CDB_UnLockMedia
UnLocMed_10 UnLocMed_10
AND R1, R1, #&FF ; Incase any high order bits are set mapDevToDrvLo R1, R1
sbaddr R5, BlockSizes sbaddr R5, BlockSizes
MOV R4, #0 MOV R4, #0
STRB R4, [R5,R1] STRB R4, [R5,R1]
...@@ -676,6 +633,5 @@ CDB_EjectMedia ...@@ -676,6 +633,5 @@ CDB_EjectMedia
DCB 0 ; Start=0 (b0) DCB 0 ; Start=0 (b0)
ALIGN ALIGN
] ]
]
LNK TokHelpSrc.s LNK TokHelpSrc.s
...@@ -55,13 +55,13 @@ InitEntry ROUT ; NO REENTRANCY CHECK NEEDED ...@@ -55,13 +55,13 @@ InitEntry ROUT ; NO REENTRANCY CHECK NEEDED
BNE %BT05 BNE %BT05
] ]
[ HotPlug
sbaddr R0, DrvRecs sbaddr R0, DrvRecs
MOV R1, #(-1:SHL:8) MOV R1, #(-1:SHL:8)
MOV R2, #0 MOV R2, #0
STRB R2, AttCBCount STRB R2, AttCBCount
STRB R2, DetCBCount STRB R2, DetCBCount
STRB R2, Dieing STRB R2, Dieing
ASSERT MaxDriveNo = 8
[ AllowPartitions [ AllowPartitions
STR R2, PartitionBaseAdd+0 STR R2, PartitionBaseAdd+0
STR R2, PartitionBaseAdd+4 STR R2, PartitionBaseAdd+4
...@@ -80,12 +80,11 @@ InitEntry ROUT ; NO REENTRANCY CHECK NEEDED ...@@ -80,12 +80,11 @@ InitEntry ROUT ; NO REENTRANCY CHECK NEEDED
STMIA R0!, {R1,R2} ; 5 STMIA R0!, {R1,R2} ; 5
STMIA R0!, {R1,R2} ; 6 STMIA R0!, {R1,R2} ; 6
STMIA R0!, {R1,R2} ; 7 STMIA R0!, {R1,R2} ; 7
]
[ FloppySupport
MOV R2, #0 MOV R2, #0
STR R2, Padding ; >>>>Init floppy BlockSizes ASSERT MaxDriveNo = 8
STR R2, BlockSizes ; Block (sector size) for ScsiFs::4..7 STR R2, BlockSizes ; >>>>Init floppy BlockSizes
STR R2, BlockSizes+4 ; Block (sector size) for ScsiFs::4..7
ASSERT DrvFlags = 0 ASSERT DrvFlags = 0
ASSERT DevNo = 1 ASSERT DevNo = 1
...@@ -98,22 +97,6 @@ InitEntry ROUT ; NO REENTRANCY CHECK NEEDED ...@@ -98,22 +97,6 @@ InitEntry ROUT ; NO REENTRANCY CHECK NEEDED
STMIA R0!, {R1,R2} ; 1 STMIA R0!, {R1,R2} ; 1
STMIA R0!, {R1,R2} ; 2 STMIA R0!, {R1,R2} ; 2
STMIA R0!, {R1,R2} ; 3 STMIA R0!, {R1,R2} ; 3
|
MOV R0, #0
STR R0, BlockSizes
]
[ AutoDetect:LAND:{FALSE}
sbaddr R0, DrvRecs
MOV R2, #0
10
EOR R14, R2, #4 ; original behaviour: device = drive EOR 4
STDevNo R14, R0, R3
ADD R0, R0, #SzDrvRec
ADD R2, R2, #1
CMP R2, #8
BLO %BT10
]
MOV R0, #0 MOV R0, #0
STR R0, MsgFileOpen ; No it isn't STR R0, MsgFileOpen ; No it isn't
...@@ -122,27 +105,17 @@ InitEntry ROUT ; NO REENTRANCY CHECK NEEDED ...@@ -122,27 +105,17 @@ InitEntry ROUT ; NO REENTRANCY CHECK NEEDED
BVS %FT85 BVS %FT85
] ]
BL ReadCMOSflags ; (->R0,R2,R3,R4,R5,V) read #floppies & winnies BL ReadCMOSflags ; (->R0,R2,R3,R4,R5,V) read #floppies & winnies
[ AutoDetect
BL ScanDrives BL ScanDrives
]
[ HotPlug
MOV R3, #4 MOV R3, #4
MOV R4, #4 MOV R4, #4
]
[ FloppySupport
STRB R3, Floppies STRB R3, Floppies
]
STRB R4, Winnies STRB R4