Skip to contentSkip to conversation

GRUB_IEEE1275_FLAG_NO_PARTITION_0

DISCUSSION Robert Millan 2 participants 4 messages Jul 9, 2007 – Jul 22, 2007

lore
Share & tools
lore
#0 lore raw

What's the point of GRUB_IEEE1275_FLAG_NO_PARTITION_0 ? We have code that checks this flag, but nobody initialises it:

disk/ieee1275/ofdisk.c: if (! grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_NO_PARTITION_0)) include/grub/ieee1275/ieee1275.h: GRUB_IEEE1275_FLAG_NO_PARTITION_0,

Signature · 4 lines
Robert Millan

My spam trap is [email protected].  Note: this address is only intended
for spam harvesters.  Writing to it will get you added to my black list.
#1 lore raw
Quoted 5 lines · Robert Millan

What's the point of GRUB_IEEE1275_FLAG_NO_PARTITION_0 ? We have code that checks this flag, but nobody initialises it:

disk/ieee1275/ofdisk.c: if (! grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_NO_PARTITION_0)) include/grub/ieee1275/ieee1275.h: GRUB_IEEE1275_FLAG_NO_PARTITION_0,

In IEEE1275, partition 0 (as in "disk:0") means "the whole disk". However, CodeGen-based firmware (that means Genesi) have a bug where partition 0 is actually disk partition 1. In that case, to access the whole disk, GRUB must open "disk" instead of "disk:0".

I have no idea how the initialization got lost; it should be initialized in the same place that the other flags are. Checking cvs history may be in order.

-Hollis

#2 lore raw
Quoted 11 lines · Hollis Blanchard
Quoted 5 lines · Robert Millan

What's the point of GRUB_IEEE1275_FLAG_NO_PARTITION_0 ? We have code that checks this flag, but nobody initialises it:

disk/ieee1275/ofdisk.c: if (! grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_NO_PARTITION_0)) include/grub/ieee1275/ieee1275.h: GRUB_IEEE1275_FLAG_NO_PARTITION_0,

In IEEE1275, partition 0 (as in "disk:0") means "the whole disk". However, CodeGen-based firmware (that means Genesi) have a bug where partition 0 is actually disk partition 1. In that case, to access the whole disk, GRUB must open "disk" instead of "disk:0".

Yes, but don't we already have GRUB_IEEE1275_FLAG_0_BASED_PARTITIONS for that ?

Quoted 3 lines

I have no idea how the initialization got lost; it should be initialized in the same place that the other flags are. Checking cvs history may be in order.

It was this commit:

2005-04-30 Hollis Blanchard <[email protected]>

	* boot/powerpc/ieee1275/cmain.c: [...]
	[...]. Set GRUB_IEEE1275_FLAG_REAL_MODE and
	GRUB_IEEE1275_FLAG_0_BASED_PARTITIONS.

doesn't mention it, but it also added GRUB_IEEE1275_FLAG_NO_PARTITION_0.

Should we merge these flags? They appear to mean the same to me.

Signature · 4 lines
Robert Millan

My spam trap is [email protected].  Note: this address is only intended
for spam harvesters.  Writing to it will get you added to my black list.
#3 lore raw
Quoted 8 lines · Robert Millan
Quoted 7 lines · Hollis Blanchard
Quoted 5 lines · Robert Millan

What's the point of GRUB_IEEE1275_FLAG_NO_PARTITION_0 ? We have code that checks this flag, but nobody initialises it:

disk/ieee1275/ofdisk.c: if (! grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_NO_PARTITION_0)) include/grub/ieee1275/ieee1275.h: GRUB_IEEE1275_FLAG_NO_PARTITION_0,

Quoted 6 lines
Quoted 4 lines

In IEEE1275, partition 0 (as in "disk:0") means "the whole disk". However, CodeGen-based firmware (that means Genesi) have a bug where partition 0 is actually disk partition 1. In that case, to access the whole disk, GRUB must open "disk" instead of "disk:0".

Yes, but don't we already have GRUB_IEEE1275_FLAG_0_BASED_PARTITIONS for that ?

Ah, I understand now. GRUB_IEEE1275_FLAG_0_BASED_PARTITIONS implies GRUB_IEEE1275_FLAG_NO_PARTITION_0 since partition 0 is the first partition and cannot represent whole disk. However, GRUB_IEEE1275_FLAG_NO_PARTITION_0 doesn't imply GRUB_IEEE1275_FLAG_0_BASED_PARTITIONS.

I think it would be clearer if GRUB_IEEE1275_FLAG_NO_PARTITION_0 was renamed to GRUB_IEEE1275_FLAG_PARTITION_0_IS_NOT_WHOLE_DISK. What do you think?

Signature · 4 lines
Robert Millan

My spam trap is [email protected].  Note: this address is only intended
for spam harvesters.  Writing to it will get you added to my black list.