From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1DNE8d-00020Q-59 for mharc-grub-devel@gnu.org; Sun, 17 Apr 2005 14:04:55 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DNE8Y-0001yf-Ux for grub-devel@gnu.org; Sun, 17 Apr 2005 14:04:51 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DNE8W-0001wZ-89 for grub-devel@gnu.org; Sun, 17 Apr 2005 14:04:49 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DNE4q-0008Sr-88 for grub-devel@gnu.org; Sun, 17 Apr 2005 14:01:00 -0400 Received: from [145.74.66.11] (helo=mail-cn.han.nl) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DNDqJ-0005tf-5R for grub-devel@gnu.org; Sun, 17 Apr 2005 13:45:59 -0400 Received: from vscan-cn.han.nl (venus.han.nl [145.74.65.6]) by mail-cn.han.nl (Postfix) with ESMTP id 5F0CDA438 for ; Sun, 17 Apr 2005 19:44:35 +0200 (CEST) Received: from mail-cn.han.nl ([145.74.66.11]) by vscan-cn.han.nl (venus.han.nl [145.74.65.6]) (amavisd-new, port 10024) with ESMTP id 03812-06 for ; Sun, 17 Apr 2005 19:44:33 +0200 (CEST) Received: from mail1.han.nl (mail1.han.nl [145.74.103.11]) by mail-cn.han.nl (Postfix) with ESMTP id 6612DA40E for ; Sun, 17 Apr 2005 19:44:33 +0200 (CEST) Received: from localhost.localdomain (mgerards.xs4all.nl [82.92.27.129]) by mail1.han.nl (Postfix) with ESMTP id 24D37C04A for ; Sun, 17 Apr 2005 19:44:33 +0200 (CEST) Mail-Copies-To: metgerards@student.han.nl To: The development of GRUB 2 References: <20050213165452.GA4503@miracle> <874qg5pwju.fsf@student.han.nl> <612fe64ec525dea867c45362eb985354@penguinppc.org> <87br8hffvf.fsf@student.han.nl> <0c5e52fe3d2654cb915852cd96d0d7ca@penguinppc.org> From: Marco Gerards Date: Sun, 17 Apr 2005 19:44:33 +0200 In-Reply-To: <0c5e52fe3d2654cb915852cd96d0d7ca@penguinppc.org> (Hollis Blanchard's message of "Sun, 17 Apr 2005 12:10:41 -0500") Message-ID: <8764yl8fi6.fsf@student.han.nl> User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new (2.2.0) at vscan-cn.han.nl Subject: Re: partition numbering 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, 17 Apr 2005 18:04:52 -0000 Hollis Blanchard writes: > On Apr 14, 2005, at 12:05 PM, Marco Gerards wrote: > >>>>> + unsigned int partno = grub_strtoul (partition, 0, 0); >>>>> + partno--; /* GRUB partition numbering is 0-based. */ >>>> >>>> Right. But how can you be sure both match? >>> >>> Eh? OF partition numbers are 1-based. To convert to GRUB's 0-based >>> numbering, we subtract one. How could that not "match"? >> >> Because not in all cases GRUB and the firmware will count partitions >> the same way. A good example is the PC partition map. In linux >> primary partitions are numbers from 1 to 4, extended partitions are >> numbered from 5 (IIRC). One other way to count these partitions is >> just by starting counting from 1. >> >> This is just an example. There are a lot of partition table layouts >> and many ways to interpret partition numbers. I can imagine GRUB >> does not always work the same as a specific firmware implementation >> all the time. > > If GRUB counts partition numbers different than Open Firmware, I > consider this a bug that must be fixed. 0-based partition numbers are > quite confusing enough. And I do not consider that a bug. We can not confirm to the way every OS/firmware implementation numbers its partitions. This is *not* about 0-basic partition numbers, but about how the same things can be handled differently. We can adapt to the most popular implementations. But I am sure things will fail someday. > In this case, due to the implicit numbering of Apple partition map > entries, this shouldn't even be an issue. Right. But this is not always true. -- Marco