#include<stdio.h>
#include<fcntl.h>
#include<linux/fb.h>
#include<sys/mman.h>
#include<stdlib.h>
struct fb_var_screeninfo vinfo;
int main(int argc, char *argv[]) 
{
	int fbfd, fbsize, i;
	unsigned char *fbbuf;
	if ((fbfd = open("/dev/fb0", O_RDWR)) < 0) {
		exit(1);
	}
	if (ioctl(fbfd, FBIOGET_VSCREENINFO, &vinfo)) {
		printf("ioctl error\n");
		exit(2);
	}
	fbsize = vinfo.xres*vinfo.yres*(vinfo.bits_per_pixel/8);
	if ((fbbuf = mmap(0, fbsize, PROT_READ| PROT_WRITE, MAP_SHARED, fbfd, 0)) == -1)
		exit(3);
	for (i=0; i<fbsize;i++) {
		*(fbbuf+i) = 0x0;
	}
	munmap(fbbuf, fbsize);
	close(fbfd);
	printf("ok...\n");
}
	
