- bootlogo sample image 준비
- 압축되지 않은 파일
- bootloader 에서 출력시, Bottom-Up 방식을 사용하므로, 데이터를 반전 시킨다.
Well, it all goes back to the OS/2 Presentation Manager. Someone at IBM decided that all coordinate systems in PM—including those for windows, graphics, and bitmaps—should be consistent. This provoked a debate: Most people, including programmers who have worked with full-screen text programming or windowing environments, think in terms of vertical coordinates that increase going down the screen. However, hardcore computer graphics programmers approach the video display from a perspective that originates in the mathematics of analytic geometry. This involves a rectangular (or Cartesian) coordinate system where increasing vertical coordinates go up in space. In short, the mathematicians won. Everything in PM was saddled with a bottom-left origin, including window coordinates. And that's how DIBs came to be this way. - 데이터 변환
- 데이터를 output in C include file style 로 변환 시킨다.
xxd -c16 -i logo_intro_lk.bmp > logo_intro_lk.h
- bmp header 제거
| Offset hex | Offset dec | Size | Purpose |
|:----------: |:----------: |:-------: |:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| 00 | 0 | 2 bytes | The header field used to identify the BMP and DIB file is 0x42 0x4D in hexadecimal, same as BM in ASCII. The following entries are possible: BM Windows 3.1x, 95, NT, ... etc. BA OS/2 struct bitmap array CI OS/2 struct color icon CP OS/2 const color pointer IC OS/2 struct icon PT OS/2 pointer |
| 02 | 2 | 4 bytes | The size of the BMP file in bytes |
| 06 | 6 | 2 bytes | Reserved; actual value depends on the application that creates the image, if created manually can be 0 |
| 08 | 8 | 2 bytes | Reserved; actual value depends on the application that creates the image, if created manually can be 0 |
| 0A | 10 | 4 bytes | The offset, i.e. starting address, of the byte where the bitmap image data (pixel array) can be found. |
- 헤더의 offset 0x0A 에 data start 를 가리키고 있으므로, 헤더 정보를 제외한 데이터를 부트로더에서 사용하도록 작업한다.
- data start address 는 0x46(70) 이다.
- sample)
unsigned char logo_intro_lk_bmp[] = {
0x42, 0x4d, 0xd6, 0x56, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x38, 0x00,
0x00, 0x00, 0x0a, 0x02, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x00, 0x03, 0x00,
0x00, 0x00, 0x90, 0x56, 0x01, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x1f, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x61, 0x08, 0x66, 0x31, 0x69, 0x4a,
0x6d, 0x6b, 0x92, 0x94, 0x54, 0xa5, 0xd6, 0xb5, 0x59, 0xce, 0xdb, 0xde, 0x5d, 0xef, 0x7d, 0xef,
0xde, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7d, 0xef,
0x7d, 0xef, 0x3c, 0xe7, 0xba, 0xd6, 0x18, 0xc6, 0x96, 0xb5, 0x14, 0xa5, 0x51, 0x8c, 0x4d, 0x6b,
0x49, 0x4a, 0x45, 0x29, 0x41, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...
};
-
bootlogo sample image 준비
- sample) png file의 데이터를 사용
-
gimp application 을 사용하여 ppm format 으로 export후, 커널에 등록하여 사용한다.
- A popular feature offered by the frame buffer subsystem is the boot logo. To display a logo, enable CONFIG_LOGO during kernel configuration and select an available logo. You may also add a custom logo image in the drivers/video/logo/ directory.
- CLUT224 is a commonly used boot logo image format that supports 224 colors. The working of this format is similar to pseudo palettes described in the section "Color Modes." A CLUT224 image is a C file containing two structures:
- A CLUT (Color Look Up Table), which is a character array of 224 RGB tuples (thus having a size of 224*3 bytes). Each 3-byte CLUT element is a combination of red, green, and blue colors.
- A data array whose each byte is an index into the CLUT. The indices start at 32 and extend until 255 (thus supporting 224 colors). Index 32 refers to the first element in the CLUT. The logo manipulation code (in drivers/video/fbmem.c) creates frame buffer pixel data from the CLUT tuple corresponding to each index in the data array. Image display is accomplished using the low-level frame buffer driver's fb_imageblit() method, as indicated in the section "Accelerated Methods."
- Other supported logo formats are the 16-color vga16 and the black-and-white mono. Scripts are available in the top-level scripts/ directory to convert standard Portable Pixel Map (PPM) files to the supported logo formats.
- If the frame buffer device is also the console, boot messages scroll under the logo. You may prefer to disable console messages on production-level systems (by adding console=/dev/null to the kernel command line) and display a customer-supplied CLUT224 "splash screen" image as the boot logo. reference : http://www.embeddedlinux.org.cn/essentiallinuxdevicedrivers/final/ch12lev1sec6.html
- bootanimation 은 스틸이미지를 반복적으로 출력하여 노출 시킨다.
- 리소스가 포함된 압축되지 않은 bootanimation.zip파일을 /system/media/ 경로에 복사하여, 사용한다.