Google
 

Trailing-Edge - PDP-10 Archives - BB-J845A-SM - source/dmcdrv.p11
There are no other files named dmcdrv.p11 in the archive.
	.TITLE	DMC BOOT DRIVER
	.IDENT	/V01.01/
 
;
; COPYRIGHT (C) 1980, 1978 BY
; DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
;
;
; THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND  COPIED
; ONLY  IN  ACCORDANCE  WITH  THE  TERMS  OF  SUCH  LICENSE AND WITH THE
; INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR  ANY  OTHER
; COPIES  THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY
; OTHER PERSON.  NO TITLE TO AND OWNERSHIP OF  THE  SOFTWARE  IS  HEREBY
; TRANSFERRED.
;
; THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT  NOTICE
; AND  SHOULD  NOT  BE  CONSTRUED  AS  A COMMITMENT BY DIGITAL EQUIPMENT
; CORPORATION.
;
; DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR  RELIABILITY  OF  ITS
; SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.
;
;
; MODULE DESCRIPTION:
;
;	DMC DRIVER FOR BOOT (AND PANIC)
;
;
;
; DISTRIBUTED SYSTEMS SOFTWARE ENGINEERING
;
; IDENT HISTORY:
;
; 1.00	10-FEB-78
;	VERSION 2.0 RELEASE
;  .01	25-JAN-79  L. WEBBER	LW0001
;		WHEN CALCULATING PHYSICAL ADDRESSES, DON'T ASSUME
;		THEY ARE IN PAGE 6
;
;
;
; DEFINE THE MOP DEVICE CODE
;
	DEVTYP==12.
	
;
; LOCAL SYMBOL DEFINITIONS
;
KISAR0=172340                                                                   ;LW0001
REBOOT==173004                                                                  ;**-1
TMR::	.WORD	0			;TIMER INDICATOR FOR PANIC

;+
; **-INIDRV-DEVICE INITIALIZATION
;
; INPUTS:
;
;	R1 = CSR ADDRESS OF DEVICE
;
;	0(SP) = RETURN ADDRESS
;
;
INIDRV::	CLR	TMR
	
INIT:	BIS	#40000,(R1)	;MASTER CLEAR DMC
	MOV	#100000,(R1)	;TURN DMC ON
	MOV	#BASE,R4		;GET BASE ADDRESS
	CLR	R3		;NO HI ORDER ADDRESS BITS
	MOVB	#43,(R1)	;RQI + BASE
	JSR	PC,DMCIN	;GIVE TO DMC
	MOV	#2400,R3	;SET MOP & HALF DUPLEX
	CLR	R4		;FILLER REG
	MOVB	#41,(R1)	;RQI + CNTLI
;
;	SET PARAMETERS TO DMC
;	R4=FIRST PARM
;	R3=SECOND PARM
;
DMCIN:	TSTB	(R1)		;RDYI SET ?
	BMI	INOK		;YES
	TSTB	2(R1)		;RDYO SET ?
	BPL	DMCIN		;NO
	JSR	PC,DMCOUT	;CHECK COMPLETION
	BR	DMCIN		;AGAIN
INOK:	MOV	R4,4(R1)	;TO FIRST HALF DMC PORT
	MOV	R3,6(R1)	;TO SECOND HALF DMC PORT
	BIC	#40,(R1)	;CLEAR RQI-GIVE TO DMC
1$:	TSTB	(R1)		;RDYI CLEAR ?
	BMI	1$		;NOT YET
	CLZ			;FORCE AN ERROR RETURN CONDITION
5$:	RETURN			;RETURN TO CALLER
5
;+
; **-RCVDRV-RECEIVE A BLOCK FROM THE DEVICE
; **-SNDDRV-TRANSMIT A BLOCK ON THE DEVICE
;
; INPUTS:
;
;	R1 = CSR ADDRESS
;	R2 = MAXIMUM BLOCK LENGTH TO RECEIVE, OR
;	     BLOCK LENGTH TO TRANSMIT
;
;	0(SP) = RETURN ADDRESS
;	2(SP) = BUFFER ADDRESS
;
; OUTPUTS:
;
;	Z-BIT SET:
;	R2 = ACTUAL LENGTH OF BLOCK RECEIVED
;	(SP) = BUFFER ADDRESS
;
;	Z-BIT CLEAR:
;	AN ERROR WAS DETECTED ON THE DEVICE
;	THE STACK IS AS DESRIBED ABOVE
;-
;
	.ENABL	LSB
	
RCVDRV::MOVB	#44,(R1)	;RQI + BA/CC + RCV
	BR	10$		;
	
SNDDRV::MOVB	#40,(R1)	;RQI + BA/CC + XMT

10$:	MOV	2(SP),R4	;GET ADDRESS OF THE BUFFER
	CLR	R3		;CLEAR FIRST TO ZERO ADDRESS HI BITS
	BIS	R2,R3		;SET BUFFER SIZE
	JSR	PC,DMCIN	;GIVE TO DMC
	CLR	R5
	MOV	R3,-(SP)
	MOV	#20.,R3		;IN CASE WE NEED LOOP
20$:	TSTB	2(R1)		;TEST RDYO SET
	BMI	21$
	TST	TMR		;NOT YET, NEED TIMER?
	BEQ	20$		;NO
	DEC	R5		;YES
	BNE	20$
	DEC	R3
	BNE	20$		;
	BR	DMCOT1
	
;
;	CHECK COMPLETION FROM DMC-11
;
;
21$:	CLR	TMR
DMCOT1:	MOV	(SP)+,R3
DMCOUT:	MOV	6(R1),R2	;GET LENGTH OR ERROR BITS
	BIC	#140000,R2	;CLEAR MEMORY ENTENSION BITS
	TST	TMR		;TIMER ERROR?
	BEQ	22$		;NO
	CLR	TMR		;YES, CLEAR IND.
	BR	INIT
22$:	BITB	#3,2(R1)	;BA/CC OR CTLO
	BEQ	30$		;IF EQ, BA/CC COMPLETION
	BIT	#1730,R2	;IS IT FATAL ERROR ?
	BNE	INIT		;IF NE, CLEAR AND REINITIALIZE THE DEVICE
	
30$:	CLRB	2(R1)		;CLEAR RDYO (SETS Z-BIT)
	RETURN			;RETURN
	
	.DSABL	LSB
	
	
	
.SBTTL	DATA
	.BYTE	0	;ALLIGN
MMR:	.BYTE	M.PMMR	;MOP-MODE-RUNNING CODE
	.BYTE	DEVTYPE	;DEVICE TYPE, SHOULD BE DMC
	.BYTE	1	;MOP VERSION #
MMRSIZ:	.WORD	0,0	;MEMORY SIZE IN BYTES
	.BYTE	2	;FEATURES SUPPORTED
	MMRLNG=.-MMR	;LENGTH OF MOP-MODE-RUNNING MESSAGE

;RECEIVED MOP MSG

RCVMSG:	
RCVFCN:	.BYTE	0	;RECVD MOP FUNCTION CODE
RCVADR:	.WORD	0,0	;DUMP START ADDRESS
RCVCNT:	.WORD	0	;COUNT OF BYTES TO BE DUMPED
	RCVLNG=.-RCVMSG

BASE:	.BYTE	200	;BASE FOR DMC

;MOP TRANSMIT BUFFER
	.BYTE	0	;ALLIGN
XMTCNT:	.WORD	0
	.BYTE	0	;FILL
XMTMSG:
XMTFCN:	.BYTE	M.PMDP	;DUMP DATA MOP MESSAGE
XMTADR:	.BYTE	0,0,0,0	;DUMP ADDRESS
DATA=.
	BUFSIZ=374
PDL=.+BUFSIZ+10
	.END	START