#include #include #include #include #include #include #include #include extern const char *__progname; static const char *devpath = "/dev/bwtwo0"; static int fd; static unsigned char *vram; static int size; static void setup(void) { void *mrv; struct fbtype t; fd = open(devpath,O_RDWR,0); if (fd < 0) { fprintf(stderr,"%s: %s: %s\n",__progname,devpath,strerror(errno)); exit(1); } if ( (ioctl(fd,FBIOGTYPE,&t) < 0) || (t.fb_type != FBTYPE_SUN2BW) || (t.fb_depth != 1) ) { close(fd); fprintf(stderr,"%s: %s: not a bw2\n",__progname,devpath); exit(1); } mrv = mmap(0,t.fb_size,PROT_READ|PROT_WRITE,MAP_SHARED,fd,0); if (mrv == MAP_FAILED) { fprintf(stderr,"%s: can't mmap %s: %s\n",__progname,devpath,strerror(errno)); exit(1); } vram = mrv; size = t.fb_size; } static void fillfb(void) { memset(vram,~0,size); } int main(void); int main(void) { setup(); fillfb(); exit(0); }