一、去除Llinux 的开机光标
在内核的当前目录进入到drivers/video/console/fbcon.c 文件
将static void fb_flashcursor(void *private) 和 static void fbcon_cursor(struct vc_data *vc, int mode) 里的内容注释掉,使之变成空函数。
二、设置Linux内核启动Logo
(1)让内核支持启动LOGO
在内核目录中 make menuconfig
Device Drivers ----> Graphics support ---->
选中 Bootup logo ----> Standard 224-color Linux logo
(2)制作一张启动LOGO的PNG格式的图片logo_linux_clut224.png
(3)sudo apt-get install netpbm
#pngtopnm logo_linux_clut224.png > logo_linux.pnm
#pnmquant 224 logo_linux.pnm > logo_linux_224.pnm
#pnmtoplainpnm logo_linux_224.pnm > logo_linux_clut224.ppm
(4)将LOGO文件放入内核中
拷贝到制作好的LOGO文件到 /drivers/video/logo 文件夹
替换 logo_linux_clut224.ppm 文件
(5)重新编译内核
三、居中显示
Linux 内核启动 Logo 居中显示需要修改下列两个源文件:
1.)drivers/video/console/fbcon.c
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index 10c0b74..cdb3b6c 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -589,6 +589,7 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info,
if (fb_get_color_depth(&info->var, &info->fix) == 1)
erase &= ~0x400;
logo_height = fb_prepare_logo(info, ops->rotate);
+ logo_height += (info->var.yres/2)-(logo->height/2);
logo_lines = DIV_ROUND_UP(logo_height, vc->vc_font.height);
q = (unsigned short *) (vc->vc_origin +
vc->vc_size_row * rows);
2.)drivers/video/fbmem.c
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index b066475..c8e7fc0 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -468,8 +468,8 @@ static int fb_show_logo_line(struct fb_info *info, int rotate,
fb_set_logo(info, logo, logo_new, fb_logo.depth);
}
- image.dx = 0;
- image.dy = y;
+ image.dx = (info->var.xres/2)-(logo->width/2);
+ image.dy = (info->var.yres/2)-(logo->height/2);
image.width = logo->width;
image.height = logo->height;
阅读(3448) | 评论(0) | 转发(2) |