Subject: Re: Clockticks lost, why ?
To: Erik E. Fair <fair@clock.org>
From: Christoph Ewering <eweri@uni-paderborn.de>
List: port-mac68k
Date: 01/27/1997 09:33:08
Hello !

> >Could someone explain to me why it is so difficult for a Unix-system to
> >hold the time.
> 
> Short answer: because the vendors don't care. They produce systems with
> cheap crystal oscillators, and then (as noted) set them to lower than the
> highest priority interrupt, and they write hacks to the UNIX kernel (device
> drivers, other "critical" sections) which disable interrupts far too long.
> 
> The way to fix it is two fold:
> 
> 1. Eliminate as much of the p = spl7(); /* critical code */; splx(p); out
> of the kernel as possible; write device drivers to defer serious processing
> until after the device interrupt is dismissed.

Why do I need to catch an interrupt, when it is possible to read the time
from a counter that is independant from interrupts?
Everytime when the clock gets the processor it will call a routine that
reads the counter. A little calculation, and it has the exact time.

> 2. Run the Network Time Protocol (NTP) daemon on your system. This will
> keep your clock in trim. It assumes a constant connection to the Internet,
> alas.

This solution is a little to big, to have the right time on my home mac
:-)

Bye,
	Christoph

Christoph Ewering         eweri@uni-paderborn.de
Husarenstrasse 48         Fon: 05254 12555
33104 Paderborn           www.uni-paderborn.de/Admin/eweri/