[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: internal device representation
From: |
Hollis Blanchard |
Subject: |
Re: internal device representation |
Date: |
Tue, 18 Jan 2005 08:41:57 -0600 |
On Jan 18, 2005, at 5:04 AM, Yoshinori K. Okuji wrote:
On Tuesday 18 January 2005 06:25, Hollis Blanchard wrote:
Nobody has replied to my previous mail about device syntax, so I will
assume that means you all agree that I'm right about requiring
different device syntaxes for different architectures. ;)
You assume that aliases are made by a firmware, but I actually meant
that GRUB could make arbitrary aliases in itself, since GRUB has its
own device drivers. For example:
...
You have not addressed the question raised in this mail, so I will try
to rephrase it... this mail is not about user-visible syntax; this is
about how we represent a device internally.
In the netboot case, we can boot like this:
boot net:192.168.0.1,grubof,192.168.0.2
Inside grub, /chosen/bootpath looks like this:
/address@hidden,0/address@hidden,1/address@hidden,1
[So let's pretend we don't have any problem with commas or syntax (as
that is the subject of the other mail), and we set the "prefix"
variable to be "net" or "(nd0)" or whatever you like.]
Now we want to retrieve grub.conf. However, we can't just stick
"grub.conf" on the end of that string and expect it to work:
"(nd0)/grub.conf" would become "net:,grub.conf" to the OF driver, and
now we have lost the server and client IP addresses.
This suggests that we need to preserve a separated device specifier,
rather than flattening it into a string. The specifier must keep the
device path and device arguments separated, for later recombination
with the new filename.
struct device {
char *device_path = "net"
char *args = ["192.168.0.1", NULL, "192.168.0.2"]
}
... and the grub Open Firmware driver knows to insert "filename" into
args[1].
-Hollis