Google
 

Trailing-Edge - PDP-10 Archives - red405a2 - unsupported/ks20.mac
There are no other files named ks20.mac in the archive.
	title ks20
	SUBTTL  Peeking into KS-Firmware Status
				;B.eiben
				;Pr.Supp. F.S.

	search macsym,monsym
	opdef aprid [700000,,0]
	opdef rdapr [700240,,0]
	opdef wrapr [700200,,0]
	opdef rdebr [701240,,0]
	opdef rdhsb [702300,,0]
	opdef rdio [712000,,0] ; these are "external" IO instructions,which
	opdef wrio [713000,,0] ; talk to higher than 18-bit adresses
			       ; i.e RDIO ac,763100(x) with x==1000000
			       ; will adress 1763100 , the UBA status-reg
			       ; for UBA1 -- the first UBA on the KS
.rpcap:	block 1	;privileges stored here
.rdapr:	block 1		;result of rdapr
			;bit 8 power fail enabled
			;bit 9 non ex mem error enabled
			;bit 10 hard memory error interrupt enabled
			;bit 11 soft memory error interrupt enabled
			;bit 12 interval timer enabled
			;bit 13 8080 console interrupt enabled

			;bit 26 power fail error
			;bit 27 non-ex mem error
			;bit 28 hard memory error ( no ecc corr.)
			;bit 29 soft memory error ( ecc worked it out)
			;bit 30 interval timer done
			;bit 31 8080 console interrupt
			;bit 32 inerrupt requested
			;bit 33-35 pia
.rdebr:	block 1		;result of rdebr
			;bit 21 kl-10 paging mode
			;bit 22 trap (and paging) enable
			;bits 25-35 executive bas register
.aprid: block 1		;result of aprid
			;bits 0-8 reserved for m-code version
			;bits 9-17 m-code version nr.
			;bits 18-20 hardware options
			;bits 21-35 processor ser.nr.
.rdhsb: block 1		;result of rdhsb
			;bit 0 =0 store halt-status block
			;       =1 dont do it
			;bits 14-35 hsb adress
memsta:	block 1	;results of ecc-correction
			;bit 0 = Hold Bit ( clear for next one )
			;bit 1 = Err in Reg uncorrectable
			;bit 2 = Refresh Error
			;bit 3 = Par Err on KS10 bus
			;	cleared on MR
			;bit 5 = Par bit of Corr Code
			;bit 6 = Corr Code bit C40
			;bit 7 = Corr Code bit C20
			;bit 8 = Corr Code bit C10
			;bit 9 = Corr Code bit C04
			;bit 10 = Corr Code bit C02
			;bit 11 = Corr Code bit C01
			;bit 12 = Memory has lost power
			;bit 13 = unused ( for the time )
			;bit 14-35 = Bits 14-35 of Error Adress Reg

	; ac-definitions
t1==1			;these AC's are temporary ( destroyed by MACROS )
t2==2
t3==3
t4==4			; from here on AC's are "permanent"

p1==5
p2==6
n==7
c==10
p==17
	;macro definitions
	define tellc(m),<
	jrst [movei t1,[asciz "m
"]
		psout
		jrst .+1]
>
	define tell(m),<

	jrst [movei t1,[asciz "m"]
	psout
		jrst .+1]
>
	define octout(m),<
	jrst[movei t1,.priou
		move t2,m
		move t3,[no%mag!8b17!8b35]
		nout
		  erjmp[ tellc <failure in nout>
			 haltf]
		jrst .+1]
>
	define decout(m),<
	jrst[movei t1,.priou
		move t2,m
		move t3,[no%mag!6b17!12b35]
		nout
		  erjmp [ tellc <failure in nout>
			  haltf]
	jrst .+1]
>
sall
start:	reset		;get a clean slate
	setz 0
	movei p,1
	blt p,p		;clean up ac's
	move p,[iowd 100,pdl] ;and set up pdl
	movei t1,0
	blt t1,0	;is it a KL?
;	jumpn t1,noks	;obviously not!
	movsi t1,576400	;-1
	fdv t1,[200600,,0]	; /0.75
	trnn t1,1	;if bit 35
;	jrst noks	;won't run
	movx 1,.fhslf	;us
	rpcap		;what can we do??
	erjmp punt
	movem 2,.rpcap	;save them to restore later
	move 3,2	;enable everything
	epcap
	erjmp punt
	usrio
	erjmp punt
test:	setzm .aprid
	aprid ,.aprid	;read m-code and Serial-nr
	erjmp punt
	setzm .rdapr
	rdapr ,.rdapr	;read cpu-status
	erjmp punt
	setzm .rdebr
	rdebr ,.rdebr	;read pagin-style and ept-page nr
	erjmp punt
	rdhsb , .rdhsb	; read hsb-adress
	erjmp punt
	rdio p1,100000	;read memory status register
	erjmp punt
	movem p1,memsta	;and save it
type:	hrrz p1,.aprid
	tellc <>
	tell <APR-Serial Nr.: >
	decout p1
	hlrz p1,.aprid
	tell < Micro-Code Ver.: >
	octout p1
	tell < HSB-Adr.: >
	hrrz p1,.rdhsb
	octout p1
	move p1,.rdhsb
	txnn p1,1b0
	 tell < (enabled) >
	tellc <>
	tell <Interrupts enabled: >
	move p1,.rdapr
	txne p1,1b8	;power fail enabled?
	 tell < power fail >
	txne p1,1b9	;nxm error up ?
	 tell < NXM >
	txne p1,1b10	;hard memory error interrupt on?
	 tell < Hard Mem Err >
	txne p1,1b11	; soft mem error on?
	 tell < Soft Mem Err >
	txne p1,1b12	;interval timer on?
	 tell < Interv. timer >
	tellc <>
	move p1,.rdebr	; get rdebr-results
	txne p1,1b21	;tops20 paging on?
	 tell < TOPS20 paging on >
	txne p1,1b22	;trap and paging enabled?
	 tellc < trap + paging enabled >
	tellc <>
	move p1,.RDAPR	;get status again
	TXNE P1,1B27!1B28!1B29	;DO WE HAVE ERRORS?
	tell < Errors which occurred: >
	txne p1,1b27	;NXM error?
	 tell < NXM >
	txne p1,1b28	;hard mem error?
	 tell < Hard MEM >
	txne p1,1b29	;soft ( ECC ) mem error?
	 tell < Soft ( ECC ) Mem Err. >
	txne p1,1b29	;soft (ecc)
	call memadr		;get the adress etc out
over:	
	jrst punt	;current end
memadr:	move p1,memsta	;get memory status reg.
	txnn p1,1b0	;hold-bit up?
	ret		;nothing there
	setom clear	;set switch
	move p1,memsta	;get adress
	tlz p1,777760	;make it adress only
	tell < Adr.: >
	octout p1	;and type
foo:	hlrz t1,memsta	;get memsta-left half
	trz t1,77B23	;clear hold , parity , soft-Ecc etc
	lsh t1,-6	;shift possible adress-bits out
	addi t1,ecctab	;get offset into table
	move t1,(t1)	;and get pointer to text
	psout		;and print
	tellc <>
	move p1,memsta	;get memory status register
	txne p1,1b3	;ks10 bus parity up?
	 tell < KS10 BUS Par. Err >
	txne p1,1b1	;err in reg uncorrectable
	tell < err in reg uncorrectable>
	txne p1,1b2	;refresh error?
	tell < refresh error >
	txne p1,1b12	;mem has lost power?
	tell < Mem has lost power >
	hrlzi p1,400000	; set clear bit
	movei p2,100000	;load adress of mem-stat-reg
	move t1,clear	;do we have to do it?
	jumpe t1,.+2	;nope!!
	wrio p1,100000	;clear hold bit
	ret
;noks:	tellc < Program will only run on KS >
punt:	jrstf @[.+1]
	haltf		;halt him
	jrst .-1	;really !!!
pdl:	block 100	;our pdl resides here
clear:	block 1 ; switch for clearing memsta
ecctab:[asciz / Unknown ECC-CODE 0 /]
	[asciz / ECC-Bit C1 failed /]
	[asciz / ECC-Bit C2 failed /]
	[asciz / Unknown ECC-CODE 3 /]
	[asciz / ECC-BIT C4 failed /]
	[asciz / Unknown ECC-CODE 5 /]
	[asciz / Unknown ECC-CODE 6 /]
	[asciz / Unknown ECC-CODE 7 /]
	[asciz / ECC-Bit C10 failed /]
	[asciz / Bit 0 failed /]
	[asciz / Bit 1 failed /]
	[asciz / Bit 2 failed /]
	[asciz / Bit 3 failed /]
	[asciz / Bit 4 failed /]
	[asciz / Bit 5 failed /]
	[asciz / Unknown ECC-CODE 17 /]
	[asciz / ECC-Bit C20 failed /]
	[asciz / Bit 6 failed /]
	[asciz / Bit 7 failed /]
	[asciz / Bit 8 failed /]
	[asciz / Bit 9 failed /]
	[asciz / Bit 10 failed /]
	[asciz / Bit 11 failed /]
	[asciz / Unknown ECC-CODE 27 /]
	[asciz / Unknown ECC-CODE 30 /]
	[asciz / Bit 12 failed /]
	[asciz / Bit 13 failed /]
	[asciz / Bit 14 failed /]
	[asciz / Bit 15 failed /]
	[asciz / Bit 16 failed /]
	[asciz / Bit 17 failed /]
	[asciz / Unknown ECC-CODE 37 /]
	[asciz / ECC Bit C40 failed /]
	[asciz / Bit 18 failed /]
	[asciz / Bit 19 failed /]
	[asciz / Bit 20 failed /]
	[asciz / Bit 21 failed /]
	[asciz / Bit 22 failed /]
	[asciz / Bit 23 failed /]
	[asciz / Unknown ECC-CODE 47 /]
	[asciz / Unknown ECC-CODE 50 /]
	[asciz / Bit 24 failed /]
	[asciz / Bit 25 failed /]
	[asciz / Bit 26 failed /]
	[asciz / Bit 27 failed /]
	[asciz / Bit 28 failed /]
	[asciz / Bit 29 failed /]
	[asciz / Unknown ECC-CODE 57 /]
	[asciz / Unknown ECC-CODE 60 /]
	[asciz / Bit 30 failed /]
	[asciz / Bit 31 failed /]
	[asciz / Bit 32 failed /]
	[asciz / Bit 33 failed /]
	[asciz / Bit 34 failed /]
	[asciz / Bit 35 failed /]
	[asciz / Unknown ECC-CODE 67 /]
	[asciz / Unknown ECC-CODE 70 /]
	[asciz / Unknown ECC-CODE 71 /]
	[asciz / Unknown ECC-CODE 72 /]
	[asciz / Unknown ECC-CODE 73 /]
	[asciz / Unknown ECC-CODE 74 /]
	[asciz / Unknown ECC-CODE 75 /]
	[asciz / Unknown ECC-CODE 76 /]
	[asciz / Unknown ECC-CODE 77 /]
	end start