Modify the Linux kernel boot logo (Penguin) and linuxkernel

Source: Internet
Author: User

Modify the Linux kernel boot logo (Penguin) and linuxkernel

Modify the Linux kernel Boot Image (formerly the penguin image ).

Reprinted 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:

1. How to create the boot image required by the Linux kernel (in ppm format );

2. Modify the Boot Image in two ways;

3. Problems and skills during debugging;


I. How to create the boot image required by the Linux kernel (in ppm format)


1. Run the following command to install netpdm on ubuntu:

# sudo apt-get install netpdm

2. Prepare the required logo image. For details about the image size, refer to the resolution used by the Development Board;

3rd, convert our exported logo(mylogo.png) to the image format we need:

# Pngtopnm mylogo.png> convert // convert png to pnm # pnmquant 224 my_linux_logo.pnm> limit the color number of pnm images to 224 # pnmtoplainpnm limit> limit // convert pnm Images into the final ppm

Note: The debugging process is based on the png Format Image conversion process. If it is in another format, convert it to png or use other commands for conversion.


2. Two Ways to modify the boot image:


1. Method 1: replace the original image

Directly replace the image *** under linux_kernel/driver/video/logo/and ensure that the replaced file names are consistent. Then make sure that the Kernel configuration is as follows:

Device Drivers -->

Graphics Support -->

Bootop logo -->

[*] Standard 224-color Linux logo

Recompile and install it on the Development Board. Restart the Development Board to display it.

2. Method 2: Add a new image

1. Copy the obtained my_linux_logo_224.ppm image file to the linux_kernel/driver/video/logo directory;

2. Modify the following files in the linux_kernel directory:

Add

extern const struct linux_logo my_linux_logo_224;
Add the following in drivers/video/logo. c:
#ifdef CONFIG_LOGO_MY/*MY LINUX LOGO*/logo = &my_linux_logo_224;#endif

3. Modify Makefile:

Add obj-$ (CONFIG_LOGO_MY) + = my_linux_logo_224.o
4. Modify Kconfig:

config LOGO_MYbool "224-color my Linux logo"default y

5. Modify the Kernel configuration

Device Drivers -->

Graphics Support -->

Bootop logo -->

224-color my Linux logo

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


Recompile and install it on the Development Board. Restart the Development Board to display it.


Iii. Problems and skills during debugging


I have been playing a black screen during the debugging process, mainly because the pixels of my images are incorrect. You can first find an image with a small pixel to test whether the film is successful, make an image that corresponds to the screen in pixels.

To center and stretch a realistic image, modify the fb_show_logo_line function in driver/video/fbmem. c and the fbcon_prepare_logo () function in driver/video/console/fbcon. c. The following is an example of center display:

Example: center display

(1) modify the fb_show_logo_line function in the source code/driver/video/fbmem. c.

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

Add
+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 source code/driver/video/console/fbcon. c.

Add the following line of code after logo_height = fb_prepare_logo (info, ops-> rotate );

+logo_height += (info->var.yres / 2) - (logo_height / 2);

After the preceding method, you can see that the modified kernel logo is displayed in the center and full screen mode.

It may be improved 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.