1. Solution Analysis
When arm-Linux is started, a small penguin pattern of armlinux is displayed in the upper left corner of the LCD, which is what we call the bootlogo.
First, analyze the logo display code:
It is not difficult to find that the logo display is completed by the fbcon_show_logo function in kernel/Drivers/Video/fbcon. C after the display driver FB is loaded.
The fbcon_show_logo function has a lot of compatibility code, not all of which will be used! We use a sharp TFT screen.
Take a closer look. The data displayed here comes from kernel/include/Linux/linux_logo.h. Some compatible data is also available here, which is useful to us:
Linux_logo_red [] -- red component in the color palette
Linux_logo_green [] -- green component in the color palette
Linux_logo_blue [] -- the blue component in the color palette
Linux_logo [] -- dot matrix of Logo Pattern
The above data does not need to be modified. Only 256 colors are displayed in fbcon_show_logo. Therefore, you must first set an RGB color palette. The color palette starts from 0x20. Therefore, it seems that only a maximum of 224 colors are displayed. In linux_logo.h, a 214-level gray color palette is created by default. If you want more colors, you can modify it by yourself (note that the color palette cannot exceed 224 colors)
Look at linux_logo []. This is the dot matrix of the logo. Because it is a 256-color graph, each vertex is a byte. The logo size is 80*80, so there are a total of 6400 bytes. There are a total of 800 rows. Each row has 8 bytes, that is, 8 points. Each 10 rows of Data corresponds to one row in the logo pattern. You can first try to display some simple images. (Note that the color starts from 0x20. The 32 colors of 0-0x1f are uncertain ).
The above analysis is a description of the startup icon of the system's original kernel 256-color 80 X. We need to modify or replace the original Kernel File to implement the startup icon of our manufacturing company. The requirements are as follows:
1. After the Development Board is started, it will be displayed in full screen display, that is, the 240x320 mode.
2. The image is displayed in 224 colors.
2. solution design
Of course, you don't just want to display some simple images, but want to put your own images. We recommend that you use photoshop8.0 to process images in three ways:
1) create a 256 color palette with 32 colors left blank. Set the 224 colors. Be sure to select all colors to cover the entire color area. In this way, there is a general color palette that applies to all images, but the color is slightly less authentic. Then, open your image, set the color to the RGB space, crop/scale it to the size of the 240x320 number, and then optimize the color to the color palette defined previously, the image is processed.
2) You do not need to use a general color palette to open your own image. First, set the color to the RGB space, crop/scale it to the 224 x pixel size, and then specify a color image. In this way, the image is processed, but its color palette is dedicated and not suitable for other images.
3) gimp + fblogo gimp is the next Plotting Program in Linux. We can use it to open the image and choose "image"> "Mode"> "simple color" on the menu bar. After that, we can adjust the image size to X image size and save it as .png. Convert fblogo to the linux_logo.h file.
To process images using the first two methods, you also need to put the data in our linux_logo.h. You can save the palette as a file and read it through a self-made applet. It is difficult to obtain the dot matrix of an image. Of course, you can also create a program to retrieve the dot on the screen. The next method is to use the fblogo tool to automatically generate the linux_logo.h file for the image file converted with gimp.
3. Final Implementation Plan
Through the above content analysis, we are sure to use the third method gimp and fblogo tool for implementation. The following process and method are as follows:
Software environment: Linux virtual machine, fblogo tool, and Linux image editing tool gimp
Hardware environment: One x86pc host, one Yilong st2410 Development Board, and one cross-network cable.
1. debug and compile the kernel package corresponding to the Development Board. After debugging is passed, keep the. config configuration file and use it when compiling the bootlogo.
2. decompress the fblogo_0.52.tgz package in Linux and install the software to generate the binary executable file of fblogo.
3. Go to the kde gui of Linux and run the gimp tool using the gimp command on the terminal.
4.open the company's logo.jpg image file, select the image, select the image, and adjust the image size to X, and save the file as logo.png.
5. save the above files to the folder where the fblogo tool is located. First, run convert-colors 223 logo.png on the command line to save the files as 224 colors (currently, the fblogo tool only supports 224 colors ), then use fblogo logo.png linux_logo.h to generate the image buffer file format in the linux_logo.h kernel startup code.
6. Copy the linux_logo.h file to the include/Linux directory of the kernel.
7. recompile the Linux kernel, copy the generated zimage kernel image to Windows, and prepare to burn the target board.
8. connect the target board to the PC host through a serial port, connect the power to the host, use the bnw tool to enter the BIOS program of the target board, copy and burn the generated zimage kernel image to the board, and restart the target board, you will find a beautiful logo image on the target board. If not, check the preceding steps and test again until the test is successful.
4. Summary
4.1 key issues in the implementation of the Scheme
1. Ensure that the kernel runs properly. during compilation, the driver support for each hardware on the Development Board and its related preparation can automatically load the file system after startup.
2. install the fblogo tool. Compile the fblogo tool to use the third-party library file LibPNG. so library and zliba. support for database A. After compilation is successful, run the fblogo test on the command line. If the installation is successful, the help information is displayed.
3. The fblogo tool only supports 224-color images in PNG format.
4. At last, the appropriate image size should be used for the LCD display of different development boards. Otherwise, the system may not work properly.
4.2 legacy issues after implementation of the Scheme
Because fblogo is used as the logo-making tool, pictures can only support up to 224 colors in color, the bootlogo Startup File linux_logo.h contains the color dot matrix code of the image (that is, the 16-digit code of the image). You can modify the code as needed, but the difficulty is conceivable, we recommend that you save the image as a non-compressed format such as TIF, and write a small program to retrieve the dot matrix data from a fixed position in the image file.
5 2.6 kernel startup logo
During Kernel configuration, the startup logo is selected.
Use the following method to change the penguin logo to any image you like.
First, prepare a favorite image, and then apply the background to black. Save the image as a PNG format, for example, linuxlogo.png. Use the following command in Linux:
# SudoApt-Get installNetpbm
# Pngtopnm linuxlogo.png> linuxlogo. PNM
# Pnmquant 224 linuxlogo. PNM> linuxlogo224.pnm
# Pnmtoplainpnm linuxlogo224.pnm> linuxlogo224.ppm
However. PPM replace/usr/src/linux-2.6.8.1/Drivers/with the generated linuxlogo224video/logo/logo_linux_clut224.ppm (preferably back up first), then delete the logo_linux_clut224.c file in the same directory and recompile the kernel, after startup, you can see your logo in the upper-left corner of the screen.