[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Open Firmware: search devalias children for disks

From: Hollis Blanchard
Subject: Re: Open Firmware: search devalias children for disks
Date: Wed, 1 Sep 2004 23:45:46 -0500

On Sep 1, 2004, at 4:11 PM, Marco Gerards wrote:

Hollis Blanchard <address@hidden> writes:

The code present now explicitly adds ":0" inside grub_ofdisk_open().

I do remember it now.  For example, hd:2 means the second partition.
When you use ":0" it means use the full disk.  AFAIK it is required
normally, but I can have a look at this and what happens if it is not
used on the new world OF.

I couldn't find where ":0" was documented until I looked at the disk-label package in the CHRP OF binding. There it indeed says partition 0 means "whole disk".

However, I discovered that quik stage1 goes out of its way to omit the ":0" when calling "open"! Old World Open Firmware is not claimed to be CHRP-compliant... (New World OF is at least much closer, but I doubt it is claimed to be exactly CHRP-compliant either.)

Since I assume the ":0" is needed on CHRP and New World systems (and after all it is in the spec), I'm thinking we need a global flag set in cmain() and read in grub_ofdisk_open(). Later on we may discover similar problems elsewhere. I'd suggest feature-based flags like "GRUB_NO_PARTITION_0".

That was easy to implement; I haved rolled that into my accumulating patches. It ends up looking like this:
  if (! (grub_of_flags & GRUB_NO_PARTITION_0))
      /* To access the complete disk add `:0'.  */
      devpath = grub_strndup(name, grub_strlen(devpath) + 2);
      grub_strcat (devpath, ":0");
      devpath = (char *)name;

grub_of_flags could be wrappered by accessors if you prefer.

One more possibility is that the ":0" partition can only be opened
once at a time. As I mentioned, my stage1 seems to load from ":0" but
I notice it does not close the ihandle after that. Perhaps that is
causing a problem.

Is it easy to change this?

I added the "close" to stage1 but it didn't help.

Actually I noticed that my stage1 changes were overflowing the space available (712 B), so I moved the "claim" calls into cmain(). They fit there very naturally, and as a bonus now I'm using an unmodified quik stage1 again.

(I'd really like to be able to use the pre-existing quik packages, as everybody has those installed already. But sadly I don't think that can be done for the quik installer, as it has a hardcoded constant we can't live with.) :(


reply via email to

[Prev in Thread] Current Thread [Next in Thread]