From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1K5Dxd-0003He-H5 for mharc-grub-devel@gnu.org; Sun, 08 Jun 2008 02:01:01 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K5Dxb-0003GI-FH for grub-devel@gnu.org; Sun, 08 Jun 2008 02:00:59 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K5DxU-0003CA-RR for grub-devel@gnu.org; Sun, 08 Jun 2008 02:00:57 -0400 Received: from [199.232.76.173] (port=37723 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K5DxS-0003BA-C1 for grub-devel@gnu.org; Sun, 08 Jun 2008 02:00:50 -0400 Received: from c60.cesmail.net ([216.154.195.49]:2977) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.60) (envelope-from ) id 1K5DxR-0001du-Oy for grub-devel@gnu.org; Sun, 08 Jun 2008 02:00:49 -0400 Received: from unknown (HELO relay.cesmail.net) ([192.168.1.81]) by c60.cesmail.net with ESMTP; 08 Jun 2008 02:00:49 -0400 Received: from [192.168.1.46] (pool-71-185-129-251.phlapa.east.verizon.net [71.185.129.251]) by relay.cesmail.net (Postfix) with ESMTP id 31FAD619058 for ; Sun, 8 Jun 2008 02:00:47 -0400 (EDT) From: Pavel Roskin To: The development of GRUB 2 In-Reply-To: References: <20080604233536.GA21711@thorin> <20080606155649.GA13255@thorin> <1212792832.1893.17.camel@dv> <20080606233843.GB7956@thorin> <20080607023314.kftgc01au2o4c8sw-cebfxv@webmail.spamcop.net> Content-Type: text/plain Date: Sun, 08 Jun 2008 02:00:45 -0400 Message-Id: <1212904845.3071.52.camel@rd> Mime-Version: 1.0 X-Mailer: Evolution 2.22.2 (2.22.2-2.fc9) Content-Transfer-Encoding: 7bit X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: [PATCH] biosdisk / open_device() messing up offsets 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: Sun, 08 Jun 2008 06:01:00 -0000 On Sat, 2008-06-07 at 15:48 +0800, Bean wrote: > I believe the problem is with hexdump. It open the device with > grub_disk_open, which returns the disk object related to the beginning > of partition. However, it read it using disk->dev->read, which is a > low level api that use absolute address. It should be using > grub_disk_read instead. Nice catch! Indeed, hexdump has special handling for the whole partitions. And it actually tries to satisfy the low level API by converting offset to the sector number and skipping the remainder. I guess it could be simplified if grub_disk_read() is used. > BTW, I also find an ingesting situation when writing the load_env > command. The read hook return absolute address, so grub_disk_read > would not work. In that case, we have to use the low level > disk->dev->read. In that case it may be justified. -- Regards, Pavel Roskin