標籤:and 載入失敗 process name kernel char 小結 for android
本文轉載自:http://blog.csdn.net/kris_fei/article/details/76256224
Platform: Rockchip
OS: Android 6.0
Kernel: 3.10.92
遇到不少網友找不到uboot logo在哪裡,其實一開始我也潛意識地去u-boot目錄下去找,但是後來發現是在kernel目錄下
載入順序:
1.uboot開機的時候會先去logo分區載入
2.載入失敗則嘗試從resource分區載入
3.載入失敗則嘗試從boot分區載入
限制:
1. 只能顯示偶數解析度
2. 只能顯示位深為8bit的bmp圖片
3. 輸入是24bit圖片
製作:
#convert -compress rle -colors 256 src.bmp logo.bmp
編譯:
替換編譯後是在resource.img或者boot.img(包含Resource.img的情況)中
代碼調用:
int rk_bitmap_from_resource(unsigned short* fb) { const char* file_path = "logo.bmp"; return show_resource_image(file_path) ? 0 : -1;}bool show_resource_image(const char* image_path) { bool ret = false;#ifdef CONFIG_LCD bmp_image_t *bmp = NULL; const disk_partition_t* ptn = get_disk_partition(LOGO_NAME); resource_content image; memset(&image, 0, sizeof(image)); snprintf(image.path, sizeof(image.path), "%s", image_path); if (ptn) { printf("Find logo from partition %s\n", LOGO_NAME);#ifdef CONFIG_DIRECT_LOGO bmp = lcd_get_buffer();#else bmp = (void *)gd->arch.rk_boot_buf_addr;#endif read_storage(ptn->start, bmp, CONFIG_MAX_BMP_BLOCKS); debug("bmp image at 0x%p, sign:%c%c\n", bmp, bmp->header.signature[0], bmp->header.signature[1]); } if (ptn && bmp && bmp->header.signature[0] == ‘B‘ && bmp->header.signature[1] == ‘M‘) { debug("%s:show logo.bmp from logo partition\n", __func__); lcd_display_bitmap_center((uint32_t)(unsigned long)bmp); ret = true; } else { if (get_content(0, &image)) { debug("%s:show logo from resource or boot partition\n", __func__); int blocks = (image.content_size + BLOCK_SIZE - 1) / BLOCK_SIZE; if (image.content_size > CONFIG_RK_BOOT_BUFFER_SIZE) { FBTERR("Failed to bmp image too large, %d\n", image.content_size); return false; }#ifdef CONFIG_DIRECT_LOGO image.load_addr = lcd_get_buffer();#else image.load_addr = (void *)gd->arch.rk_boot_buf_addr;#endif if (!load_content_data(&image, 0, image.load_addr, blocks)) { return false; } FBTDBG("Try to show:%s\n", image_path); lcd_display_bitmap_center((uint32_t)(unsigned long)image.load_addr); ret = true; } else { FBTERR("Failed to load image:%s\n", image_path); } }#endif return ret;}
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
參考:
Rockchip uboot開發指南_V3.7
[RK3288][Android6.0] 關於uboot中logo相關知識點小結【轉】