ftp.nice.ch/peanuts/GeneralData/Usenet/news/1991/CSNProg-91.tar.gz#/comp-sys-next-programmer/1991/Dec/Help-Acess-screen-memory

This is Help-Acess-screen-memory in view mode; [Up]


Date: Sun 12-Dec-1991 08:08:48 From: arun@ac.dal.ca Subject: Help-Acess screen memory I have this simple routine to access the screen directly. But I get the error message : Segmentation fault Does anyone know how to get this to work? Yes, I really want to access video memory directly. ----------------------- #include <sys/file.h> #include <sys/ioctl.h> #include <nextdev/video.h> #define NPIX VIDEO_MW*VIDEO_H main() { char *addr; /* base addr of video RAM */ char buf[NPIX/4]; int fd,i; fd = open("/dev/vid0",O_RDWR,0); /* open video device */ if (ioctl(fd, DKIOCGADDR, &addr) == -1) perror("ioctl:DKIOCGADDR"); /* get video RAM addr */ bcopy(addr,buf,NPIX/4); /* save screen */ for (i=0;i<NPIX/4;i++) addr[i] = random(); /* trash the screen randomly */ sleep(1); /* pause to view */ bcopy(buf,addr,NPIX/4); /* restore screen */ close(fd); } ------------------------------- -George, using friends account respond to: george@[129.173.30.20}
Date: Sun 12-Dec-1991 16:31:46 From: wb1j+@andrew.cmu.edu (William M. Bumgarner) Subject: Re: Help-Acess screen memory Excerpts From Captions of netnews.comp.sys.next.programmer: 12-Dec-91 Help-Acess screen memory arun@ac.dal.ca (950) >I have this simple routine to access the screen directly. >But I get the error message : >ioctl:DKIOCGADDR: Bad file number >Segmentation fault >Does anyone know how to get this to work? >Yes, I really want to access video memory directly. It sounds like /dev/vid0 is not read/write by all-- if you attempt to open /dev/vid0 and the 'file' permissions are not set correctly, it will crash. the ftp sites some time ago. It should be under the name ScreenMunger in the 2.0 source directory, but may still be in the submissions directory. b.bum b.bumgarner | Disclaimer: All opinions expressed are my own. wb1j+@andrew.cmu.edu | I officially don't represent anyone unless I NeXT Campus Consultant | explicity say I am doing so. So there. <Thpppt!> "I ride tandem with the random/Things don't run the way I planned them.."

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Marcel Waldvogel and Netfuture.ch.