Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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ÃüÁlsmod ÏÔʾÒÑÔØÈëϵͳµÄÄ£¿é

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

ÔÚCentOS 5 »òRed Hat Enterprise Linux°²×°ÓïÑÔ°ü


Q. How do I install Languages in Linux after installation? I don’t have any language specific support installed but need to install the same. I’m using both RHEL 5 and CentOS 5.
A. Yellow dog Updater, Modified, a package manager for RPM-compatible Linux systems such as Cento ......

linuxÏ´´½¨oracleÓû§±í¿Õ¼ä

 ¾ÍÊÇÔÚÒÑÓеÄÊý¾Ý¿âʵÀýÉÏ´´½¨Ò»¸öеÄÕʺţ¬·ÃÎÊһЩеıí
 ²Ù×÷²½ÖèÈçÏ£º
 1¡¢µÇ¼linux£¬ÒÔoracleÓû§µÇ¼£¨Èç¹ûÊÇrootÓû§µÇ¼µÄ£¬µÇ¼ºóÓà su - oracleÃüÁîÇл»³ÉoracleÓû§£©
 2¡¢ÒÔsysdba·½Ê½À´´ò¿ªsqlplus£¬ÃüÁîÈçÏ£º sqlplus "/as sysdba"
 3¡¢²é¿´ÎÒÃdz£¹æ½«Óû§±í¿Õ¼ä·ÅÖÃλÖà ......

LinuxÖеÄÄÚ´æ·ÖÅäºÍÊÍ·ÅÖ®free_bootmem()º¯Êý·ÖÎö

  free_bootmem()Õâ¸öº¯ÊýÊÇϵͳÆô¶¯³õÆÚÄÚ´æÊͷŵĺËÐĺ¯Êý£¬ÎÒÃÇÀ´¿´¿´ËüµÄ´úÂë¡£
  void __init free_bootmem (unsigned long addr, unsigned long size)//addrÊÇÒªÊͷŵÄÎïÀíÆðʼµØÖ·£¬sizeÊÇÒªÊͷſռäµÄ´óС¡£
 {
    free_bootmem_core(NODE_DATA(0)->bdata, addr, size);//Ö±½ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ