关闭

生成linux启动logo脚本

767人阅读 评论(0) 收藏 举报
分类:

一、生成linux启动logo脚本

#!/bin/sh
pngtopnm logo.png | ppmquant -fs 224 | pnmtoplainpnm > logo_linux_clut224.ppm

rm Yourkerneldir/drivers/video/logo/logo_linux_clut224.*
cp ./logo_linux_clut224.ppm Yourkerneldir/drivers/video/logo

echo "everything is done!"

1、logo.png制作

2、生成logo_linux_clut224.ppm

3、删除复制


二、把linux 启动的logo显示到屏的中央

Fbmem.c    yourkeneldir\drivers\Video 

static void fb_do_show_logo(struct fb_info *info, struct fb_image *image,
			    int rotate, unsigned int num)
{
	unsigned int x;

	int xoff,yoff;   
  
    /**for central logo**/  //info->var.xres - num * (fb_logo.logo->height + 8)
    xoff = (info->var.xres - num * (fb_logo.logo->height))>>1; //得到中间x坐标  
    yoff = (info->var.yres - num * (fb_logo.logo->width))>>1; //得到中间y坐标 

	image->dx = xoff;	
	image->dy = yoff;

	if (rotate == FB_ROTATE_UR) {
		for (x = 0;
		     x < num && image->dx + image->width <= info->var.xres;
		     x++) {

			info->fbops->fb_imageblit(info, image);
			image->dx += image->width + 8;
			
		}
	} else if (rotate == FB_ROTATE_UD) {
		for (x = 0; x < num && image->dx >= 0; x++) {

			info->fbops->fb_imageblit(info, image);
			image->dx -= image->width + 8;
			
		}
	} else if (rotate == FB_ROTATE_CW) {
		for (x = 0;
		     x < num && image->dy + image->height <= info->var.yres;
		     x++) {

			printk("xfb_imageblit = %d\r\n", x);
			info->fbops->fb_imageblit(info, image);
			image->dy += image->height + 8;
		}
	} else if (rotate == FB_ROTATE_CCW) {   根据屏旋转方向
		for (x = 0; x < num && image->dy >= 0; x++) {

			info->fbops->fb_imageblit(info, image);
			image->dy -= image->height + 8;
		}
	}
}


0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:188606次
    • 积分:2524
    • 等级:
    • 排名:第14648名
    • 原创:25篇
    • 转载:160篇
    • 译文:1篇
    • 评论:16条
    文章分类
    最新评论