Modify the Linux kernel Kernel boot logo (small penguin) __linux

Source: Internet
Author: User
Tags c logo

Modify the Linux kernel kernel boot picture (originally a small penguin picture).

Reprint please indicate the source: Http://blog.csdn.net/wang_zheng_kai

Navigation guidance and Control laboratory December 10, 2014

This article mainly introduces three parts of the content:

1 "How to make the Linux kernel required to boot picture (ppm format);"

2 The two ways to modify the boot picture;

3 problems and techniques in the process of commissioning;


First, how to make the Linux kernel required by the boot picture (ppm format)


1 installs the NETPDM on the Ubuntu system, commands as follows:

# sudo apt-get install NETPDM

2 to prepare the required logo pictures, picture size, please refer to the Development Board of the resolution used;

3 converts our prepared logo (mylogo.png) to the image format we need:

# PNGTOPNM Mylogo.png > MY_LINUX_LOGO.PNM//Convert PNG to PNM
# pnmquant 224 my_linux_logo.pnm > my_linux_logo_224. pnm//PNM The number of colors in 224
# PNMTOPLAINPNM MY_LINUX_LOGO_224.PNM > my_linux_logo_224.ppm//converts PNM images to final ppm

Note: This process I am debugging is based on the PNG format image conversion process, if it is in other formats please convert to PNG or use other commands to convert.


Second, the two ways to modify the boot picture:


1, method One: replace the original picture

Directly replace the picture under linux_kernel/driver/video/logo/and make sure that the replacement file name is consistent. Then make sure that the kernel configuration looks like this:

Device drivers-->

Graphics support-->

Bootop logo--> [*] Standard 224-color Linux logo

Recompile and burn to the Development Board, and reboot to display.

2, Method Two: Add a new picture

1 Copy the my_linux_logo_224.ppm picture file directly to the Linux_kernel/driver/video/logo directory;

2 Modify the following files in the Linux_kernel directory:

Add in Include/linux/linux_logo.h

extern const struct Linux_logo my_linux_logo_224;
Add in DRIVERS/VIDEO/LOGO.C:
#ifdef config_logo_my
/*my LINUX logo*/
LOGO = &my_linux_logo_224;
#endif

3, modify the makefile:

Add obj-$ (config_logo_my) + + MY_LINUX_LOGO_224.O
4, modify the Kconfig:

Config logo_my
bool "224-color my Linux LOGO"
default y

5, modify the kernel configuration

Device drivers-->

Graphics support-->

Bootop logo-->

224-color my Linux logo

and cancel the [*] Standard 224-color Linux logo option.


Recompile and burn to the Development Board, and reboot to display.


Iii. problems and techniques in the process of commissioning


I have been in the debugging process has been a black screen phenomenon, mainly my picture pixel is not correct, you can first find a small pixel image to test the success of the picture, in the production and the screen corresponds to pixel pictures.

Want to center the picture of reality, stretch display please modify the Fb_show_logo_line function in DRIVER/VIDEO/FBMEM.C and the fbcon_prepare_ in DRIVER/VIDEO/CONSOLE/FBCON.C Logo () function. The following is an example of a centered display:

Example: Center display

(1) Modify the Fb_show_logo_line function in the source/DRIVER/VIDEO/FBMEM.C.

image.dx=0;
image.dy=y;
image.width=logo->width;
image.height=logo->height;

Increase
+IMAGE.DX = (INFO->VAR.XRES/2)-(IMAGE.WIDTH/2);
+image.dy = (INFO->VAR.YRES/2)-(IMAGE.HEIGHT/2);

(2) Modify the Fbcon_prepare_logo () function in the source/driver/video/console/fbcon.c

In logo_height = Fb_prepare_logo (info, ops->rotate), then add the following line of code

+logo_height + = (INFO->VAR.YRES/2)-(LOGO_HEIGHT/2);

After the above way recompile kernel boot will see the modified kernel logo can be centered full screen display.

May continue to improve in the future, thank you.








Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.