Commit 81c8d7c3 authored by Kevin Bracey's avatar Kevin Bracey
Browse files

32-bit conversion started, Tungsten hard disc support added.

Hard disc functional, but PIO mode only. Don't go near the floppy.

Version 3.33. Not tagged
parent 28968ea5
......@@ -19,64 +19,30 @@
# ***********************************
# Date Name Description
# ---- ---- -----------
# 25-May-94 AMcC Created.
#
# 06-Jun-00 SNB Recreated using makefile fragments
#
# Paths
#
EXP_HDR = <export$dir>
#
# Generic options:
#
MKDIR = cdir
AS = aasm
CP = copy
RM = remove
CCFLAGS = -c -depend !Depend -IC:
ASFLAGS = -depend !Depend -Stamp -quit -module -To $@ -From
CPFLAGS = ~cfr~v
#
# Program specific options:
#
COMPONENT = ADFS
SOURCE = s.ADFS
TARGET = rm.${MACHINE}.ADFS
EXPORTS = ${EXP_HDR}.${COMPONENT}
#
# Generic rules:
# Program specific options:
#
rom: ${TARGET}
@echo ${COMPONENT}: rom module built
export: ${EXPORTS}
@echo ${COMPONENT}: export complete
install_rom: ${TARGET}
${CP} ${TARGET} ${INSTDIR}.${COMPONENT} ${CPFLAGS}
@echo ${COMPONENT}: rom module installed
CHEADER1 = ${COMPONENT}
HEADER1 = ${COMPONENT}
clean:
${RM} ${TARGET}
${RM} s.TokenHelp
@echo ${COMPONENT}: cleaned
TOKHELPSRC = ${TOKENSOURCE}
HELPSRC = HelpText
ROM_SOURCE = ADFS.s
resources:
${MKDIR} ${RESDIR}.${COMPONENT}
${CP} Resources.${LOCALE}.Messages ${RESDIR}.${COMPONENT}.Messages ${CPFLAGS}
@echo ${COMPONENT}: resource files copied
ASFLAGS = ${OPTIONS} -cpu 5TE
${TARGET}: ${SOURCE} s.TokenHelp
${MKDIR} rm.${MACHINE}
${AS} ${ASFLAGS} ${SOURCE}
include StdTools
include AAsmModule
s.TokenHelp: Hdr:Tokens HelpText
tokenise Hdr:Tokens HelpText $@
${EXP_HDR}.${COMPONENT}: hdr.${COMPONENT}
${CP} hdr.${COMPONENT} $@ ${CPFLAGS}
#
# Generic rules:
#
clean::
${WIPE} o ${WFLAGS}
@@echo ${COMPONENT}: cleaned
# Dynamic dependencies:
......@@ -13,4 +13,4 @@
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine rom
amu_machine rom THROWBACK=-throwback
GET Version
A1 SETL {TRUE}
FDC1772 SETL {TRUE}
Top16Write SETL {TRUE}
IOMD SETL {FALSE}
......
GET Version
A1 SETL {FALSE}
FDC1772 SETL {FALSE}
Top16Write SETL {TRUE}
IOMD SETL {FALSE}
......
GET Version
A1 SETL {TRUE}
FDC1772 SETL {TRUE}
Top16Write SETL {FALSE}
IOMD SETL {TRUE}
......
GET Version
A1 SETL {TRUE}
FDC1772 SETL {TRUE}
Top16Write SETL {FALSE}
IOMD SETL {TRUE}
......
GET Version
A1 SETL {TRUE}
FDC1772 SETL {TRUE}
Top16Write SETL {FALSE}
IOMD SETL {TRUE}
......
GET Version
A1 SETL {TRUE}
FDC1772 SETL {TRUE}
Top16Write SETL {FALSE}
IOMD SETL {TRUE}
......
......@@ -2,7 +2,6 @@
MOS_Version SETA 211 ; V2.11+ setup 82C710 if present
A1 SETL {TRUE}
FDC1772 SETL {TRUE}
HasASICB SETL {FALSE}
Proc32bit SETL {FALSE}
Top16Write SETL {TRUE}
......
GET Version
PCI SETL {FALSE}
Support1772 SETL {FALSE}
ByteAddressedHW SETL {TRUE}
A1 SETL {TRUE}
Top16Write SETL {FALSE}
IOMD SETL {TRUE}
NewTransferCode SETL {TRUE}
FloppyPodule SETL {TRUE}
;Override_PDevNo SETA 37
END
......@@ -2,7 +2,6 @@
MOS_Version SETA 211 ; V2.11+ setup 82C710 if present
A1 SETL {TRUE}
FDC1772 SETL {TRUE}
HasASICB SETL {TRUE}
Proc32bit SETL {TRUE}
Top16Write SETL {TRUE}
......
......@@ -2,7 +2,6 @@
MOS_Version SETA 211 ; V2.11+ setup 82C710 if present
A1 SETL {TRUE}
FDC1772 SETL {TRUE}
HasASICB SETL {TRUE}
END
......@@ -17,8 +17,13 @@ test_version SETL {FALSE}
;test_version SETL {TRUE}
GBLL A1
GBLL FDC1772
GBLL Top16Write
GBLL Support1772
GBLL IOMD
GBLL PCI
GBLL NewTransferCode
GBLL ByteAddressedHW
GBLA Override_PDevNo
GBLL FloppyPodule
END
;
; This file is automatically maintained by srccommit, do not edit manually.
; Last processed by srccommit version: 1.68.
;
GBLS Module_MajorVersion
GBLA Module_Version
......@@ -14,11 +15,11 @@
Module_MajorVersion SETS "3.33"
Module_Version SETA 333
Module_MinorVersion SETS ""
Module_Date SETS "17 Nov 2000"
Module_ApplicationDate2 SETS "17-Nov-00"
Module_ApplicationDate4 SETS "17-Nov-2000"
Module_Date SETS "18 Sep 2002"
Module_ApplicationDate2 SETS "18-Sep-02"
Module_ApplicationDate4 SETS "18-Sep-2002"
Module_ComponentName SETS "ADFS"
Module_ComponentPath SETS "RiscOS/Sources/FileSys/ADFS/ADFS"
Module_FullVersion SETS "3.33"
Module_HelpVersion SETS "3.33 (17 Nov 2000)"
Module_HelpVersion SETS "3.33 (18 Sep 2002)"
END
/* (3.33)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.68.
*
*/
#define Module_MajorVersion_CMHG 3.33
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 17 Nov 2000
#define Module_Date_CMHG 18 Sep 2002
#define Module_MajorVersion "3.33"
#define Module_Version 333
#define Module_MinorVersion ""
#define Module_Date "17 Nov 2000"
#define Module_Date "18 Sep 2002"
#define Module_ApplicationDate2 "17-Nov-00"
#define Module_ApplicationDate4 "17-Nov-2000"
#define Module_ApplicationDate2 "18-Sep-02"
#define Module_ApplicationDate4 "18-Sep-2002"
#define Module_ComponentName "ADFS"
#define Module_ComponentPath "RiscOS/Sources/FileSys/ADFS/ADFS"
#define Module_FullVersion "3.33"
#define Module_HelpVersion "3.33 (17 Nov 2000)"
#define Module_HelpVersion "3.33 (18 Sep 2002)"
#define Module_LibraryVersionInfo "3:33"
......@@ -19,6 +19,8 @@
StrongARM SETL {TRUE}
ARM810support SETL {FALSE}
AREA |!!!Module|,CODE,READONLY,PIC
GET Ver.<Machine>
GET s.Fixes
GET DevVersion
......@@ -46,6 +48,9 @@ ARM810support SETL {FALSE}
GET Hdr:Portable
GET Hdr:Proc
GET Hdr:CPU.ARM600
GET Hdr:HALEntries
GET Hdr:PCI
GET Hdr:Podule
GET s.NewBits
GET s.ADFSMacros
......@@ -55,13 +60,11 @@ ARM810support SETL {FALSE}
GET s.ADFSErrors
GET s.ADFS00
GET s.ADFS05
GBLS GRBA
[ MEMC1A
GRBA SETS "MEMC1ABits"
|
GRBA SETS "MEMC1Bits"
]
GET s.$GRBA
GET s.Adfs11
GET s.ADFS12
GET s.ADFS13
GET s.ADFS14
GET s.IDEDetect
GET s.ADFS15
GET s.ADFS17
GET s.ADFS18
......
......@@ -166,11 +166,7 @@ NewFloppyRootDiscAdd * &800 ;physical disc add
]
;old adfs format
[ FDC1772
= OldDirFlag :OR: OldMapFlag
|
= OldDirFlag :OR: OldMapFlag :OR: Double
]
= "L"
= (42+0)/2
= (42+0)/2
......@@ -190,11 +186,7 @@ WinnieTestDiscRec ;can use to read winnie defect map as 256 byte sectors
& 160*16*&100 ;disc size
;intermediate D format
[ FDC1772
= OldMapFlag
|
= OldMapFlag :OR: Double
]
= "D"
= (32+271)/2
= (32+0)/2
......@@ -218,11 +210,7 @@ FloppyTestDiscRec ;this record is also used when identifying floppies
[ NewFs
;new E format
[ FDC1772
= 0
|
= Double
]
= "E"
= (32+271)/2
= (32+0)/2
......@@ -250,63 +238,6 @@ Espare * (&400*8)-(800*8)-Zone0Bits ;total zone bits - used map bits
& NewMapRoot
& 160*5*&400 ;disc size
[ FDC1772
|
;new QD format
= Quad
= "Q"
= (64+0)/2
= (64+0)/2
= 122
= 1
= 0,0
= 10 ;sector size 2^10=1K
= 10 ;sectors per track
= 2 ;heads=2 => side interleave
= 4 ;density 4
= 15 ;next bits
= 8 ;2^8 bytes each map bit
= 1 ;RA skew
= 0 ;boot opt
Qspare * (&400*8)-(1600*4)-Zone0Bits ;total zone bits - used map bits
= 0
= 1 ;1 zone
= Qspare :AND: &00FF
= ( Qspare :AND: &FF00 ) :SHR: 8
& NewMapRoot
& 160*10*&400 ;disc size
]
|
[ FDC1772
|
;new QD format
= Quad
= "Q"
= (64+0)/2
= (64+0)/2
= 122
= 1
= 0,0
= 10 ;sector size 2^10=1K
= 10 ;sectors per track
= 2 ;heads=2 => side interleave
= 4 ;density 4
& 0
& 0
& D_Root
& 160*10*&400 ;disc size
]
]
ASSERT (.-FloppyStrucs) :MOD: (SzFormHdr+DiscStruc) = 0
......@@ -416,11 +347,7 @@ Result # 4
FdcOp # 1
DestTrack # 1
Head # 1
[ FDC1772
# 1 ;MUST BE UNUSED SINCE ALL 4 WRITTEN AT ONCE
|
SettleMask # 1 ;1793 only
]
DiscAdd # 4
RamStart # 4 ;Start address in RAM
......@@ -536,13 +463,21 @@ SzDefGlobals * {PC}-DefGlobals
message_file_block a4 16
[ :LNOT:BigDisc
WinnieSizes a4 4
]
FileCorePrivate a4 4
[ FileCache
FloppyCallAfter a4 4
WinnieCallAfter a4 4
FiqRelease a4 4
]
[ HAL
HAL_IRQEnable_routine a4 8
HAL_IRQDisable_routine a4 8
HAL_IRQStatus_routine a4 8
HAL_CounterDelay_routine a4 8
]
;Low level workspace
......@@ -560,77 +495,21 @@ FiqCtr # 1 ;# threads using fiq work space
StartSector # 1
Sector # 1
[ MEMC1A
MEMCflag # 1
|
# 1
]
GET s.StaticsFDC
WorkSizeNoWinnies a4 0
WinnieWork # 0
WinnieHardware # 0
DefaultWinnieHardware
HDCPtr # 4
[ MEMC1A
dataRead * 8
]
DefaultHDC * &32D0000
& DefaultHDC
PollPtr # 4
& IoChip+IoIrqBStatus
PollBits # 4
& WinnieBits
InterruptPtr # 4
& IoChip+IoIrqBMask
InterruptBits # 4
& WinnieBits
command # 1 ; the command we did
WinIRQ # 1
WBlock # 1
WHead # 1
parameters # 16 ; parameter block
parms # 0
opCode # 4 ; R1 - reason code etc
discAddress # 4 ; R2 - in bytes
WRemains # 4 ; R4 - master amount to xfer
WScatter # 4
WriteAdjust # 4
WDefectList # 4 ; R6
WDiscSize # 4
ContigEnd # 4
WScatterRam # 4
WScatterLen # 4
RestoreCount # 1
WSecsPerTrk # 1
WHeads # 1
WZones # 1
RestoreEndTime # 4
WRetry # 1
NextHead # 1
completion # 1
HeadSelBit3Copy # 1
[ MEMC1A
[ :LNOT:NewTransferCode
RomReturn # 4
]
Resume # 4
Cylinder # 4
WLength # 4
dsI # 4 ; for defect skipping
GET s.StaticsIDE
[ NewTransferCode
AWorkSize # 0
|
; Ensure that winnie critical transfer code starts at 0 mod 16
; remembering that workspace starts at 4 MOD 16
......@@ -639,6 +518,7 @@ dsI # 4 ; for defect skipping
WEND
LowCodeLocation # 0 ;MUST BE LAST, USED FOR TIME CRITICAL CODE
]
ALIGN
LTORG
......
......@@ -53,7 +53,7 @@ $GetAroundBleedingAAsmYetAgain
[ Dev
[ Debug
; Set to true for debugging through the tube
Host_Debug SETL T
Host_Debug SETL F
; Set to true to robustify debugging in IRQ mode
Debug_MaybeIRQ SETL T
......@@ -86,17 +86,25 @@ $Host_Inclusion
[ Dev
PHEX
SavePSR R4
[ :LNOT: IrqDebug
MOV R3, #IRQsema
LDR R3, [R3]
TEQS R3, #0
MOVNES PC, LR ;return if IRQ thread
BNE PHEXIT1
]
MOV R3, LR
[ No32bitCode
ASSERT SVC_mode=3
ORR R0, LR, #SVC_mode
ORR R0, LR, #SVC_mode :OR: I_bit
TEQP PC, R0 ;go to SVC mode preserving flags
nop
NOP
|
MRS R0, CPSR
ORR R0, R0, #SVC26_mode :OR: I32_bit
MSR CPSR_c, R0
]
Push "LR"
[ SpoolOff
BL SpoolOff
......@@ -117,29 +125,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
......@@ -148,9 +164,14 @@ 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
NOP ;delay for mode change
|
ORR LR, LR, #SVC26_mode :OR: Z_bit
MSR CPSR_cf, LR
]
Push "LR"
[ SpoolOff
BL SpoolOff
......@@ -158,6 +179,7 @@ Mess1 ;R0,R1,LR stacked
MOV PC, R1
TubeWrHexWord ROUT
SavePSR R4
MOV R3, LR
MOV R1, #32-4
05
......@@ -171,6 +193,7 @@ TubeWrHexWord ROUT
BPL %BT05
MOV R0, #" "
BL TubeChar ;(R0)
RestPSR R4,,f
MOVS PC, R3
^ 0, R1
......@@ -179,14 +202,16 @@ R1_data # 4
TubeAddress * &3340000 + (0*&4000) ;podule 0
TubeChar ROUT
Push "R1,LR"
Push "R1,R2,LR"
SavePSR R2
LDR R1, =TubeAddress
10
LDRB LR, R1_status
TSTS LR, #&40
BEQ %BT10
STRB R0, R1_data
Pull "R1,PC",,^
RestPSR R2,,f
Pull "R1,R2,PC"
]
; ======
......@@ -194,14 +219,26 @@ TubeChar ROUT
; ======
ClearV
[ No32bitCode
BICS PC, LR, #V_bit
|
Push "LR"
CLRPSR V_bit, LR
Pull "PC"
]
; ====
; SetV
; ====
SetV