Subject: Re: test kernel coming soon...
To: None <port-pmax@netbsd.org>
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
List: port-pmax
Date: 03/08/1999 12:13:13
hi all,

several people have tried the DELAY()-calibration code on Personal
Decstations and 5000/240s.

Much to my surprise,  doing the moral equivalent of

	microtime(&start);
	DELAY(1000000);
	microtime(&end)
	timersub(&end, &start, &delta);
	printf(...contents of delta...);

in pmax/pmax/autoconf.c:autoconfigure(), _even after SCSI
configuration_ shows a one-microsecond delay. And even that is coming
from the monotonicity of microtime().

That's weird for two reasons: its after an spl0 so clock interrupts
are enabled, and so microtime() should increment by 256 clock
interrupts (even if its no more accurate than 4 usecs, give or take
slop in the DELAY() multiplier). 

And even if there were no clock ticks, microtime() interpolates using
the free-running timer on a Personal DECstation and the TC-bus cycle
counter on 5000/240s.

I guess i need more coffee.  But does anyone else understand what's
going on here?