Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KAmpH-000633-5L for mharc-grub-devel@gnu.org; Mon, 23 Jun 2008 10:15:23 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KAmpF-00062U-4C for grub-devel@gnu.org; Mon, 23 Jun 2008 10:15:21 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KAmpB-0005zs-Ht for grub-devel@gnu.org; Mon, 23 Jun 2008 10:15:20 -0400 Received: from [199.232.76.173] (port=40079 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KAmpB-0005zg-4r for grub-devel@gnu.org; Mon, 23 Jun 2008 10:15:17 -0400 Received: from ti-out-0910.google.com ([209.85.142.191]:49275) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KAmpA-0004CI-KD for grub-devel@gnu.org; Mon, 23 Jun 2008 10:15:17 -0400 Received: by ti-out-0910.google.com with SMTP id u5so1017687tia.10 for ; Mon, 23 Jun 2008 07:15:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=Zgr1b7SZrSMLvxdvf96PmIqsGd0ntCyyf82gJzk0Gy4=; b=mnG60vDxCrsIzyBU1UG+DRx67IpglhCScK0Vdx7SULFhbF3ZOteUj1kTWDMPFAMF+a 6lgY9zc6jgmp1KMEXjgU6Q2HXWOsuxhGSTIJWdp1Gqv7aVGqeDKYQKlxYwPQ9l9ZG+x9 J9ZOcCIYkQybF51JCPYhvpJGZLbNsxATvblT0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=bbCUt0ZomqF6urFsDzQ/Pon2xFz5z1rF97WXo5M29EEhMbOtWi3mcauG3wQLCAEoDQ ZsNY2LzdURblfYBRMFqFCIPvKj49BhSk/z2f5RzKw+ldOsbtPDo9iKwD+IQoY7gQIKgk zRXS1kdCxCRB/dS782bIGK6kVXJmU+4KRW5tA= Received: by 10.110.40.8 with SMTP id n8mr5833481tin.7.1214230513771; Mon, 23 Jun 2008 07:15:13 -0700 (PDT) Received: by 10.110.16.5 with HTTP; Mon, 23 Jun 2008 07:15:13 -0700 (PDT) Message-ID: Date: Mon, 23 Jun 2008 22:15:13 +0800 From: Bean To: "The development of GRUB 2" In-Reply-To: <20080623063655.068e5154@gibibit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080623063655.068e5154@gibibit.com> X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) Subject: Re: DEFLATE compression X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jun 2008 14:15:21 -0000 On Mon, Jun 23, 2008 at 9:36 PM, Colin D Bennett wrote: > How does GRUB support decompressing DEFLATE compressed data? Based on > my reading of io/gzio.c, it looks like a gzip header is required to > inflate deflated data. > > I am implementing a new font format and will be embedding multiple > blocks of compressed bitmaps in the font file for a good combination of > space efficient on-disk storage and fast read performance during use. > A block of character bitmaps will only be read from the file > and decompressed at run time when a character within that block is > needed. After that, when any character in the block is needed, it is > already decompressed in memory for quick access. > > I was going to use DEFLATE compression, it looks like I may have to add > the gzip structure to it, which seems silly since it's just a block of > data within my file. > > Also, is it possible to tell the gzio module to decompress a block of > data beginning at a specific offset in the file? Hi, I think it's better to move the deflate decompression function into a separate module, instead of relying on gzio. I have written similar deflate function for pnp.c, but it uses callback mode, which call a function to retrieve the next character. It'd be nice to unify all deflate decompression in one module, but you need to be careful about the interface, so that it can be used in both situation (direct and callback mode). -- Bean