Trailing-Edge
-
PDP-10 Archives
-
BB-X140B-BB_1986
-
10,7/703mon/konpar.mac
There are 5 other files named konpar.mac in the archive. Click here to see a list.
;TITLE KONPAR - DEVICE INDEPENDENT PARAMS FOR EACH TYPE OF KONTROLLER ROUTINE V045
SUBTTL 10 SEP 85
;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
; OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
;
;COPYRIGHT (c) 1972,1973,1974,1975,1976,1977,1978,1979,1980,1982,1984,1986
;BY DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
;ALL RIGHTS RESERVED.
;
;
;
;
;DEFINITION OF STANDARD INTERFACE BETWEEN DEPENDENT AND INDEPENDENT ROUTINES
;THIS FILE IS INCLUDED IN BEGINNING OF EVERY KONTROLLER SERVICE ROUTINE
;(AFTER S.MAC)
SEARCH F,S
;THE INTERFACE CAN BE CONSIDERED AS AN INTERFACE TO AN IDEAL DEVICE.
; IT IS THE JOB OF EACH DEVICE DEPENDENT ROUTINE TO MEET THE
; REQUIREMENTS OF THE IDEAL DEVICE.
REPEAT 0,<
DESCRIPTION FOR THE IDEAL KONTROLLER: (CLOSE TO RP10)
ONE OR MORE INDEPENDENT AND SIMULTANEOUS POSITIONERS
ONE DATA TRANSFER AT A TIME
KONTROLLER WILL ACCEPT POSITION COMMANDS ANY TIME EXCEPT DURING A DATA TRANSFER
KONTROLLER WILL INTERRUPT WHENEVER ONE OR MORE POSITIONINGS COMPLETES
(EXCEPT DURING A DATA TRANSFER IN WHICH CASE FLAGS FOR EACH
POSITIONER WHICH FINISHED WILL BE SET WHEN DATA TRANSFER DONE
INTERRUPT OCCURS). THE POSITION FLAGS ARE ON ONLY ON INTERRUPT,
RATHER THAN REMAINING ON AS LONG AS THE POSITIONER IS IN POSITION.
KONTROLLER WILL RETURN THE LAST FUNCTION WHICH IT RECEIVED SO THAT IT
IS POSSIBLE TO DETERMINE THE REASON FOR THE INTERRUPT (I.E.,
POSITIONING OR DATA).
KONTROLLER AUTOMATICALLY POSITIONS TO NEXT CYLINDER FOR A MULTIPLE
BLOCK COMMAND LIST WHICH CROSSES FROM ONE CLYINDER TO NEXT.
PROVIDED THERE WERE NO ERRORS SO FAR, ELSE IT WILL TERMINATE
>
;PROGRAMMING REQUISITES FOR DEVICE DEPENDENT ROUTINES
; A. NOT KNOW ABOUT FILE STRUCTURES
; B. BE AS SIMPLE AS POSSIBLE
; C. ISSUE ALL IO INSTRUCTIONS
; D. WHENEVER POSSIBLE DO NOT DEPEND ON HARDWARE STATUS INFO.
;THE FOLLOWING ARGUMENTS ARE PASSED TO DEVICE DEPENDENT ROUTINES
EXTERN KONCUA,UNYPUN,KONIOC,KONINT,UNYBPT,UNYBPY,UNICYL,UNIBLK,KOYPI,UNYUTP
EXTERN UNPUTP,UNIUTP
; 1. ADDRESS OF UNIT DATA BLOCK [AC U AND C(KONCUA(J))]
; 1.1 LOGICAL BLOCK NO. WITHIN UNIT [C(UNIBLK(U))]
; 1.2 PHYSICAL UNIT NO. WITHIN KONTROLLER [BYTE PTR=UNYPUN]
; 2. ADDRESS OF KONTROLLER DATA BLOCK [AC J]
; 2.1 LOWER CORE ADDRESS OF CHANNEL WORD PAIR FOR THIS
; KONTROLLER [C(KONIOC(J))]
; 2.2 ADDRESS OF CHANNEL COMMAND LIST [RH OF C(C(KONIOC(J))),
; LH C(C(KONIOC(J)))=0]
;NOTE - DEPENDENT ROUTINE MAY CHANGE C(C(KONIOC(J))) AND C(UNIBLK) BEFORE
; DATA TRANSFER IS THRU. IF DATA MUST BE TRANSFERRED PAST END OF CYLINDER.
; THEN ERROR RETRIES WILL START FROM BEG. OF BAD CYLINDER RATHER THAN START OVER.
;NOTE - KONTROLLER ROUTINES MUST NOT ADVANCE PAST AN END OF CYLINDER
; IF THERE ARE ANY ERRORS ON THE FIRST PIECE. IN THIS WAY THE FILSER
; ERROR RETRY LOGIC NEED NEVER REPOSITION ON AN ERROR RETRY.
; 2.3 CHANNEL COMMAND LIST IN FREE CORE
; 2.4 THE CONSO INTR. FOR THIS KONTROLLER [C(KONINT(J))]
;THE FOLLOWING CONSTANTS ARE AVAILABLE TO DEVICE DEPENDENT ROUTINES:
; 1. NUMBER OF BLOCKS PER CYLINDER (BYTE = UNYBPY)(U MUST STILL BE SETUP)
; 2. PI ASSIGNMENT FOR KONTROLLER (BYTE = KOYPI)(J MUST STILL BE SETUP)
; 3. NUMBER OF BLOCKS PER TRACK (BYTE = UNYBPT)(U MUST STILL BE SETUP)
;THE FOLLOWING LOCATIONS ARE CHANGED BY DEVICE DEPENDENT ROUTINES.
; 1. CURRENT CYLINDER POSITIONED AT OR SEEKING TOWARDS
; [C(UNICYL(U))] ON CALLS TO KONPOS(J) AND END OF CYLINDER.
; 2. CURRENT LOGICAL BLOCK NUMBER BEING READ OR WRITTEN
; [C(UNIBLK(U))] (CHANGED ONLY IF END OF CYLINDER ENCOUNTERED).
; 3. SOFT POSITIONING ERRORS [RH(UNIPCT(U))], FILSER DOES NOT GET CONTROL
; 4. HARD POSITIONING ERRORS [LH(UNIPCT(U))], T2 INDICATES DEVICE ERROR
;ALL TEMPORARY LOCATIONS IN DEVICE DEPENDENT ROUTINES ARE INDEXED BY J
; THE KONTROLLER DATA BLOCK CONTAINS ALL IO
; INSTRUCTIONS FOR THE KONTROLLER. IN THIS WAY THE SAME
; DEVICE DEPENDENT CODE WILL WORK FOR MORE THAN ONE
; KONTROLLER OF THE SAME TYPE. (ONLY THE CONTENTS OF J
; AND THE DEVICE CODE IN THE KONTROLLER DATA BLOCK WILL DIFFER
; FOR EACH KONTROLLER OF SAME TYPE).
; THE FOLLOWING CALLS ARE PROVIDED FOR EACH KONTROLLER TYPE
; WHERE XX STANDS FOR KONTROLLER TYPE (DP,FH,DR,MD)
;XX'XRED - READ FROM UNIT U STARTING WITH LOGICAL BLOCK WITHIN UNIT C(UNIBLK(U))
;XX'XWRT - WRITE ON UNIT U STARTING WITH LOGICAL BLOCK WITHIN UNIT C(UNIBLK(U))
; USING CHANNEL COMMAND LIST AT C(KONIOC(J)) AND DO NOT STOP ON ERRORS
;XX'XWTF - WRITE FORMAT (HEADERS)
;ONLY IF FTDSUP FEATURE TEST IS ON
;XX'XRDS - SAME AS XX'XRED EXCEPT STOP ON ERRORS (USED FOR ERROR MARKING)
;XX'XWTS - SAME AS XX'XWRT EXCEPT STOP ON ERRORS (USED FOR ERROR MARKING)
;XX'XPOS - POSITION ARM ON UNIT U
;C(KONIOC(J)) NOT SETUP ON CALL
;XX'XLTM - RETURN LATENCY TIME IN MICROSECONDS TO BEGINNING OF TRANSFER OF
; LOGICAL BLOCK WITHIN UNIT C(UNIBLK(U)).
; C(KONIOC(J)) NOT SETUP ON CALL. NOTE AC T1 ALSO SET TO C(UNIBLK(U))
;XX'XUPA - CHECK TO SEE IF KONTROLLER IS ON-LINE(WITHOUT READING OR WRITING)
; SKIP RETURN IF YES, NON SKIP IF NOT
; CALLED EVERY TIME MONITOR IS STARTED
;XX'XCPY - CHECK CAPACITY & STATE OF UNIT U. RETURNS WITH:-
;UNISER(U) = DRIVE SERIAL NUMBER (2 WORDS)
;T1= NUMBER OF BLOCKS PER UNIT (REGULAR)
;T2= NUMBER OF BLOCKS PER UNIT INCL. MAINT. CYLS
;T3= NUMBER OF BLOCKS PER UNIT IN COMPAT. MODE
;RH(T4)= UNIT TYPE
;LH T4 = 0 IF OK, SIGN BIT = 1 IF ANY ERROR (KOPUHE)
;BIT 1 = 1 IF UNIT DOES NOT EXIST (KOPNSU) SO NO ASK OFF-LINE QUESTION
;W= BLKS PER TRACK,,BLKS PER CYLINDER
; SKIP RETURN IF UNIT ON-LINE - NON SKIP IF OFF-LINE
;XX'XRCL - RECALIBRATE UNIT (AFTER 'DSKTRY' SOFT ERRORS)
;NON-SKIP RETURN IS DEVICE NOT OK OR DEVICE DOES NOT RECALIBRATE
;XX'XSTP - STOP UNIT, EVEN IF BUSY (USED ONLY IF HUNG)
;NON-SKIP RETURN - IF BUSY CANNOT BE TURNED OFF. NO VALUE RETURNED
;SKIP RETURN T2=CONI STATUS BEFORE BEING RESET
; T3=DATAI STATUS BEFORE BEING RESET
;XX'XECC - NON-SKIP IF NO ECC AVAILABLE (HDWRE ERROR, NOT CALLED UNLESS IOECCX=1)
;RETURNS T1=RELATIVE POSITION OF THE ERROR IN THE SECTOR
;RETURNS T2,T3= XOR MASK FOR ERROR CORRECTION (NOTE FUNNY WAY MASK IS APPLIED)
;XX'XERR - CALLED WITH T1=RETRY NUMBER. ALWAYS RETURNS CPOPJ
;RETURNS T1=0 FOR A STRAIGHT RETRY
;RETURNS T1=1 OFFSET IS IN PROGRESS (ATTN INTERRUPT WHEN DONE)
;RETURNS T1=2 TRY LAST TIME (DISABLE STOP ON ERROR
;RETURNS T1=3 GIVE UP (HARD ERROR)
;RETURNS T1=4 RECALIBRATE THE DRIVE
;XX'XALV - ENSURE THAT THE KONTROLLER HAS A PIA, IVI SET UP
;ALWAYS RETURNS CPOPJ
;XX'XREG - READ MASSBUS REGISTERS
;CALLED AT CLOCK LEVEL, DEVICE WILL INTERRUPT BEFORE RETURN
;ALL ROUTINES GIVE SKIP RETURN IF OK (IO INSTRUCTIONS GIVEN AND ACCEPTED
;BY KONTROLLER). NO SKIP RETURN IF COULD NOT ISSUE IO INSTRUCTIONS
;(OFF-LINE, WRITE LOCKED, NON-EXISTANT, BUSY)
;ON NON-SKIP RETURN, BITS 18-21 OF T1 MAY CONTAIN ERROR BITS
; FOR FILSER (KOPOFL ETC.) THESE BITS ARE DEFINED IN COMMON
; SINCE FILSER ALSO NEEDS THEM
;CALL: MOVEI U, ADR. OF UNIT DATA BLOCK
; MOVE J,UNIKON(U) ;SETUP ADDRESS KONTROLLER DATA BLOCK
; PUSHJ P,@KONYYY(J) ;CALL KONTROLLER ROUTINE
; ERROR RETURN
; OK RETURN
REPEAT 0,<
WHEN AN INTERRUPT OCCURS, THE DEVICE DEPENDENT MODULE PASSES THE FOLLOWING
INFORMATION TO THE DEVICE INDEPENDENT MODULE(FILINT):
A. FUNCTION WHICH CAUSED INTERRUPT
(OPRED,OPWRT,OPRDS,OPWTS,OPPOS,OPCAL,BITS 33-35 OF T1)
FOR FILINT CALL:
B. POSITIONERS WHICH JUST POSITIONED, IF ANY (BITS 0-7 OF T1 FOR UNITS 0-7)
C. UNIT LAST CONNECTED TO KONTROLLER FOR POSITION OR TRANSFER
COMMAND (BITS 15-17 OF T1)
END OF FOR FILINT CALL
FOR FLHTID CALL:
B. POSITIONERS WHICH JUST POSITIONED, IF ANY (BITS 0-23 OF T4 FOR UNITS 0-27)
C. UNIT LAST CONNECTED TO KONTROLLER FOR POSITION OR TRANSFER
COMMAND (BITS 12-17 OF T1)
END OF FOR FLHTID CALL
D. GENERALIZED ERROR FLAGS IF ANY
BITS 18-23 OF AC T1 PASS BACK GENERALIZED ERRORS:
IOIMPM - IMPROPER MODE
IODERR - DEVICE ERROR
IODTER - DATA ERROR
IOBKTL - BLOCK TOO LARGE
IOCHNX - CHANNEL NON-EX MEM - NEVER STORED IN DDB (DEVIOS TOO FULL)
IOCHMP - CHANNEL PARITY ERROR - NEVER STORED IN DDB (DEVIOS TOO FULL)
IOVRUN - OVERRUN OCCURRED
IOHDER - HEADER COMPARE OR SEARCH ERROR
IOECCX - CORRECTABLE ECC ERROR OCCURRED
FILSER WILL CALL XX'XECC TO GET MASK, POSITION
IF 3 ERRORS IN A ROW, FILINT WILL ALSO STORE T2 IN
TO UNIERR(U), SO THAT A RECORD OF HARD ERRORS IS ALSO KEPT.
IF NO ERRORS T2 IS IRRELEVENT.
ON ANY ERROR MASSBUS DEVICES WILL STORE THE C(KONREG) DRIVE REGISTERS
IN KONEBK THROUGH KONEBK+N-1. THEY WILL STORE THE LAST DATAO FOR THE
DRIVE IN UNILAS
E. ADDRESS OF THE KONTROLLER DATA BLOCK IN AC J.
F. NOTE AC U IS NOT SETUP
G. SPECIFIC KONTROLLER DATA WORD (CONI) IN AC T2
H. SPECIFIC KONTROLLER DATA WORD (DATAI) IN AC T3
CALL: MOVEI J,ADDRESS OF KONTROLLER
MOVE T1,POSITIONED UNITS,LAST UNIT,ERROR FLAGS,FUNCTION
MOVE T2,CONI STATUS
MOVE T3,DATAI HARDWARE STATUS
PUSHJ P,FILINT ;FILINT MAY PUSHJ BACK TO XX'XRED,XX'XWRT,XX'XPOS
; ETC. IN THIS OR ANY OTHER DEVICE DEPENDENT MODULE
ALWAYS RETURN HERE FROM FILSER
>
EXTERN FILINT ;ENTRY ON ALL INTERRUPTS INTO FILSER
INTERN OPRED,OPWRT,OPPOS,OPCLR,OPCAL
EXTERN KOPUHE,KOPNSU ;ERROR VALUES FOR KONCPY ROUTINE
;OPERATIONS BITS 33-35 OF T1:
OPRED==0 ;READ
OPWRT==1 ;WRITE
OPWTF==3 ;FORMAT
OPPOS==4 ;POSITION
OPCLR==5 ;CLEAR
OPSEL==6 ;SELECT
OPCAL==7 ;RECALIBRATE
EXTERN KONERM,KOPOFL,KOPFUS
;EXTRA BITS IN DPXFNC
FNCRCL==20 ;FREE RECALIBRATE
FNCPOS==10 ;FREE POSITION
FNCHNG==100 ;HUNG RECOVERY