IMD 1.17: 11/11/2014 16:18:11 82VKXBVERDOS C* VERSADOS/RMS68K OBJECT 4.4 SN=44880 PHE8520 This is BT19 from another copy of v4.4 object 19 of 22  BT19\82VKXBVERDOS 0420¿5-‚TIMEFLAG(A5)‚in�FINDDENS#*’(should�have�been�offset�from�A5)%*ˆ4/4/84„New�board�with�enhancements:4*’(1)�Can�disable�and�enable�interrupts�at�the�board+*–level�by�writing�into�the�DSCMD�register.***–Use�new�macros,�ENABLMTA�and�INHIBMTA�to'*–turn�the�board�interrupt�on�in�INTRTN0*–and�to�turn�the�board�interrupt�off�when�about*–to�give�a�command.*1*–Replace�INHIB�which�masks�all�interrupts�at�the1*–whole�interrupt�level�with�INHIBMTA,�which�only"*–affects�interrupts�at�the�board.*4*–The�only�exception�is�when�we�are�messing�with�the-*–IOQUEUE�in�the�command�handler�and�MTADONE.*–Why�is�that,�you�ask?3*–I�hope�to�find�out�why�the�SASI�does�it�this�way.*6*’(2)�After�reading�a�hard�error,�a�read�of�the�status2*–register�will�clear�the�interrupt�so�there�is�no*–need�to�stop�the�tape.1*–For�testing�purposes,�for�now,�if�the�interrupt1*–does�not�go�away,�in�one�read,�we�will�stop�the*–tape�as�before.*4*’(3)�An�interrupt�is�generated�when�DNBSY�gets�set.1*–Bit�1�in�the�STAT2�register�can�now�mean�one�of'*–3�things:�DNBSY,FNBSY,�and�file�mark.>(40089@=HpPMX9`8hGp;x=€;ˆF�A˜B 7¨?°9¸9À9ÈdÐIØBà:èAðAø?Y@ 1*–For�a�DNBSY�we�just�continue�as�if�no�interrupt*–of�that�type�were�received.**ˆ4/12/84ƒBug�fix:4*’A1�was�not�getting�set�up�properly�for�a�branch�to*’PROCQUE�from�MTADONE.6*’Now�we�put�the�address�of�the�drive's�variable�block*’into�A1�before�we�branch.*.*’End�of�tape�handling�was�not�right�in�MTINT.*’Eliminated�a�BRA‚MTINT3.*.*’Check�for�end�of�tape�on�forward�command�and6*’beginning�of�tape�on�reversa�command�was�not�correct*’in�PROCQUE�(STAT1�vs.�STAT2)*A*ˆ5/4/84„Sometimes�when�a�blank�tape�is�mounted�on�the�transport,2*’we�decide�erroneously�that�the�transport�density *’cannot�be�changed�in�software.3*’Don't�know�at�this�point�why�this�seems�to�occur,/*’possibly�something�to�do�with�the�transport�?.*’Anyway,�don't�want�to�lock�out�the�user�from0*’selecting�a�transport�density�for�a�write�from.*’loadpoint,�so�change�the�logic�in�SELECT2�to*’ignore�the�CNGDENS�flag.*4*’Use�BRanch�short�wherever�possible�and�add�a�patch*’area�at�the�end.*8*ˆ4/7/84„Replace�SELECT2�calls�with�SELECT�calls.‚Modify *’SELECT.*5*ˆ5/22/84ƒRewrite�the�DOWRITE�routine�using�WHILE-DO.2*’Add�a�periodic�activation�call�to�timeout�in�the5*’driver�if�DOREAD�takes�too�long.‚We�do�this�because6*’IOS�sends�us�a�timeout�for�the�IOSRTO�value�and�this9*’must�make�do�for�not�only�read,�but�rewind,�search,�and:*’everything�but�write.�We�want�a�short�read�timeout�but�a1*’long�rewind�timeout�so�we�must�do�it�ourselves.4*’This�requires�changes�to�the�9995..IOE.EQ�file�and*’a�new�sysgen�to�test.*<*ˆ6/15/84ƒIf�user�asks�for�a�timeout�with�a�0�interval,�just*’treat�as�no�timeout.:*’After�a�command�has�completed,�inhibit�interrupts�at�the8*’board�and�enable�interrupts�at�the�system�level�(lower0*’mask�by�1)�so�that�we�don't�tie�up�the�system.*<*ˆ9/18/84ƒFound�a�problem�while�testing�on�VM03.‚Continually3*’getting�timed�out�during�reads.‚Timing�dependent.3*’The�problem�was�I�was�reading�STAT1�a�second�time4*’in�the�interrupt�service�routine,�and�there�was�an<*’interrupt�pending�that�got�cleared�but�was�never�serviced.*5*’It�is�possible�for�the�following�sequence�to�occur:8*’HALFFULL�interrupt�occurs,�Read�STAT2,‚FNBSY�interrupt4*’occurs,�read�STAT1.‚In�this�case�we�will�not�get�a*’FNBSY�interrupt.8*’Therefore�when�it�is�time�to�check�for�FNBSY,�read�the6*’bit�4�in�STAT1�to�decide�if�it�is�a�FNBSY�instead�of*’the�bit�1�in�STAT2.*’Changes�made�in�MTINT.*;*ˆ12/04/84‚On�tape�drives�running�at�100�ips�on�the�VME/10,5*’the�READ2K�routine�was�not�getting�bytes�out�of�the0*’FIFO�fast�enough.‚Speeded�up�the�primary�loop.1*’This�reduced�the�time�between�4�byte�reads�from4*’25.6�micro�seconds�to�about�11�microseconds,�which*’did�the�trick.*7*’On�tape�drives�that�do�not�conform�to�the�PERTEC�spec6*’for�which�the�MVME435�board�was�designed,�reading�in,*’direct�mode�corrupted�bytes�on�the�VME/10.4*’As�a�work�around,�the�driver�now�reads�in�buffered4*’mode�when�the�user�specifies�a�buffer�size�of�40962*’bytes�or�less.‚I'm�not�sure�why,�but�on�the�tape4*’drives�I�used�for�testing,�there�will�be�more�than6*’4096�bytes�read�from�the�MVME435�when�the�tape�block7*’size�is�larger�than�4096,�even�when�we�are�reading�in-*’buffered�mode.‚This�is�a�good�feature,�as�a2*’buffer�overflow�message�will�alert�the�user�that6*’the�block�size�on�the�tape�is�indeed�larger�than�his;*’4096�byte�buffer.�But�mostly�we�expect�the�user�knows�the%*’size�of�the�tape�blocks�being�read.*=*ˆ12/7/84ƒWhen�a�user�asks�for�0�read�tries�or�0�write�tries,&*’the�driver�should�change�the�0�to�1.9*’That�was�not�being�done�in�the�right�place�in�CONFGCOM.*I**************************************************************************(*ˆMODULES�CALLED�IN�THE�MAG�TAPE�DRIVER:*H*--------------------ƒINITIALIZATIONƒ-----------------------------------*<*�INITIAL‚EQU‡*‡Initializes�the�device�dependent�part�of�CCB$*œInitializes�MVME435�and�tape�drive*K*--------------------------------------------------------------------------* H*--------------------ƒCOMMAND�SERVICE‚----------------------------------**6*�COMMANDS�EQU‡*‡Dispatches�commands�received�from�CMR**�STATCMD‚EQU‡*‡Status�command.*�STATCONF�EQU‡*‡Updates�first�4�bytes�of�IOCB!*�DFCONFG‚EQU‡*‡Default�configure*�CONFG„EQU‡*‡Configure�command5*�CONFGCOM�EQU‡*‡Executes�common�configuration�chores**?*�CONERROR�EQU‡*‡Error�exit�for�configure�and�default�configure*1*�RDWRTCMD�EQU‡*‡Entry�for�read�and�write�command@*�COMMCMD‚EQU‡*‡Entry�for�I/O�commands�other�than�read,write,�or*œconfigure�&�mount2*�CONFG2ƒEQU‡*‡Entry�point�for�configure�and�mount *�HALTCMD‚EQU‡*‡Halt�I/O�command2*�LOGPHYƒEQU‡*‡Convert�logical�to�physical�address***�HALTEXIT�EQU‡*‡Exit�for�halt�I/O�command$*�CMDEXIT‚EQU‡*‡Commands�common�exit;*�CMDEXIT1“Entry�point�for�commands�completed�without�error>*�CMDEXIT2�EQU‡*‡Entry�point�for�commands�completed�with�error9*�CMDEXIT3�EQU‡*‡Entry�point�for�commands�to�be�completed*œunder�interrupt�control*%*�QEVENTT”Queues�I/O�completion�event* *�EXECREQ‚EQU‡*‡Does�trap�0�call *�KILL_IT‚EQU‡*‡Kills�the�system*&*�CMDSWIT‚EQU‡*‡Table�used�in�COMMANDS'*�CONFGLEN�EQU‡*‡Table�used�in�CONFGCOM*K*--------------------------------------------------------------------------*F*-------------------„INTERRUPT�SERVICEƒ-------------------------------*%*�INTERUPT�EQU‡*‡Interprets�interrupt+*�MTINT„EQU‡*‡Dispatches�mag�tape�interrupt***�PROCQUE‚EQU‡*‡Processes�next�queue�entry'*�SELECTƒEQU‡*‡Selects�proper�transport-*œRe-selects�transport�with�requested�density*œfor�write�from�loadpoint**�DOWRITE‚EQU‡*‡Write�to�tape<*�WRITE2K”Transfer�2K�bytes�from�FIFO�to�memory(direct�mode)3*�WRITDATA�EQU‡*‡Transfer�bytes�from�FIFO�to�memory*>*�DOCONFG‚EQU‡*‡Do�the�configure�and�mount�(interrupt�control)&*�FINDDENS�EQU‡*‡Find�the�tape�density1*�SET_TIME“Do�trap�0�call�for�periodic�activation*œduring�FINDDENS�command.2*�WAKEUP•Routine�that�is�activated�during�periodic'*œactivation�wakeup�call�from�FINDDENS.;*�WAKEUP2”Routine�for�wakeup�calls�from�DOREAD,SPACE,�ERASE*œSEARCH,�and�DOREWIND*+*�DORDFWD‚EQU‡*‡Do�the�read�forward�command.*�READ2K•Transfer�2K�bytes�from�FIFO�to�memory*ž(direct�mode)3*�READDATA�EQU‡*‡Transfer�bytes�from‚FIFO�to�memory+*žbuffered�mode/end�of�block�in�direct�mode*;*�STOPTAPE“After�reset�formatter�command,�wait�for�the�tape2*žto�stop,�clear�the�formatter�not�busy�interrupt.**&*�DOREWIND�EQU‡*‡Do�the�rewind�command*;*�DOSFMFWD�EQU‡*‡Do�the�search�forward�for�filemark�command;*�DOSFMREV�EQU‡*‡Do�the�search�reverse�for�filemark�command+*�SEARCH•Common�routine�for�search�filemark*,*�DOSPFWD�EQU‡*ˆDo�the�space�forward�command,*�DOSPREV�EQU‡*ˆDo�the�space�reverse�command2*�SPACE–Common�routine�for�space�forward�&�reverse*-*�DOWRTFM‚EQU‡*‡Do�the�write�filemark�command$*�DOERASE‚EQU‡*‡Do�the�erase�command:*�FM_ERAS_COMM�Common�routine�for�erase�and�write�filemark*;*�MTADONE‚EQU‡*‡Complete�command�processing�under�interrupt *œcontrol%*�QEVENTI”Queues�I/O�completion�event*3*�CKRDY–See�if�the�transport�is�ready.�If�not�ready,*œimmediately,�delay�for�a�while�until�it�is*œor�we�have�run�out�of�time.*#*�IDLELOOP�EQU‡*‡Wait�for�a�command*%*�OPTABLE‚EQU‡*‡Table�used�in�PROCQUE*�TRTABLE”Table�used�in�SELECT*I*------------------------------------------------------------------------F**********************************************************************‰PAGEI***************************************************************************ˆMAGTAPE.MACROS.SA*J*************************************************************************** *ˆMacros�for�the�mag�tape�driver*J******************************************************************************A*<<<<<<<<<<<<<<<<<< COMMENTED OUT 12/2/83 >>>>>>>>>>>>>>>>>>>>>>>*<*ˆIt�was�discovered�that�getting�ready�takes�some�transports:*ˆlonger�than�others,�so�we�needed�a�timeout�to�test�ready (*ˆafter�a�delay�of�several�milliseconds. *ˆA�subroutine�does�the�job�now.****ƒCKRDY„MACRO**?*ˆPut�the�not�ready�error�code�into�D1,�and�check�the�ready�bit=*ˆof�the�STAT1�register.‚If�the�transport�is�not�ready,�go�to *ˆMTADONE.*****†MOVE.B„#ISTANR,D1***†BTST†#READYB,STAT1(A0)***†BEQ.S‡MTADONE***†ENDM*** CKEOT„MACRO**<*ˆPut�the�end�of�volume�(end�of�tape)�error�code�into�D1�and2*ˆcheck�the�end�of�tape�bit�of�the�STAT1�register.**ˆIf�we�are�at�end�of�tape,�go�to�MTADONE.**‰MOVE.B„#ISTAEOV,D1‰BTST†#EOTB,STAT1(A0)‰BNE.L…MTADONE‰ENDM*** INHIB„MACRO**"*ˆInhibit�interrupts�at�our�level.**‰MOVE.W„CCBISR(A5),SR‰ENDM7*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% *ˆbwn‡4/4/84*INHIBMTA MACRO*"*ˆInhibit�interrupts�at�the�board.**‰MOVE.B„#DISABLCD,DSCMD(A0)‰ENDM*/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%* ENABL„MACRO**2*ˆEnable�interrupts�by�lowering�mask�by�one�level.**‰MOVE.W„CCBSR(A5),SR‰ENDM*D*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% *ˆbwn‡4/4/84*'*ˆEnable�interrupts�at�the�board�level.**ENABLMTA MACRO**‰MOVE.B„#ENABLECD,DSCMD(A0)‰ENDM**F*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%**8*ˆCheck�filemark�and�if�a�filemark�was�detected,�put�the)*ˆISTAEOF�message�in�D1�and�go�to�MTADONE** CKFM…MACRO‰MOVE.B„#ISTAEOF,D1‰TST.B…SAVEFM(A1)‰BNE.L‡MTADONE‰ENDM***8*ˆCheck�for�beginning�of�tape�and�if�so,�put�the�ISTABOV!*ˆmessage�in�D1�and�go�to�MTADONE** CKBOT„MACRO‰MOVE.B„#ISTABOV,D1‰BTST†#LDPNTB,STAT1(A0)‰BNE.L‡MTADONE‰ENDM**6*ˆCKTRDEN�macro�updates�the�current�transport�density.8*ˆIt�requires�that�A0�=�address�of�memory-mapped�IO�area-*ˆand�A1�=�address�of�drive's�variable�block.** CKTRDEN‚MACRO‰TST.B…STAT1(A0)‰IFˆ†THEN.S“MOVE.B„#XDSD800,TRANDENS(A1)‰ELSE.S“MOVE.B„#XDSD1600,TRANDENS(A1)‰ENDI‰ENDM * *ˆTRACE�macro�used�for�debuggingH*ˆIf�the�TRACE�is�'ON',�then�whenever�the�macro�TRACE�XX�is�encountered,7*ˆthe�characters�'XX'�will�be�put�into�the�trace�table.*ˆCall:ƒTRACE�R1,RTR8*�This�will�put�the�characters�'R1'�into�the�trace�table6*�that�starts�at�RTR_TABLE�and�is�indexed�by�RTR_INDEX*�and�has�length�RTR_LEN.* TRACE„MACRO‰IFEQ†TRACE-'ON'�MOVE.W…D0,-(SP)�MOVE.W…#\2_TABLE,D0�ADDƒ\2_INDEX(A5),D0�MOVE‚#'\1',(A5,D0)�ADD.W�#2,\2_INDEX(A5)"�IF„\2_INDEX(A5)‚‚#\2_LENƒTHEN“CLR„\2_INDEX(A5)�ENDI�MOVE.W…(SP)+,D0‰ENDC‰ENDM *@*ˆThe�CLR_TR�macro�is�used�to�clear�the�trace�table�of�interest.*ˆCall:�CLR_TRƒRTR3*ŽThis�clears�the�RTR„table�from�offset�0�to�offset *ŽRTR_LEN-1.* CLR_TRƒMACRO‰IFEQ†TRACE-'ON'�MOVEM.L‰D4/A3,-(SP)�LEAƒ\1_TABLE(A5),A3�FORƒD4=#1‚TO‚#\1_LENƒDO “CLR.B…(A3)+�ENDF�CLRƒ\1_INDEX(A5)�MOVEM.L‰(SP)+,D4/A3‰ENDC‰ENDM G************************************************************************Í*'*ˆFrom�the�SASI�driver�by�David�Pheanis*C*******************************************************************  2LONGWORD�MACRO›This�macro�skips�zero�or�more�bytes'*¦in�memory�(if�necessary)�to�align�the)*¦assembler's�location�counter�to�a�long-&*¦word�boundary.‚We�define�a�long-word)*¦boundary�to�be�a�location�whose�address*¦is�evenly�divisible�by�4. ,‰DS.W…0–First,�align�the�location�counter�to"*¦a�word�boundary.‚If�the�location(*¦counter�is�already�on�a�word�boundary,*¦we�don't�change�it. 0‰IFNE…*/4*4-*�If�the�location�counter�isn't�on�a-‰DS.W…1”long-word�boundary,�advance�it�by�one-‰ENDCšword�to�put�it�on�a�long-word�boundary. ‰ENDM-‰PAGEš#######################################1MOVEIAƒMACRO›This�macro�is�useful�when�we�want�to%*¦put�an�immediate�value�into�an�"*¦register.‚If�the�immediate�value"*¦happens�to�be�small�enough�to�be#*¦represented�correctly�in�a�16-bit&*¦two's-complement�number�system,�this #*¦macro�generates�a�two-word�MOVE.W)*¦instruction�knowing�that�sign�extension)*¦will�occur�at�execution�time�to�set�the'*¦entire��register�properly.‚Other-(*¦wise,�the�macro�generates�a�three-word#*¦MOVE.L�instruction.‚By�using�this'*¦macro�we�can�be�assured�of�generating'*¦the�shortest�correct�instruction,�and)*¦the�macro�will�still�function�correctly#*¦if�the�immediate�value�happens�to&*¦change�as�a�result�of�future�program$*¦modifications.‚The�MOVEIA�macro�is*¦invoked�as�follows. "*¦[