[comp.os.xinu] Ultrix & PDP/11 clock problems

giacobbe@pilot.njin.net (Jeff Giacobbe) (02/22/90)

The following question is (I think) both a hardware and software one.
Here at the college (Montclair State) we offer on operating systems
class that uses a DEC Micro Vax and four PDP/11's.  The students write
their code on the MicroVax, then upload it to the PDP/11's for
execution, etc,etc,etc.

This system works fine for single-process programs. HOWEVER, when
trying to run code that uses concurrent processing, the system reports
back that the PDP/11's clock(s) is disabled.

We had DEC field-service out here the other day.  He checked all the
jumpers and connections on the PDP/11's and, as expected, everything
looked in it's proper place.  This led me to believe that it was a
software problem; i.e. there was some missing code that would turn on
the PDP/11's clock and provide the interrupts necessary to run the
concurrent processes.

The professors who have taught the class in the past tried out their
older concurrent-process programs that USED TO work.  Same thing: the
dreaded 'clock disabled' message.

So that's the situation, DEC field service says the hardware is
configured correctly and that it must be the software, the professors
say their programs worked before, so it must be a hardware problem!

Any help and/or suggestions would be GREATLY appreciated.

Thanks,

Jeff Giacobbe

giacobbe@apollo.montclair.edu   OR   giacobbe.pilot.njin.net

comer@CS.PURDUE.EDU (Douglas Comer) (02/23/90)

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
----------------------------------------------------------------------------