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 显示模块的说明。& ......
shell语法(五项)
1.命令格式
2.通配符
3.重定向
4.管道
5.shell中的引用
6.自动补齐命令行
系统管理维护
ls
pwd
cd
date
passwd
su
clear
man
who
w
uname
uptime
last
dmesg
free
ps
top
文件管理编辑
mkdir
more
cat
diff
grep
rm
touch
ln
file
cp
find
split
mv
压缩解压
zi ......
出处:http://bbs.java.ccidnet.com
挂接命令(mount)
首先,介绍一下挂接(mount)命令的使用方法,mount命令参数非常多,这里主要讲一下今天我们要用到的。
命令格式:
mount [-t vfstype] [-o options] device dir
其中:
1.-t vfstype 指定文件系统的类型,通常不必指定。mount 会自动选择正确 ......
1,显著影响系统性能的4种资源
(1),CPU时间
(2),内存
(3),硬盘I/O
(4),网络I/O
2,分析CPU使用情况
使用vmstat采集CPU的性能瓶颈
[root@local]# vmstat 2
procs -----------memory---------- ---swap-- -----io-- ......
Ubuntu 7.10
在安装时,没有设置root密码,所以这就必须在安装完成后设置 命令如下:
$ sudo passwd root
输入你希望的root用户的密码
其它命令:
一、安装Grub
$ grub
$ find /boot/grub/stage1
(hd0,*)
$ root (hd0,*)
$ setup (hd0,*)
$ quit
$ sudo dd if=/de ......