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
Ïà¹ØÎĵµ£º
install
1.×÷ÓÃ
installÃüÁîµÄ×÷ÓÃÊǰ²×°»òÉý¼¶Èí¼þ»ò±¸·ÝÊý¾Ý£¬ËüµÄʹÓÃȨÏÞÊÇËùÓÐÓû§¡£
2.¸ñʽ
(1)install [Ñ¡Ïî]... À´Ô´ Ä¿µÄµØ
(2)install [Ñ¡Ïî]... À´Ô´... Ŀ¼
(3)install £d [Ñ¡Ïî]... Ŀ¼...
ÔÚǰÁ½ÖÖ¸ñʽÖУ¬»á½«<À´Ô´>¸´ÖÆÖÁ<Ä¿µÄµØ>»ò½«¶à¸ö<À´Ô´>Îļþ¸´ÖÆÖÁÒÑ´æÔÚµÄ< ......
free_bootmem()Õâ¸öº¯ÊýÊÇϵͳÆô¶¯³õÆÚÄÚ´æÊͷŵĺËÐĺ¯Êý£¬ÎÒÃÇÀ´¿´¿´ËüµÄ´úÂë¡£
void __init free_bootmem (unsigned long addr, unsigned long size)//addrÊÇÒªÊͷŵÄÎïÀíÆðʼµØÖ·£¬sizeÊÇÒªÊͷſռäµÄ´óС¡£
{
free_bootmem_core(NODE_DATA(0)->bdata, addr, size);//Ö±½ ......
linuxѹËõºÍ½âѹËõÃüÁî´óÈ«
.tar
¡¡¡¡½â°ü£ºtar zxvf FileName.tar
¡¡¡¡´ò°ü£ºtar czvf FileName.tar DirName
¡¡¡¡---------------------------------------------
¡¡¡¡.gz
¡¡¡¡½âѹ1£ºgunzip FileName.gz
¡¡¡¡½âѹ2£ºgzip -d FileName.gz
¡¡¡¡Ñ¹Ëõ£ºgzip File ......
caddr_t //ºËÐĵØÖ·
clock_t //ʱÖӵδð¼ÆÊýÆ÷
compt_t //ѹËõµÄʱÖӵδð
dev_t //É豸ºÅ£¨Ö÷ºÍ´Î£©
fd_set //ÎļþÃèÊö·û¼¯
fpos_t //ÎļþλÖÃ
gid_t //ÊýÖµ×éID
ino_t //i½Úµã±àºÅ
mode_t //ÎļþÀ ......
1£¬ÏÔÖøÓ°ÏìϵͳÐÔÄܵÄ4ÖÖ×ÊÔ´
(1),CPUʱ¼ä
(2),ÄÚ´æ
(3),Ó²ÅÌI/O
(4),ÍøÂçI/O
2£¬·ÖÎöCPUʹÓÃÇé¿ö
ʹÓÃvmstat²É¼¯CPUµÄÐÔÄÜÆ¿¾±
[root@local]# vmstat 2
procs -----------memory---------- ---swap-- -----io-- ......