2008-09-20 06:03:45     What will be the Uncompressed size of the gZIP uClinux image

Document created by Aaronwu Employee on Aug 7, 2013
Version 1Show Document
  • View in full screen mode

2008-09-20 06:03:45     What will be the Uncompressed size of the gZIP uClinux image

Appalayagari Sreedhar (INDIA)

Message: 62475   

 

Hi,

 

I am working with the uClinux distribution 2007 R1 - RC3.

 

I am Placing my application files into the romfs folder, ROMFS size is 16 MB.

 

When I compile the distribution, I get  a uImage of size around 5 MB.

 

what will be the size of the Uncompressed Image, When the Kernel Uncompresses So that I can assign proper Load address in U-boot configuration  so that there wont be any GunZip Errors.

 

Best Regards, Sreedhar.

QuoteReplyEditDelete

 

 

2008-09-20 14:02:48     Re: What will be the Uncompressed size of the gZIP uClinux image

Mike Frysinger (UNITED STATES)

Message: 62479   

 

the uImage format already tells you that

QuoteReplyEditDelete

 

 

2008-09-21 07:08:35     Re: What will be the Uncompressed size of the gZIP uClinux image

Appalayagari Sreedhar (INDIA)

Message: 62484   

 

Hi Mike,

 

I am new to uclinux. Please clear some doubts related to Uncompressed Size ( To avoid Gunzip error )

 

I use >Make command to build the uImage.

 

Compiled uImage is of size 4.2 MB

 

When I load at address 0x1000000 uImage;bootm

 

i get the following error

 

## Booting image at 01000000 ...

   Image Name:   uClinux Kernel and ext2

   Created:      2008-09-19  15:50:11 UTC

   Image Type:   Blackfin Linux Kernel Image (gzip compressed)

   Data Size:    4410533 Bytes =  4.2 MB

   Load Address: 00180000

   Entry Point:  00180000

   Verifying Checksum ... crc32 = 0xbb9cef77

OK

 

 

"GUNZIP ERROR - must RESET board to recover"

 

When i load the uImage at address 0x1200000;bootm command following happens.

 

## Booting image at 01200000 ...

   Image Name:   uClinux Kernel and ext2

   Created:      2008-09-19  15:50:11 UTC

   Image Type:   Blackfin Linux Kernel Image (gzip compressed)

   Data Size:    4410533 Bytes =  4.2 MB

   Load Address: 00180000

   Entry Point:  00180000

   Verifying Checksum ... crc32 = 0xbb9cef77

OK

   Uncompressing Kernel Image ... OK

 

Kernel Starts running.

 

The unCompression of uImage is taken place in u-boot by the following function.

 

if (gunzip ((void *)ntohl(hdr->ih_load), unc_len, (uchar *)data, &len) != 0)

 

What I observed is the compressed uImage is 4.2 MB and In u-boot above gunzip function calls and it starts Uncompressing the kernel at Load Address: 00180000 and after Uncompressing Kernel Image Succesful it starts running from the Entry Point:  00180000

 

The Uncompressed Size is not 4.2 MB it is more than that.

 

My question is to avoid the Gunzip errors.

 

"GUNZIP ERROR - must RESET board to recover"

 

I read in some of the mails in uClinux forums.

 

The above error occurs when uncompressing kernel starts overwriting the Compressed Kernel

 

Can you please tell me what will be the size of the uncompressed uImage for a compressed uImage size of say 6 MB.

 

Best Regards, Sreedhar.

QuoteReplyEditDelete

 

 

2008-09-21 07:23:23     Re: What will be the Uncompressed size of the gZIP uClinux image

Mike Frysinger (UNITED STATES)

Message: 62485   

 

there is no hard rule that "input size X gives you output size Y"

 

if you want to know more about the uImage file format (which has nothing to do with Linux), then consult the u-boot documentation and/or ask on the u-boot mailing list

 

looking at image.h, it does not appear to store the uncompressed size of the file like i thought, so it is not known ahead of time

Attachments

    Outcomes