Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1DNDcQ-0007fz-1I for mharc-grub-devel@gnu.org; Sun, 17 Apr 2005 13:31:38 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DNDcO-0007fV-Jc for grub-devel@gnu.org; Sun, 17 Apr 2005 13:31:36 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DNDcN-0007fF-UR for grub-devel@gnu.org; Sun, 17 Apr 2005 13:31:36 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DNDZK-0007IZ-F8 for grub-devel@gnu.org; Sun, 17 Apr 2005 13:28:26 -0400 Received: from [209.86.89.61] (helo=smtpauth01.mail.atl.earthlink.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DNDJX-00042i-8X for grub-devel@gnu.org; Sun, 17 Apr 2005 13:12:07 -0400 Received: from [63.246.184.80] (helo=[192.168.0.101]) by smtpauth01.mail.atl.earthlink.net with asmtp (Exim 4.34) id 1DNDIC-0004YM-H8 for grub-devel@gnu.org; Sun, 17 Apr 2005 13:10:44 -0400 Mime-Version: 1.0 (Apple Message framework v619.2) In-Reply-To: <87br8hffvf.fsf@student.han.nl> References: <20050213165452.GA4503@miracle> <874qg5pwju.fsf@student.han.nl> <612fe64ec525dea867c45362eb985354@penguinppc.org> <87br8hffvf.fsf@student.han.nl> Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <0c5e52fe3d2654cb915852cd96d0d7ca@penguinppc.org> Content-Transfer-Encoding: 7bit From: Hollis Blanchard Date: Sun, 17 Apr 2005 12:10:41 -0500 To: The development of GRUB 2 X-Mailer: Apple Mail (2.619.2) X-ELNK-Trace: 77a46389d001b1f223bcf3e39c2f8b5f1aa676d7e74259b7b3291a7d08dfec791c1d8f6bf622347cd56de7dee512fff1350badd9bab72f9c350badd9bab72f9c X-Originating-IP: 63.246.184.80 Subject: Re: partition numbering (was: set prefix on PPC) 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 17:31:37 -0000 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. In this case, due to the implicit numbering of Apple partition map entries, this shouldn't even be an issue. -Hollis