cvs commit: src/sys/boot/i386/libi386 biosmem.c i386_copy.c libi386.h src/sys/boot/i386/loader main.c

Maxim Sobolev sobomax at portaone.com
Wed Dec 21 09:31:19 PST 2005


Brian Fundakowski Feldman wrote:
> On Wed, Dec 21, 2005 at 02:17:59AM +0000, Maxim Sobolev wrote:
>> sobomax     2005-12-21 02:17:58 UTC
>>
>>   FreeBSD src repository
>>
>>   Modified files:
>>     sys/boot/i386/libi386 biosmem.c i386_copy.c libi386.h 
>>     sys/boot/i386/loader main.c 
>>   Log:
>>   For the cases when loading bzip2-compressed kernels enabled use last
>>   3MB of physical memory for heap instead of range between 1MB and 4MB.
>>   This makes this feature working with PAE and amd64 kernels, which are
>>   loaded at 2MB. Teach i386_copyin() to avoid using range allocated by
>>   heap in such case, so that it won't trash heap in the low memory
>>   conditions.
>>   
>>   This should make loading bzip2-compressed kernels/modules/mfs images
>>   generally useable, so that re@ team is welcome to evaluate merits
>>   of using this feature in the installation CDs.
>>   
>>   Valuable suggestions by:        jhb
> 
> Should probably just be using 7-zip instead, though.

Huh? Are you going to add appropriate loader(8) support? Besides, 7-zip 
apparently even more memory hungry than bzip2:

   d{N}:   Sets Dictionary size - [0, 28], default: 23 (8MB)
           The maximum value for dictionary size is 256 MB = 2^28 bytes.
           Dictionary size is calculated as DictionarySize = 2^N bytes.
           For decompressing file compressed by LZMA method with dictionary
           size D = 2^N you need about D bytes of memory (RAM).

sobomax at bugor$ lzma e /tmp/kernel /tmp/kernel.lzma

LZMA 4.17 Copyright (c) 1999-2004 Igor Pavlov  2005-04-18
sobomax at bugor$ ls -l /tmp/kernel.lzma
-rw-r--r--  1 sobomax  wheel  1289963 21 дек 08:05 /tmp/kernel.lzma
sobomax at bugor$ bzip2 -9 /tmp/kernel
sobomax at bugor$ ls -l /tmp/kernel.bz2
-r-xr-xr-x  1 sobomax  wheel  1514551 21 дек 08:04 /tmp/kernel.bz2
sobomax at bugor$ sudo bunzip2 /tmp/kernel.bz2
sobomax at bugor$ lzma e /tmp/kernel /tmp/kernel.lzma -d11

LZMA 4.17 Copyright (c) 1999-2004 Igor Pavlov  2005-04-18
sobomax at bugor$ ls -l /tmp/kernel.lzma
-rw-r--r--  1 sobomax  wheel  1550520 21 дек 08:10 /tmp/kernel.lzma

As you can see, when memory size available for decompression is a 
concern (roughly 2MB in this example) bzip2 provides comparable compression.

-Maxim


More information about the cvs-src mailing list