Commit 864f5b17 authored by John Ballance's avatar John Ballance
Browse files

Added note on SCSIFS_Partitions swi.

	Committing correct files this time.
        previous version, 1.14 failed to include these

Detail:
Admin:  castle added IP. to be beta tested


Version 1.14. Tagged as 'SCSIFS-1_14'
parent 911cbc83
New SCSIFS SWI
SWI SCSIFS_Partitions &40995
On entry
R0 = reason code
Reason code: 0:Set Sector offset for drive N
R0 = 0
R1 = Drive number (0..7)
R2 = Sector offset to base of image
This offset is zero by default. It may be changed by this SWI
at any time, but changing this value after mounting the disc
is usually not wise!
Reason code: 1:Enquire SCSIFS disc number
R0 = 1
returns
R2 = SCSIFS disc icon (0..7), or -1 if none
New SCSIFS Service Call
Immediately prior to mounting a partition for a SCSIFS Drive a
new Service Call is issued:
Service_SCSIMounting &20104
R2 = SCSIFS disc icon (0..7) which is about to be mounted.
If a helper App wishes to mount a partition other than the base one
it should issue SWI SCSIFS_Partitions with
R0 = 0
R1 = SCSIFS disc icon (0..7) (R2 from the service call)
R2 = Desired sector offset to disc image base.
This SWI MUST be issued immediately. On return from the service call
SCSIFS will use this value to mount the disc.
\ No newline at end of file
......@@ -46,6 +46,10 @@ SeekIsNOP SETL T ;Because Rodime RO3000S objects to seek command
GBLL CheckXferLen
CheckXferLen SETL T
; GBLL CheckSpareRMA ; check enough stack before op?
;CheckSpareRMA SETL F
;ExtraRMA * 1024 * 33 ; usb mak pkt of 32k, + 1k ???
GBLL XferLenMax255
XferLenMax255 SETL F
......
......@@ -40,6 +40,7 @@ LowLevelOp ;internal entry point
wrhex R4
wrhex R5
wrhex R6
wrhex R13
mess ,"*>LowLevel",NL
]
......@@ -97,10 +98,20 @@ LowLevelOp ;internal entry point
]
BCS BadParameters
AND R0, R1, #ScatterBit :OR: NoEscape :OR: NoTimeOut :OR: BackgroundOp
MOV R0, R0, LSL #CTL_cnvt
EOR R0, R0, R2, LSR #29
MOV R0, R2, LSR #29
[ Debug3
wrhex R0
wrhex R1
mess , "xx1 ", NL
]
mapDrvToDevLo R0, R0 ;map drive onto device
AND LR, R1, #ScatterBit :OR: NoEscape :OR: NoTimeOut :OR: BackgroundOp
ORR R0, R0, LR, LSL #CTL_cnvt
[ Debug3
wrhex R0
wrhex R1
mess , "xx2 ", NL
]
CMPS R5, #Param1Op
BHS %FT20
;convert byte disc address to block address
......@@ -116,11 +127,6 @@ LowLevelOp ;internal entry point
20
[ AllowPartitions
Push "R0, R1,R2"
MOV R2, R2, LSR #(32-3) ; disc number requested
LDR R1, =Service_SCSIMounting
SWI OS_ServiceCall ; announce our intentions
Pull "R0,R1,R2"
MOV LR, R2, LSR #(32-3) ; disc number
ADD LR, SB, LR, LSL #2 ; to word address
LDR LR, [LR, #:INDEX:PartitionBaseAdd-:INDEX:SCSIFSWorkBase]
......@@ -220,6 +226,19 @@ RestoreCase
;
OpCommon
; [ CheckSpareRMA
; STMFD R13!,{R0-R3}
; MOV R0, #5 ; return total free space
; SWI XOS_Module
; BVS %ft11 ; failed to read size
; CMP R3, #ExtraRMA ; at least xxx free?
; ; no
; RSBLT R1, R3, #ExtraRMA ; extra we need
; MOVLT R0, #1 ; RMA space
; SWILT XOS_ChangeDynamicArea ; try to change it
;11
; LDMFD R13!, {R0-R3} ; recover regs
; ]
MOV R5, #0 ;Default timeout
[ UseSpecialScatterBlk
STR R5, ScatterFlag ;Default: dont use scatter method
......@@ -246,6 +265,11 @@ OpCommon
AND R9, R0, #CTL_TXWRITE :OR: CTL_TXREAD
CMP R9, #CTL_TXWRITE
BNE DontNeedScatBlk ;If we arent writing fine ...
[ Debug3
wrhex r0
mess , "op entry1 "
]
TST R0, #CTL_SCATTER
[ Debug3 ;Oh dear already using a scatter pointer ...
BEQ NotAppropriate1
......@@ -269,12 +293,12 @@ NotAppropriate1
ADR R9, WriteScatBlk
STR R3, [R9, #0]
STR R4, [R9, #4]
MOV R5, #0
STR R5, [R9, #8] ;Second Block starts at address 0 and can
MOV LR, #0
STR LR, [R9, #8] ;Second Block starts at address 0 and can
; be up to 2^Log2BlockSize -1 long, so
; this better be RAM !!!
Pull "R5"
Push "R5" ;Take the rounded up no. of blocks
;Take the rounded up no. of blocks
MOV R5, R5, LSL R8 ;Convert this into bytes
STR R5, ScatterData ;Save this new Total Length
SUB R5, R5, R4 ;And take off the original length
......@@ -345,6 +369,16 @@ DontNeedScatBlk
MOV R9,#60 ;Retry on timeout for 60 seconds
30
Push "R0-R4" ;Stack incase we need to retry
[ Debug3
wrhex R0
wrhex R1
wrhex R2
wrhex R3
wrhex R4
wrhex R5
wrhex R6
mess , "DoSCSIOp", NL
]
DoSCSIOp
[ IgnoreRecoveredError
BLVS CheckRecovered ;If error is 'Recovered error' clear
......@@ -356,7 +390,7 @@ DontNeedScatBlk
BVC %BT30
35
LDR LR, FCFeatures
ADD StkPtr,StkPtr,#20 ;Ditch stacked R0-R4 before reporting error
ADD StkPtr,StkPtr,#5*4 ;Ditch stacked R0-R4 before reporting error
|
DoSCSIOp
[ IgnoreRecoveredError
......@@ -394,6 +428,7 @@ LowError
wrhex R2
wrhex R3
wrhex R4
wrhex R13
mess ,"*<LowLevel",NL,NL
]
DoNOP
......@@ -555,6 +590,7 @@ DoPollChanged ROUT
05
; Floppy drive case
BL TestUnitReady
BLNE TestUnitReady ; try once more to be sure
; ORRNE R0, R5, #LostUnitAtn
; STRNEB R0, [R4,#DrvFlags]
TSTEQS R5, #LostUnitAtn
......@@ -573,6 +609,7 @@ DoPollChanged ROUT
ADD R2, R6, #1
STR R2, [R4,#DrvSequenceNum]
BL TestUnitReady
BLNE TestUnitReady ; try once more to be sure
ORRNE R0, R5, #LostUnitAtn
STRNEB R0, [R4,#DrvFlags]
......@@ -652,15 +689,15 @@ CDB_TestUnitReady
; As SWI XSCSI_Op
;
SCSIOp_HandlingAtn
Push "R0-R4,R10,LR" ; Remember entry registers corrupted by SCSI_Op
Push "R0-R4,R9,LR" ; Remember entry registers corrupted by SCSI_Op
SWI XSCSI_Op ; Issue the operation
ADDVC StkPtr,StkPtr,#6*4 ; If no error, then return
Pull "PC",VC
ADDVC StkPtr,StkPtr,#5*4 ; If no error, then return
Pull "R9,PC",VC
LDR LR,[R0] ; Was it a "Unit attention" error?
LDR R10,=ErrorNumber_SCSI_CC_UnitAttention
TEQ LR,R10
LDR R9,=ErrorNumber_SCSI_CC_UnitAttention
TEQ LR,R9
ADDNE StkPtr,StkPtr,#5*4 ; If not, return the error
Pull "R10,PC",NE
Pull "R9,PC",NE
LDRB R2,[SP,#0] ; R2 = SCSI device of operation
MOV R1,#7 ; loop over 8 drives
......@@ -675,9 +712,9 @@ SCSIOp_HandlingAtn
10
SUBS R1, R1, #1 ; keep going down to drive 0
BPL %BT05
Pull "R0-R4,R10" ; restore entry registers
Pull "R0-R4" ; restore entry registers
SWI XSCSI_Op ; retry the operation
Pull "PC"
Pull "R9,PC"
]
LNK s.ScsiFs20
......@@ -112,6 +112,31 @@ DoMount ROUT
Pull "R1-R4,R6-R8,PC",VS
05
]
; [ T
; mov R0, #5 ; return total free space
; SWI XOS_Module
; BVS %ft11 ; failed to read size
; CMP R3, #1024*1024 ; at least 128k free?
; BGT %ft11 ; yes
; ; no
; RSB R2, R3, #1024*1024 ; extra we need
; MOV R1, R2
; MOV R0, #1 ; RMA space
; SWI XOS_ChangeDynamicArea ; try to change it
; CMP R1, R2
; BGE %ft11
; Pull "R1-R4,R6-R8,PC"
;
;11
; LDMFD R13, {R1-R3} ; copy back regs
; ]
[ AllowPartitions
Push "R0, R1,R2"
MOV R2, R2, LSR #(32-3) ; disc number requested
LDR R1, =Service_SCSIMounting
SWI OS_ServiceCall ; announce our intentions
Pull "R0,R1,R2"
]
[ FloppySupport
TSTS R2, #bit31
BEQ %FT20 ;Floppy
......
......@@ -414,20 +414,42 @@ DoSwiTestReady
[ AllowPartitions
; On entry
; R0 = reason code
; 0 = Sector offset for drive 1 in R1 is in R2
; Reason code: 0 = Sector offset for drive 1 in R1 is in R2
; R1 = Drive number (0..7)
; R2 = sector offset to base of image
; This offset is zero by default. It may be changed by this swi
; at any time, but changing this value after mounting the disc
; is usually not wise!
;
; Reason code: 1 = report SCSIFS disc number
; returns
; R2 = SCSIFS disc icon (0..7), or -1 if none
;
DoSWIPartitions ROUT
Push "R1,R2,LR"
TEQ R0, #0 ; set partition base
BNE %ft1
CMP R1, #7
Pull "R1,R2,PC", HI
ADD LR, SB, R1, LSL #2 ; word offset
STR R2, [LR, #:INDEX:PartitionBaseAdd-:INDEX:SCSIFSWorkBase] ; remember
Pull "R1,R2,PC"
Pull "R1,R2,PC"
1
TEQ R0, #1 ; report icon used
Pull "R1,R2,PC",NE
Push "R3,R4"
MOV R2, #7
2
DrvRecPtr R4, R2
LDRB R3, [R4, #:INDEX:DevNo]
TEQ R3, R1
BEQ %ft3
SUBS R2,R2,#1
BGE %bt2
3
Pull "R3,R4"
STR R2,[R13, #4] ; update R2 return value
Pull "R1,R2,PC"
]
; >>>>>>>>
......@@ -536,7 +558,7 @@ SwiNames ROUT
= "FreeSpace64",0
= "19",0
= "DiscOp64",0
= "PartitionBase",0
= "Partitions",0
= 0
ALIGN
......
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