linux frame buffer grab
linuxµÄÇý¶¯¾ÍÊǸö×Ö·ûÉ豸£¬¿ÉÒÔÓÃread write ioctl mmap²Ù×÷£¬Í¨¹ý/dev/fbx¿ÉÒÔÏñÎļþÒ»ÑùÖ±½Ó¶Áд
½ØÆÁdd if=/dev/fb0 of=snapshot
»Ö¸´cat snapshot > /dev/fb0
¿ªÔ´µÄÓÐfbgrab¹¤¾ß£¬²»¹ýÊÇÉú³ÉpngÎļþ£¬ÎÒ×Ô¼ºÐ´ÁËÒ»¸öÉú³ÉbmpÎļþµÄ¹¤¾ß½Ðfbcap£¬Â¼ÖƳÉavi¸ñʽ£¬Í¨¹ýsocket»òserial°ÑÉ豸µÄ²Ù×÷·¢Ë͵½hostÉÏ£º£©¡£
±£´æbmpÎļþ´úÂ룺
int savebmp(char* filename, int size, int bmWidth, int bmHeight, int bmBitsPixel, unsigned char* buffer)
{
FILE *fp = NULL;
int j = bmHeight;
int nColors = 0;
int nPeletteLen = 0;
RGBQUAD *rgbquad = NULL;
fp = fopen(filename, "w+");
if(fp == NULL)
{
printf("open file :%s fail\n", filename);
return -1;
}
printf("size=%d, width=%d, height=%d, bitsPixel=%d\n", size, bmWidth, bmHeight, bmBitsPixel);
if (bmBitsPixel <= 8)
{
nColors = bmBitsPixel << 1;
nPeletteLen = nColors * sizeof(RGBQUAD);
rgbquad= malloc(sizeof(RGBQUAD)*nColors);
if (rgbquad == NULL)
{
fclose(fp);
return -1;
}
memset(rgbquad, 0, nColors * sizeof(RGBQUAD));
int index = 0;
for(index = 0; index < nColors; index++)
{
rgbquad[index].rgbBlue = index;
rgbquad[index].rgbGreen = index;
rgbquad[index].rgbRed = index;
}
#if 1
if (bmBitsPixel == 1)//blue word,white backgroud
{
rgbquad[nColors -2].rgbBlue = 255;
rgbquad[nColors -2].rgbGreen = 255;
rgbquad[nColors -2].rgbRed = 255;
rgbquad[nColors -1].rgbBlue = 0xff;
rgbquad[nColors -1].rgbGreen = 0;
rgbquad[nColors -1].rgbRed = 0;
}
#else
if (bmBitsPixel == 1)//white word,black backgroud
{
rgbquad[nColors -2].rgbBlue = 0 ;
rgbquad[nColors -2].rgbGreen = 0;
rgbquad[nColors -2].rgbRed = 0;
rgbquad[nColors -1].rgbBlue =0xFF;
rgbquad[nColors -1].rgbGreen = 0xff;
rgbquad[nColors -1].rgbRed = 0xFF;
}
#endif
}
printf("nColors=%d,pelettelen=%d\n",nColors, nPeletteLen);
//
BITMAPFILEHEADER bfh;
bfh.bfType = ((unsigned short)('M'<< 8)|'B');
bfh.bfRe
Ïà¹ØÎĵµ£º
²»Í¬É«²ÊºÍ·Ö±æÂÊËù¶ÔÓ¦µÄÖµ ¡¡¡¡
depth-----640x480----800x600----1024x768-----1280x1024
¡¡¡¡8bit---------769--------771--------773----------775
¡¡¡¡15bit--------784--------787--------790----------793
¡¡¡¡¡¡¡¡±à¼/boot/grub/Ŀ¼ÏµÄmenu.lstÎļþ£¨ÓÐЩϵͳmenu.lstÎļþÊÇÈíÁ¬½Óµ½ ......
±¾º¯ÊýµÄ·ÖÎöºÜÄѾßÌ壬ÒòΪÉæ¼°Á˺ܶàarmµÄ´¦ÀíÆ÷ÐͺźÍÿ¸öÐͺŶÔÓ¦µÄcacheºÍwrite bufferµÄ¹¤×÷·½Ê½£¬ÕâƬÎÄÕÂÖ»ÊÇ×ö¼òµ¥µÄ¼Ç¼£¬·½±ãÒÔºóÁ˽â¸üÉîºó»ØÀ´ÔÙÀ´ÍêÉÆÕâ¸öº¯Êý¡£
Õâ¸öº¯ÊýµÄµ÷Óùý³ÌÈ磺start_kernel()->setup_arch()->paging_init()->memtable_init( ......
´ÓLinux 2.6ÆðÒýÈëÁËÒ»Ì×еÄÇý¶¯¹ÜÀíºÍ×¢²á»úÖÆ:Platform_deviceºÍPlatform_driver¡£
LinuxÖд󲿷ֵÄÉ豸Çý¶¯£¬¶¼¿ÉÒÔʹÓÃÕâÌ×»úÖÆ, É豸ÓÃPlatform_device±íʾ£¬Çý¶¯ÓÃPlatform_driver½øÐÐ×¢²á¡£
Linux platform driver»úÖƺʹ«Í³µÄdevice driver »úÖÆ(ͨ¹ýdriver_registerº¯Êý½øÐÐ×¢²á)Ïà±È£¬Ò»¸öÊ ......
ת×Ô£º http://blog.csdn.net/kongqz/archive/2009/05/15/4184415.aspx
¾ÍÊÇÔÚÒÑÓеÄÊý¾Ý¿âʵÀýÉÏ´´½¨Ò»¸öеÄÕʺţ¬·ÃÎÊһЩеıí
²Ù×÷²½ÖèÈçÏ£º
1¡¢µÇ¼linux£¬ÒÔoracleÓû§µÇ¼£¨Èç¹ûÊÇrootÓû§µÇ¼µÄ£¬µÇ¼ºóÓà su - oracleÃüÁîÇл»³ÉoracleÓû§£©
2¡¢ÒÔsysdba·½Ê½À´´ò¿ªsqlplus£¬ÃüÁîÈçÏ£º s ......
°´ÒÔϲ½ÖèÀ´,ÏÈдÕâô¶àÀ´ÌáÐÑÏÂ×Ô¼º:
1.ÊìϤlinuxµÄ»ù±¾»·¾³,ÊìϤlinuxµÄ»ù±¾ÃüÁî.
2.ÊìϤlinuxµÄ½»²æ±àÒë»·¾³µÄµÄÅäÖÃ.
3.¸´Ï°»ù±¾µÄCÓïÑÔ֪ʶ.
&nbs ......