Commit 15738a33 authored by Kevin Bracey's avatar Kevin Bracey
Browse files

* Activated "floppy" (removable) support.

* Added big disc support.
* Added new error reporting scheme.
* Added autoconfiguration, and new SCSIdriver hotplugging.
* Added eject functionality (currently disabled due to issues with some USB
  devices).
* 32-bit compatible.

Version 1.11. Tagged as 'SCSIFS-1_11'
parent 09e00a53
......@@ -22,59 +22,26 @@
# 25-May-94 AMcC Created.
#
#
# Paths
#
EXP_HDR = <export$dir>
COMPONENT = SCSIFS
#
# Generic options:
# Program specific options:
#
MKDIR = cdir
AS = aasm
CP = copy
RM = remove
TOKENISE = tokenise
CHEADER1 = ${COMPONENT}
HEADER1 = ${COMPONENT}
CFLAGS = -c -depend !Depend -IC:
AFLAGS = -depend !Depend -Stamp -quit -module
CPFLAGS = ~cfr~v
TOKHELPSRC = ${TOKENSOURCE}
HELPSRC = HelpText
ROM_SOURCE = s.Hdr_fst
TOKENS = Hdr:Tokens
#
# Program specific options:
#
COMPONENT = SCSIFS
SOURCE = s.Hdr_fst
TARGET = rm.SCSIFS
EXPORTS = ${EXP_HDR}.${COMPONENT}
include StdTools
include AAsmModule
#
# Generic rules:
#
all: ${TARGET}
@echo ${COMPONENT}: all built
export: ${EXPORTS}
@echo ${COMPONENT}: export complete
install: ${TARGET}
${CP} ${TARGET} ${INSTDIR}.${COMPONENT} ${CPFLAGS}
@echo ${COMPONENT}: installed
clean:
${RM} ${TARGET}
${RM} TokenHelp
@echo ${COMPONENT}: cleaned
${TARGET}: ${SOURCE} TokenHelp
${AS} ${AFLAGS} -To $@ -From ${SOURCE}
TokenHelp: ${TOKENS} HelpText
${TOKENISE} ${TOKENS} HelpText $@
${EXP_HDR}.${COMPONENT}: hdr.${COMPONENT}
${CP} hdr.${COMPONENT} $@ ${CPFLAGS}
clean::
${WIPE} o ${WFLAGS}
@@echo ${COMPONENT}: cleaned
# Dynamic dependencies:
;>DevVersion
;this declares the version number, incremented at each assembly
GBLS Version
Version SETS "0.25"
GET <urd>.Hdr.ListOpts
GET <urd>.Hdr.Macros
GET <urd>.Hdr.System
GET <urd>.Hdr.CMOS
GET <urd>.Hdr.File
GET <urd>.Hdr.Services
GET <urd>.Hdr.ModHand
GET <urd>.Hdr.NewSpace
GET <urd>.Hdr.Tokens
GET <urd>.Hdr.UpCall
GET <ScsiDir>.ScsiDriver.Hdr_SCSI
GET <ScsiDir>.ScsiDriver.Hdr_ScsiEr
LNK ScsiFs00
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "1.10"
Module_Version SETA 110
Module_MajorVersion SETS "1.11"
Module_Version SETA 111
Module_MinorVersion SETS ""
Module_Date SETS "23 May 2003"
Module_ApplicationDate SETS "23-May-03"
Module_ComponentName SETS "SCSIFS"
Module_ComponentPath SETS "RiscOS/Sources/FileSys/SCSIFS/SCSIFS"
Module_FullVersion SETS "1.10"
Module_HelpVersion SETS "1.10 (23 May 2003)"
Module_FullVersion SETS "1.11"
Module_HelpVersion SETS "1.11 (23 May 2003)"
END
/* (1.10)
/* (1.11)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.68.
*
*/
#define Module_MajorVersion_CMHG 1.10
#define Module_MajorVersion_CMHG 1.11
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 23 May 2003
#define Module_MajorVersion "1.10"
#define Module_Version 110
#define Module_MajorVersion "1.11"
#define Module_Version 111
#define Module_MinorVersion ""
#define Module_Date "23 May 2003"
......@@ -18,6 +18,6 @@
#define Module_ComponentName "SCSIFS"
#define Module_ComponentPath "RiscOS/Sources/FileSys/SCSIFS/SCSIFS"
#define Module_FullVersion "1.10"
#define Module_HelpVersion "1.10 (23 May 2003)"
#define Module_LibraryVersionInfo "1:10"
#define Module_FullVersion "1.11"
#define Module_HelpVersion "1.11 (23 May 2003)"
#define Module_LibraryVersionInfo "1:11"
......@@ -34,7 +34,7 @@ $num error $name,$str
ASSERT &$num<&100
$name.Err * &$num
$name.ErrBlk
& &$num :OR: (ScsiFsModuleNum :SHL: 8)
& &$num :OR: (fsnumber_SCSIFS :SHL: 8)
= "$str",0
% (4-(.-org):MOD:4):MOD:4 ;align with zeroes
MEND
......@@ -64,7 +64,7 @@ A1 err BadParms,Bad parameters
;A8 error BrokenDir,Broken directory
;A9 error BadFsMap,Bad free space map
;AA BAD CHECKSUM
;AB error BadDefectList,Bad defect list
AB err BadDefectList,Bad defect list
AC error BadDrive,Bad drive
;AD error Size,Sizes don't match ;BACKUP
;AE error SameDisc,Same disc ;BACKUP
......
......@@ -49,6 +49,8 @@ SWIClass SETS SCSIFSSWI_Name
AddSWI NOP10 ; &40990
AddSWI NOP11 ; &40991
AddSWI FreeSpace64 ; &40992
AddSWI NOP12 ; &40993
AddSWI DiscOp64 ; &40994
OPT OldOpt
END
......@@ -142,7 +142,7 @@ $lab * 1 :SHL: ($bitnum)
Align16 $base
ASSERT (.-($base)) :MOD: 4 = 0
WHILE (.-($base)) :MOD: 16 <> 0
MOVNV R0, R0
MOV R0, R0
WEND
MEND
......@@ -158,6 +158,20 @@ $label MVN $t1,#&FF00 ;a3=&FFFF00FF
AND $t2,$t1,$t2,LSR #8
EOR $arm,$t2,$arm,ROR #8
MEND
;------------------------------------------------------------------------------
;
; Macro DoSCSIOp - call SCSI_Op, quietly handling "Unit Attention" sense codes
;
MACRO
$label DoSCSIOp
[ FloppySupport
$label BL SCSIOp_HandlingAtn
|
$label SWI XSCSI_Op
]
MEND
;
;
;------------------------------------------------------------------------------
......@@ -223,8 +237,12 @@ $label MVN $t1,#&FF00 ;a3=&FFFF00FF
]
Pull "LR"
15
[ No32bitCode
TEQP PC, R0 ;restore PSR
nop ;delay in case mode change
|
MSR CPSR_cf, R0
]
Pull "R0,R1,LR"
21
]
......@@ -232,10 +250,10 @@ $label MVN $t1,#&FF00 ;a3=&FFFF00FF
MACRO
wrhex $reg,$cond
Push "R0-R3,LR",$cond
Push "R0-R4,LR",$cond
MOV$cond R2,$reg
BL$cond PHEX
Pull "R0-R3,LR",$cond
Pull "R0-R4,LR",$cond
MEND
......
......@@ -23,12 +23,18 @@ DevVersion SETS "0.00213"
GET Hdr:Macros
GET Hdr:System
GET Hdr:CMOS
GET Hdr:File
GET Hdr:HighFSI
GET Hdr:FSNumbers
; GET Hdr:File
GET Hdr:FileCore
GET Hdr:Services
GET Hdr:ModHand
GET Hdr:NewSpace
; GET Hdr:NewSpace
GET Hdr:PublicWS
GET Hdr:Tokens
GET Hdr:UpCall
GET Hdr:NewErrors
GET Hdr:MsgTrans
GET Hdr:SCSI
; GET Hdr:SCSIErr
GET Hdr:SCSIErr
LNK s.ScsiFs00
......@@ -15,8 +15,8 @@
;>Fixes Modification history of SCSIFS since V 1.03
MACRO
fix $number,$state,$description
GBLL fix_$number
applyfix $number,$state,$description
GBLL fix_$number
fix_$number SETL $state
[ fix_$number
! 0,"Apply fix $number $description"
......@@ -30,13 +30,13 @@ fix_$number SETL $state
;
; ----------------------------------------------------------
fix 1,{TRUE}, Support devices that return 'Optical memory'
fix 2,{TRUE}, Replace ORR/BIC with EOR for remapping
fix 3,{TRUE}, Ignore 'Recovered error' messages
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
fix 10,{FALSE},Support for floppies
applyfix 10,{TRUE},Support for floppies
fix 11,{TRUE}, Do not let SCSIDriver source padding data
applyfix 11,{TRUE}, Do not let SCSIDriver source padding data
LNK s.DevVersion
......@@ -14,11 +14,13 @@
;
;>Hdr_1,10 Header file for SCSIFS V 1.10
GET VersionASM
GBLS version
version SETS "1.10"
version SETS Module_MajorVersion
GBLS date
date SETS "04 Nov 1991"
date SETS Module_Date
GBLL test_version
test_version SETL {FALSE}
......
......@@ -34,9 +34,6 @@ UseSpecialScatterBlk SETL fix_11
GBLL FloppySupport
FloppySupport SETL fix_10
GBLL Remap
Remap SETL T
GBLL MediaLocking
MediaLocking SETL T
......@@ -46,15 +43,24 @@ DoBuffering SETL F ;Read-ahead/write-behind not supported
GBLL SeekIsNOP
SeekIsNOP SETL T ;Because Rodime RO3000S objects to seek command
GBLL ProperScatter
ProperScatter SETL T
GBLL CheckXferLen
CheckXferLen SETL T
GBLL RetryIfBusy
RetryIfBusy SETL T
GBLL BigDisc
BigDisc SETL T
GBLL AutoDetect
AutoDetect SETL T
GBLL HotPlug
HotPlug SETL AutoDetect :LAND: T
GBLL Ejecting
Ejecting SETL F
GBLL LeftToDo ;marker for bits requiring further refinement
LeftToDo SETL F
......@@ -64,7 +70,7 @@ Dev SETL test_version
;Debug message switches
[ Dev
GBLL Debug
Debug SETL F
Debug SETL T
GBLL SpoolOff
SpoolOff SETL F ;T to disable spooling for debug messages
GBLL IrqDebug
......@@ -77,6 +83,7 @@ IrqDebug SETL F
GBLL Debug4
GBLL Debug5
GBLL Debug6
GBLL Debug7
GBLL Debug9
MACRO
......@@ -93,16 +100,17 @@ $a SETL F
MEND
Debug1 switch F ;>>>RCM should be F ;Init/Die/Service entries
Debug2 switch F ;>>>RCM was F ;SCSI drivers
Debug3 switch F ;>>>RCM was F ;low level disc op
Debug4 switch F ;>>>RCM was F ;misc op
Debug1 switch F ;Init/Die/Service entries
Debug2 switch F ;SCSI drivers
Debug3 switch T ;low level disc op
Debug4 switch T ;misc op
Debug5 switch F ;SCSI drivers border colours
Debug6 switch F ;SCSI drivers tube debug
Debug7 switch T ;autodetection
Debug9 switch F ;useful routines
GET hdr.MyMacros
GET hdr.CoreHdr
; GET hdr.CoreHdr
bit0 bit 0
bit1 bit 1
......@@ -153,6 +161,20 @@ M * K*K
PsrMask * &FC000003
NZCV * N_bit :OR: Z_bit :OR: C_bit :OR: V_bit
[ BigDisc
BigBit * BigDiscSupport
NewErrorBit * NewErrorSupport
|
BigBit * 0
NewErrorBit * 0
]
[ Ejecting
EjectBit * FloppiesEject
|
EjectBit * 0
]
;Register allocation
......@@ -164,29 +186,7 @@ CR * 13
DeleteChar * 127
PollPeriod * -1 ;>>>100 ;centi seconds between upcalls when disc changed works
;Disc Operation Reason Codes
^ 0
Param4Op # 0
VerifyOp # 1 ;0
ReadSecsOp # 1 ;1
WriteSecsOp # 1 ;2
Param3Op # 0
ReadTrkOp # 1 ;3 read id for winnie ???
WriteTrkOp # 1 ;4
Param2Op # 0
FirstHeadMoveOp # 0
SeekOp # 1 ;5
Param1Op # 0
RestoreOp # 1 ;6
# 9 ;7-F
ASSERT @=&10
PollPeriod * 100 ;centi seconds between upcalls when disc changed works
ASSERT EscapeBit=&40
......@@ -224,18 +224,15 @@ FileCMOS # 1 ;number of additional file cache buffers
DirCMOS # 1 ;dir cache size
MapSizeCMOS # 4 ;map sizes of discs in units of 256 bytes
ScsiFsSwiBase * Module_SWISystemBase + Module_SWIChunkSize * ScsiFsSWI
Service_SCSIAttached * &20102
Service_SCSIDetached * &20103
Upcall_DriveAdded * 24
Upcall_DriveRemoved * 25
AREA |!!!Module|, CODE, READONLY
^ ScsiFsSwiBase :OR 1 :SHL: 17
XSCSIFS_DiscOp # 1
# 1 ;XADFS_HDC
XSCSIFS_Drives # 1
XSCSIFS_FreeSpace # 1
# 1 ;XADFS_FloppyStructure
XSCSIFS_DescribeDisc # 1
ORG 0
LEADR Module_LoadAddr
ORG 0 ; ADDED alan glover 4/11/91
org
;Module Header
......@@ -247,11 +244,14 @@ org
& ScsiFsTitle
& ScsiFsHelpString
& ComTab
& ScsiFsSwiBase
& SCSIFSSWI_Base
& SwiEntry
& SwiNames
& 0 ;no SWI name decoding code
ASSERT {PC}-org=44
& 0
& ModFlags
ASSERT {PC}-org=52
ScsiFsBootText
= "Acorn " ;includes AdfsTitle
......@@ -275,6 +275,10 @@ ScsiFsHelpString
ALIGN
LTORG
ModFlags
DCD ModuleFlag_32bit
GET hdr.MyErrors
; Disc Record
......@@ -294,7 +298,7 @@ RAskew # 1 ;track to track sector skew for random access
;file allocation
BootOpt # 1 ;boot option for this disc
# 1
LowSector # 1
Zones # 1 ;# zones in map
ZoneSpare # 2 ;# bits in zones after 0 which are not map bits
ASSERT (ZoneSpare :MOD: 4)=2
......@@ -343,12 +347,21 @@ LostUnitAtn bit 0
ASSERT Drv_EmptyWorks = bit6
ASSERT Drv_ChangedWorks = bit7
# 3
DevNo # 3
;HeadPosition # 4
;PositionUnknown * bit31
DrvSequenceNum # 4
SzDrvRec # 0
MACRO
$lab STDevNo $rd,$rdr,$rtemp,$c
ASSERT $rtemp<>$rdr
ASSERT $rtemp<>$rd
$lab LDRB$c $rtemp,[$rdr,#DrvFlags]
ORR$c $rtemp,$rtemp,$rd,LSL #8
STR$c $rtemp,[$rdr,#DrvFlags]
MEND
;point Rptr to start of drive record Rindex, must preserve flags
......@@ -357,8 +370,7 @@ $lab DrvRecPtr $Rptr,$Rindex,$cond
ASSERT $Rptr<>SB
ASSERT $Rptr<>PC
ASSERT SzDrvRec=8
MOV$cond $Rptr,$Rindex, LSL #3
ADD$cond $Rptr,SB,$Rptr
ADD$cond $Rptr,SB,$Rindex, LSL #3
Try8 ADD$cond,$Rptr,$Rptr,(:INDEX:DrvRecs)
MEND
......@@ -535,14 +547,19 @@ BlockSizes a4 4 ;log to base two of block size for device or 0 if not
MapSizes a4 4
FileCorePrivate a4 4
WinnieCallAfter a4 4
[ BigDisc
FCFeatures a4 4
FC_Big * bit0
FC_NewErrors * bit1
]
;Low level workspace
Winnies # 1
[ FloppySupport
# 3
DrvRecs a4 SzDrvRec*4
[ FloppySupport:LOR:AutoDetect
Floppies # 1
# 2
DrvRecs a4 SzDrvRec*8
]
WorkSize # 0
......@@ -579,7 +596,28 @@ CTL_BACKGROUND EQU &01 :SHL: 29
;
CTL_cnvt EQU 21 ;Shift (left) factor
[ AutoDetect
MACRO
$lab mapDrvToDevLo $rd, $rs, $rdr
[ "$rdr" = ""
AND $rd, $rs, #&FF
DrvRecPtr $rd, $rd
ASSERT DevNo :AND: 3 = 1
LDR $rd, [$rd, #DevNo :AND::NOT:3]
|
LDR $rd, [$rdr, #DevNo :AND::NOT:3]
]
MOV $rd, $rd, ASR #8
MEND
MACRO
$lab mapDevToDrvLo $rd, $rs
ASSERT $rd = R1
ASSERT $rs = R1
$lab BIC R1, R1, #&FF000000
BL MapDevToDrv
MEND
|
MACRO
$lab mapDrvToDevLo $rd, $rs
[ fix_2
......@@ -602,6 +640,7 @@ $lab ORR $rd, $rs, #4 ;map drives 4 to 7 to devices 0 to 3
$lab mapDrvToDevImm $rd, $im
$lab MOV $rd, $im :EOR: 4
MEND
]
LNK s.ScsiFs05
......@@ -16,17 +16,24 @@
[ Dev
PHEX
SavePSR R4
[ :LNOT: IrqDebug
MOV R3, #IRQsema
LDR R3, [R3]
TEQS R3, #0
MOVNES PC, LR ;return if IRQ thread
BNE PHEXIT1 ;return if IRQ thread
]
MOV R3, LR
[ No32bitCode
ASSERT SVC_mode=3
ORR R0, LR, #SVC_mode
TEQP PC, R0 ;go to SVC mode preserving flags
nop
|
MRS R0, CPSR
ORR R0, R0, #SVC26_mode :OR: I32_bit
MSR CPSR_c, R0
]
Push "LR"
[ SpoolOff
BL SpoolOff
......@@ -47,29 +54,37 @@ PHLOOP
BL SpoolOn
]
Pull "LR"
MOVS PC, R3
RestPSR R4,,cf
MOV PC, R3
PHEXIT1
RestPSR R4,,f
MOV PC, LR
[ SpoolOff
SpoolOff
Push "R0-R2,LR"
Push "R0-R3,LR"
SavePSR R3
MOV R0, #3
MOV R1, #&10
MOV R2, #&EF
SWI OS_Byte
Pull "R0-R2,PC",,^
RestPSR R3,,f
Pull "R0-R3,PC"
SpoolOn
Push "R0-R2,LR"
Push "R0-R3,LR"
SavePSR R3
MOV R0, #3
MOV R1, #0
MOV R2, #&EF
SWI OS_Byte
Pull "R0-R2,PC",,^
RestPSR R3,,f
Pull "R0-R3,PC"
]
Mess1 ;R0,R1,LR stacked
MOV R0, PC ;save PSR
SavePSR R0 ;save PSR
MOV R1, LR ;save link
[ :LNOT: IrqDebug
MOV LR, #IRQsema
......@@ -78,16 +93,24 @@ Mess1 ;R0,R1,LR stacked
MOVNE PC, R1 ;skip if IRQ thread, return NE
]
BIC LR, R0, #3
[ No32bitCode
ORR LR, LR, #SVC_mode :OR: Z_bit
TEQP PC, LR ;go to supervisor mode, preserve FI, set EQ
nop ;delay for mode change