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



_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to