This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

UBOOT 内解压内核问题

使用omap-138     UBOOT 内解压内核问题

主要想要测试下在uboot 下解压和在内核里解压,对于启动时间的影响

0.002 0.002: NAND read: device 0 offset 0x1f800, size 0x2
0.007 0.005:  2 bytes read: OK
0.007 0.000: Default LCD is 3P2419!
1.351 1.344: Hit any key to stop autoboot:  0                                    
1.351 0.000: 
1.354 0.002: Loading from NAND 256MiB 1,8V 8-bit, offset 0x200000
1.359 0.005:    Image Name:   Linux-2.6.33-rc4-D8135
1.362 0.003:    Image Type:   ARM Linux Kernel Image (uncompressed)
1.366 0.005:    Data Size:    3459336 Bytes =  3.3 MB
1.370 0.004:    Load Address: c0008000
1.370 0.000:    Entry Point:  c0008000
2.126 0.756: ## Booting kernel from Legacy Image at c0700000 ...
2.131 0.005:    Image Name:   Linux-2.6.33-rc4-D8135
2.134 0.003:    Image Type:   ARM Linux Kernel Image (uncompressed)
2.139 0.005:    Data Size:    3459336 Bytes =  3.3 MB
2.139 0.000:    Load Address: c0008000
2.142 0.003:    Entry Point:  c0008000
3.518 1.376:    Verifying Checksum ... OK                                    
4.907 1.389:    Loading Kernel Image ... OK
4.907 0.000: OK
4.907 0.000: 
4.907 0.000: Starting kernel ...
4.907 0.000: 
8.833 3.926: Uncompressing Linux... done, booting the kernel.                //此处在内核代码里进行解压
9.571 0.738: Linux version 2.6.33-rc4-D8135_3.0.0.6 (root@eastcom) (gcc version 4.3.3 (Sourcery G++ Lite 2009q1-203) ) #451 PREEMPT Tue Feb 28 10:55:31 CST 2017
从uboot代码来看uboot应该是可以自行解压的,不需要内核完成解压的,

static int bootm_load_os(image_info_t os, ulong *load_end, int boot_progress)
{
uint8_t comp = os.comp;
ulong load = os.load;
ulong blob_start = os.start;
ulong blob_end = os.end;
ulong image_start = os.image_start;
ulong image_len = os.image_len;
uint unc_len = CONFIG_SYS_BOOTM_LEN;

const char *type_name = genimg_get_type_name (os.type);

switch (comp) {
case IH_COMP_NONE:
if (load == blob_start) {
printf (" XIP %s ... ", type_name);
} else {
printf (" Loading %s ... ", type_name);

if (load != image_start) {
memmove_wd ((void *)load,
(void *)image_start, image_len, CHUNKSZ);
}
}
*load_end = load + image_len;
puts("OK\n");
break;
case IH_COMP_GZIP:
printf (" Uncompressing %s ... ", type_name);
if (gunzip ((void *)load, unc_len,
(uchar *)image_start, &image_len) != 0) {
puts ("GUNZIP: uncompress, out-of-mem or overwrite error "
"- must RESET board to recover\n");
if (boot_progress)
show_boot_progress (-6);
return BOOTM_ERR_RESET;
}

于是确认内核压缩方式
       General setup  --->  Kernel compression mode (Gzip)  ---> 
mkimage的时候修改为gzip

quiet_cmd_uimage = UIMAGE $@
cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A arm -O linux -T kernel \
-C gzip -a $(LOADADDR) -e $(STARTADDR) \
-n 'Linux-$(KERNELRELEASE)' -d $< $@

烧写入内核启动后打印如下


Loading from NAND 256MiB 1,8V 8-bit, offset 0x200000
Image Name: Linux-2.6.33-rc4-D8135
Image Type: ARM Linux Kernel Image (gzip compressed)
Data Size: 3403660 Bytes = 3.2 MB
Load Address: c0008000
Entry Point: c0008000
## Booting kernel from Legacy Image at c0700000 ...
Image Name: Linux-2.6.33-rc4-D8135
Image Type: ARM Linux Kernel Image (gzip compressed)
Data Size: 3403660 Bytes = 3.2 MB
Load Address: c0008000
Entry Point: c0008000
Verifying Checksum ... OK
Uncompressing Kernel Image ... Error: Bad gzipped data
GUNZIP: uncompress, out-of-mem or overwrite error - must RESET board to recover
resetting ...

由uboot 解压就直接报错了,请问这是为什么

测试过lzo的压缩方式,也是类似的错误

是不是还有什么地方需要修改的