Article View: comp.sys.sun
Article #12709Re: X crashing at irregular occasions on SUN 3's
From: mmm%informatics.rutherford.ac.uk
Date: Tue, 09 May 1989 22:50
Date: Tue, 09 May 1989 22:50
70 lines
2698 bytes
2698 bytes
paul@amos.ucsd.edu (Paul Smith) writes:
> schultz@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@nss.cs.ucl.ac.uk
Rutherford Appleton Lab uucp: ..!mcvax!ukc!rlinf!mmm
Didcot, Oxon, UK. OX11 0QX mmm@rlinf.uucp
Tel +44 235 44 5160 Fax +44 235 44 5831
Technical Details
Message-ID:
<8905021051.AA06262@pyr-a>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!rice!sun-spots-requestShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!rice!sun-spots-request From: mmm%informatics.rutherford.ac.uk@nsfnet-relay.ac.uk Newsgroups: comp.sys.sun Subject: Re: X crashing at irregular occasions on SUN 3's Keywords: Software Message-ID: <8905021051.AA06262@pyr-a> Date: 9 May 89 22:50:44 GMT Sender: usenet@rice.edu Organization: Sun-Spots Lines: 70 Approved: Sun-Spots@rice.edu Original-Date: Tue, 2 May 89 11:51:27-0000 X-Sun-Spots-Digest: Volume 7, Issue 279, message 4 of 23