X crashing at irregular occasions on SUN 3's
mmm%informatics.rutherford.ac.uk at nsfnet-relay.ac.uk
mmm%informatics.rutherford.ac.uk at nsfnet-relay.ac.uk
Wed May 10 08:50:44 AEST 1989
paul at amos.ucsd.edu (Paul Smith) writes:
> schultz at mmm.serc.mmm.com (John C Schultz):
> > the display will go black and no keyboard or mouse entry is allowed. Even
> > L1-A does nothing.
> One thing I should make clear is that the sun isn't actually "crashed".
> In our case it's only the monitor which has died
It could be that the video is being turned off. Nothing will turn it on
again, except something like screenblank - but even then only if it thinks
>it< turned the video off, so you have to leave the keyboard and mouse
idle for (by default) 10 minutes. Try explicitly turning the video back
on again, or enquiring its status, with the following C program or the
equivalent packaged into a shell script.
__________
/* switch video on or off. Mark M Martin. March 1989 */
#include <sys/ioctl.h>
#ifndef _IO
#include <sys/ioccom.h>
#endif _IO
#include <sun/fbio.h>
main(argc,argv)char **argv;{
int i,f;
f = open("/dev/fb",0);
if(f<0)exit(2);
if(argc==2 && strcmp(argv[1],"off")==0){
i = FBVIDEO_OFF;
exit(ioctl(f,FBIOSVIDEO,&i)<0);
}
if(argc==2 && strcmp(argv[1],"on")==0){
i = FBVIDEO_ON;
exit(ioctl(f,FBIOSVIDEO,&i)<0);
}
if(argc!=1){
printf("usage: %s {on|off}\n",argv[0]);
exit(2);
}
exit(ioctl(f,FBIOGVIDEO,&i)<0?2:(i==FBVIDEO_OFF?1:0));
}
__________
#!/bin/sh
# switch video on or off. Mark M Martin. RAL Jan 1989
tmp=/tmp/video$$
trap 'rm -f $tmp.*;exit 3' 1 2 3 15
case $1 in
-off|off) code="i = FBVIDEO_OFF; exit(ioctl(0,FBIOSVIDEO,&i)<0);" ;;
-on|on) code="i = FBVIDEO_ON; exit(ioctl(0,FBIOSVIDEO,&i)<0);" ;;
'') code="exit(ioctl(0,FBIOGVIDEO,&i)<0?2:(i==FBVIDEO_OFF?1:0));" ;;
*) echo "usage: $0 {on|off}"
exit 1 ;;
esac
include=sys/ioccom.h
if [ ! -f /usr/include/$include ]
then include=sys/ioctl.h
fi
echo "#include <$include>
#include <sun/fbio.h>
main(){int i;$code }" >$tmp.c
cc $tmp.c -o $tmp.a &&
$tmp.a </dev/fb
save=$?
rm -f $tmp.*
exit $save
__________
Informatics arpa: mmm%inf.rl.ac.uk at nss.cs.ucl.ac.uk
Rutherford Appleton Lab uucp: ..!mcvax!ukc!rlinf!mmm
Didcot, Oxon, UK. OX11 0QX mmm at rlinf.uucp
Tel +44 235 44 5160 Fax +44 235 44 5831
More information about the Comp.sys.sun
mailing list