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
Ïà¹ØÎĵµ£º
modinfo(module infomation)
¹¦ÄÜ˵Ã÷£ºÏÔʾkernelÄ£¿éµÄÐÅÏ¢¡£
Óï¡¡¡¡·¨£ºmodinfo [-adhpV][Ä£¿éÎļþ]
²¹³ä˵Ã÷£ºmodinfo»áÏÔʾkernelÄ£¿éµÄ¶ÔÏóÎļþ£¬ÒÔÏÔʾ¸ÃÄ£¿éµÄÏà¹ØÐÅÏ¢¡£
²Î¡¡¡¡Êý£º
-a»ò--author ¡¡ÏÔʾģ¿é¿ª·¢ÈËÔ±¡£
-d»ò--description ¡¡ÏÔʾģ¿éµÄ˵Ã÷¡£& ......
´ÓLinux 2.6ÆðÒýÈëÁËÒ»Ì×еÄÇý¶¯¹ÜÀíºÍ×¢²á»úÖÆ:Platform_deviceºÍPlatform_driver¡£
LinuxÖд󲿷ֵÄÉ豸Çý¶¯£¬¶¼¿ÉÒÔʹÓÃÕâÌ×»úÖÆ, É豸ÓÃPlatform_device±íʾ£¬Çý¶¯ÓÃPlatform_driver½øÐÐ×¢²á¡£
Linux platform driver»úÖÆºÍ´«Í³µÄdevice driver »úÖÆ(ͨ¹ýdriver_registerº¯Êý½øÐÐ×¢²á)Ïà±È£¬Ò»¸öÊ ......
·½·¨Ò»£º Expect ʵÏÖ½»»¥
UNIX ´°¿ÚÖÐ ÊäÈëÒÔÏÂÃüÁ
expect ftplinux.txt 10.0.15.22 ftplinux.txt
ftplinux.txt ÖÐÄÚÈÝÈçÏ£º
--¿ªÊ¼-----
spawn ftp [lindex $argv 0]
expect "Name(*):"
send "ftp\r"
expect "Password:*"
send "hell05a\r"
expect "ftp> ......
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 ......
Ubuntu 7.10
ÔÚ°²×°Ê±£¬Ã»ÓÐÉèÖÃrootÃÜÂ룬ËùÒÔÕâ¾Í±ØÐëÔÚ°²×°Íê³ÉºóÉèÖà ÃüÁîÈçÏ£º
$ sudo passwd root
ÊäÈëÄãÏ£ÍûµÄrootÓû§µÄÃÜÂë
ÆäËüÃüÁ
Ò»¡¢°²×°Grub
$ grub
$ find /boot/grub/stage1
(hd0,*)
$ root (hd0,*)
$ setup (hd0,*)
$ quit
$ sudo dd if=/de ......