[comp.sys.sun] screenblank on color SS1 - Issue 146

jcaplow@ussstark.prime.com (Jeff Caplow) (10/06/89)

I apologize for the somewhat shoddy writing in my last article submitted
as a solution to problems with screenblank, which I sent in on Tues. 10/3.
Here is my replacement article.

This problem is most likely caused by your system having had it's clock
set backward, or having once had it's time set to the future, whichever
way you want to see it.

Screenblank uses the accessed and modified times of the inodes for the
devices mouse, kbd, and console, to determine what action to take.

Screenblank stores in variables the last times that those devices were
referenced.  If the system had a time in the "future", screenblank would
have stored these times.  Should the system time be set backwards, when
screenblank compares the current accessed and modified times of the
devices to the stored ones in screenblank, the current values will be less
than the stored ones, which screenblank interprets as indicating that the
devices have not been accessed so do not reactivate the display.

Ah, you might say, why not kill the screenblank process and start up
another?  or even reboot?  The odd drawback in this problem is that when
suntools is exited, the mouse and kbd attain modified and accessed times
of the largest modified time they've had, which was when the system had
that future time.  Rebooting does not prevent this, thus resulting in the
problem described in issue 146 which occurred when suntools is exited.

Sun could fix this problem by changing screenblank's comparison of the
stored accessed and modified times of the devices with their current times
to "!=", from ">".  Computervision has done this for it's OS distributed
on top of Sun'sOS which goes on its CADDStations.

One way to recover from this is to redirect output to the console, taking
advantage of the fact that the problem is with the mouse and kbd devices,
not the console.

In older systems the clock problem has been caused by a weak/dead battery
on the cpu board.

Ideally there ought to be a fix so that the mouse and kbd devices do not
take on such erroneous times when suntools is exited.