Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

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


Ïà¹ØÎĵµ£º

linux×Ö·ûģʽϵķֱæÂÊÉèÖÃ

²»Í¬É«²ÊºÍ·Ö±æÂÊËù¶ÔÓ¦µÄÖµ ¡¡¡¡
    depth-----640x480----800x600----1024x768-----1280x1024
¡¡¡¡8bit---------769--------771--------773----------775
¡¡¡¡15bit--------784--------787--------790----------793
¡¡¡¡¡¡¡¡±à¼­/boot/grub/Ŀ¼ÏµÄmenu.lstÎļþ£¨ÓÐЩϵͳmenu.lstÎļþÊÇÈíÁ¬½Óµ½ ......

linux install ÃüÁî

install
1.×÷ÓÃ
installÃüÁîµÄ×÷ÓÃÊǰ²×°»òÉý¼¶Èí¼þ»ò±¸·ÝÊý¾Ý£¬ËüµÄʹÓÃȨÏÞÊÇËùÓÐÓû§¡£
2.¸ñʽ
(1)install [Ñ¡Ïî]... À´Ô´ Ä¿µÄµØ
(2)install [Ñ¡Ïî]... À´Ô´... Ŀ¼
(3)install £­d [Ñ¡Ïî]... Ŀ¼...
ÔÚǰÁ½ÖÖ¸ñʽÖУ¬»á½«<À´Ô´>¸´ÖÆÖÁ<Ä¿µÄµØ>»ò½«¶à¸ö<À´Ô´>Îļþ¸´ÖÆÖÁÒÑ´æÔÚµÄ< ......

LinuxÃüÁlsmod ÏÔʾÒÑÔØÈëϵͳµÄÄ£¿é

lsmod(list modules)
 
¹¦ÄÜ˵Ã÷£ºÏÔʾÒÑÔØÈëϵͳµÄÄ£¿é¡£
Óï¡¡¡¡·¨£ºlsmod
²¹³ä˵Ã÷£ºÖ´ÐÐlsmodÖ¸Á»áÁгöËùÓÐÒÑÔØÈëϵͳµÄÄ£¿é¡£Linux²Ù×÷ϵͳµÄºËÐľßÓÐÄ£¿é»¯µÄÌØÐÔ£¬Ó¦´ËÔÚ±àÒëºËÐÄʱ£¬ÎñÐë°ÑÈ«²¿µÄ¹¦Äܶ¼·ÅÈëºËÐÄ¡£Äú¿ÉÒÔ½«ÕâЩ¹¦ÄܱàÒë³ÉÒ»¸ö¸öµ¥¶ÀµÄÄ£¿é£¬´ýÐèҪʱÔÙ·Ö±ðÔØÈë¡£
·¶Àý£º
[root@lin ......

Linux Platform Device and Driver

´ÓLinux 2.6ÆðÒýÈëÁËÒ»Ì×еÄÇý¶¯¹ÜÀíºÍ×¢²á»úÖÆ:Platform_deviceºÍPlatform_driver¡£
LinuxÖд󲿷ֵÄÉ豸Çý¶¯£¬¶¼¿ÉÒÔʹÓÃÕâÌ×»úÖÆ, É豸ÓÃPlatform_device±íʾ£¬Çý¶¯ÓÃPlatform_driver½øÐÐ×¢²á¡£
 
Linux platform driver»úÖÆºÍ´«Í³µÄdevice driver »úÖÆ(ͨ¹ýdriver_registerº¯Êý½øÐÐ×¢²á)Ïà±È£¬Ò»¸öÊ ......

/etc/hosts file in linux configure manual

Name
hosts - The static table lookup for host names
Synopsis
/etc/hosts
Description
This manual page describes the format of the /etc/hosts
file. This file is a simple text file that
associates IP addresses with hostnames, one line per IP address. For
each host a single line should be presen ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ