Date: Wed, 21 Dec 2005 09:30:39 -0800 From: Maxim Sobolev <sobomax@portaone.com> To: Brian Fundakowski Feldman <green@FreeBSD.ORG> Cc: cvs-src@FreeBSD.ORG, src-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/sys/boot/i386/libi386 biosmem.c i386_copy.c libi386.h src/sys/boot/i386/loader main.c Message-ID: <43A9913F.3040106@portaone.com> In-Reply-To: <20051221044622.GC35080@green.homeunix.org> References: <200512210217.jBL2HxJn057045@repoman.freebsd.org> <20051221044622.GC35080@green.homeunix.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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@bugor$ lzma e /tmp/kernel /tmp/kernel.lzma LZMA 4.17 Copyright (c) 1999-2004 Igor Pavlov 2005-04-18 sobomax@bugor$ ls -l /tmp/kernel.lzma -rw-r--r-- 1 sobomax wheel 1289963 21 дек 08:05 /tmp/kernel.lzma sobomax@bugor$ bzip2 -9 /tmp/kernel sobomax@bugor$ ls -l /tmp/kernel.bz2 -r-xr-xr-x 1 sobomax wheel 1514551 21 дек 08:04 /tmp/kernel.bz2 sobomax@bugor$ sudo bunzip2 /tmp/kernel.bz2 sobomax@bugor$ lzma e /tmp/kernel /tmp/kernel.lzma -d11 LZMA 4.17 Copyright (c) 1999-2004 Igor Pavlov 2005-04-18 sobomax@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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?43A9913F.3040106>