🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.xinu
Article #356

Re: Ultrix & PDP/11 clock problems

#356
From: Douglas Comer
Date: Thu, 22 Feb 1990 16:43
48 lines
2428 bytes
well... it sounds like hardware to me.  The only thing that may be
wrong is that upgraded PDP11's have a faster processor than the early
ones.  The way we test for the presence of a clock is to grab the
clock interrupt vector, enable interrupts, and drop into a loop for
a while.  If the interrupt occurs before the loop ends, we declare the
clock to be present.  Otherwise we disable interrupts again, reset
the interrupt vector, and declare no clock present.  Look at routine
setclkr.s to see it has COUNT of 30000 or more (see below).

Cheers,
Doug
----------------------------------------------------------------------------
/* setclkr.s - setclkr */

CVECTPC	=	100			/ clock interrupt vector address
CVECTPS	=	102			/  "      "         "      "
DISABLE	=	340			/ PS that disables interrupts
ENABLE	=	000			/ PS that enables interrupts
COUNT	=	30000.			/ Times to loop (in decimal)

/*------------------------------------------------------------------------
/* setclkr  --  set cklruns to 1 iff real-time clock exists, 0 otherwise
/*------------------------------------------------------------------------
	.globl	_setclkr
_setclkr:
	mov	r1,-(sp)		/ save register	used
	clr	_clkruns		/ initialize for no clock
	mov	*$CVECTPS,-(sp)		/ save clock interrupt vector
	mov	*$CVECTPC,-(sp)		/   on caller's stack
	mov	$DISABLE,*$CVECTPS	/ set up new interrupt vector
	mov	$setint,*$CVECTPC
	mov	$COUNT,r1		/ initialize counter for loop
	reset				/ clear other interrupts, if any
	mtps	$ENABLE			/ allow	interrupts
setloop:
	dec	r1			/ loop COUNT times waiting for
	bpl	setloop			/   a clock interrupt
	mtps	$DISABLE		/ no interrupt occurred, so quit
	br	setdone
setint:
	inc	_clkruns		/ clock interrupt jumps here
	add	$4,sp			/ pop pc/ps pushed by interrupt
setdone:
	mov	(sp)+,*$CVECTPC		/ restore old interrupt vector
	mov	(sp)+,*$CVECTPS
	mov	(sp)+,r1		/ restore register
	rts	pc			/ return to caller
----------------------------------------------------------------------------
Technical Details
Message-ID: <9002221643.AA18705@merlin.cs.purdue.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!att!dptg!ulysses!ucbvax!CS.PURDUE.EDU!comer

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!att!dptg!ulysses!ucbvax!CS.PURDUE.EDU!comer
From: comer@CS.PURDUE.EDU (Douglas Comer)
Newsgroups: comp.os.xinu
Subject: Re:  Ultrix & PDP/11 clock problems
Message-ID: <9002221643.AA18705@merlin.cs.purdue.edu>
Date: 22 Feb 90 16:43:26 GMT
Sender: daemon@ucbvax.BERKELEY.EDU
Organization: The Internet
Lines: 48