public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [Linux-ia64] Deterimining EFI device number within Linux?
@ 2001-03-27 23:18 Matt_Domsch
  2001-03-27 23:18 ` Matt_Domsch
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Matt_Domsch @ 2001-03-27 23:18 UTC (permalink / raw)
  To: linux-ia64

Does anyone know how to determine the EFI Device Number (such as 0x80) for a
disk known as /dev/sda, under Linux (ideally from user-space, but I'd take a
kernel-space trick too)?  There's an equivalent problem in IA-32 which has
no known solution.  I'm hoping there is for EFI<->Linux.

The problem I'm trying to solve is that my eli2bootmgr program, which puts
eli labels into the EFI Boot Manager, needs to correctly identify to EFI
which EFI device contains the file system with a \eli.efi application.  I
also need to know disk geometry, partition type (GPT, MBR), and the like,
but I believe I can manage that.

Maybe my approach to this is wrong.  I'm writing a Linux user-space
application to frob the boot manager.  Maybe I should be considering writing
an EFI app instead?

Thanks,
Matt

--
Matt Domsch
Sr. Software Engineer
Dell Linux Systems Group
Linux OS Development
www.dell.com/linux



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Linux-ia64] Deterimining EFI device number within Linux?
  2001-03-27 23:18 [Linux-ia64] Deterimining EFI device number within Linux? Matt_Domsch
@ 2001-03-27 23:18 ` Matt_Domsch
  2001-03-28 17:12 ` David Mosberger
  2001-03-28 17:59 ` Stephane Eranian
  2 siblings, 0 replies; 4+ messages in thread
From: Matt_Domsch @ 2001-03-27 23:18 UTC (permalink / raw)
  To: linux-ia64

Does anyone know how to determine the EFI Device Number (such as 0x80) for a
disk known as /dev/sda, under Linux (ideally from user-space, but I'd take a
kernel-space trick too)?  There's an equivalent problem in IA-32 which has
no known solution.  I'm hoping there is for EFI<->Linux.

The problem I'm trying to solve is that my eli2bootmgr program, which puts
eli labels into the EFI Boot Manager, needs to correctly identify to EFI
which EFI device contains the file system with a \eli.efi application.  I
also need to know disk geometry, partition type (GPT, MBR), and the like,
but I believe I can manage that.

Maybe my approach to this is wrong.  I'm writing a Linux user-space
application to frob the boot manager.  Maybe I should be considering writing
an EFI app instead?

Thanks,
Matt

--
Matt Domsch
Sr. Software Engineer
Dell Linux Systems Group
Linux OS Development
www.dell.com/linux



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Linux-ia64] Deterimining EFI device number within Linux?
  2001-03-27 23:18 [Linux-ia64] Deterimining EFI device number within Linux? Matt_Domsch
  2001-03-27 23:18 ` Matt_Domsch
@ 2001-03-28 17:12 ` David Mosberger
  2001-03-28 17:59 ` Stephane Eranian
  2 siblings, 0 replies; 4+ messages in thread
From: David Mosberger @ 2001-03-28 17:12 UTC (permalink / raw)
  To: linux-ia64

>>>>> On Tue, 27 Mar 2001 17:18:50 -0600, Matt_Domsch@Dell.com said:

  Matt> Does anyone know how to determine the EFI Device Number (such
  Matt> as 0x80) for a disk known as /dev/sda, under Linux (ideally
  Matt> from user-space, but I'd take a kernel-space trick too)?
  Matt> There's an equivalent problem in IA-32 which has no known
  Matt> solution.  I'm hoping there is for EFI<->Linux.

I imagine you'd have to determine the hardware path to do so.  I'm not
sure of the format used by EFI (I think it follows some standard, but
I'm not familiar with the details), but I'd expect that you'd need to
know the SCSI id, PCI bus, slot & function number of the controller,
the sequence of PCI bridges from the CPU to the device, etc.  Linux
has all this information in one place or another (ioctl(), /proc/pci,
etc.), but it probably won't be pretty.

	--david


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Linux-ia64] Deterimining EFI device number within Linux?
  2001-03-27 23:18 [Linux-ia64] Deterimining EFI device number within Linux? Matt_Domsch
  2001-03-27 23:18 ` Matt_Domsch
  2001-03-28 17:12 ` David Mosberger
@ 2001-03-28 17:59 ` Stephane Eranian
  2 siblings, 0 replies; 4+ messages in thread
From: Stephane Eranian @ 2001-03-28 17:59 UTC (permalink / raw)
  To: linux-ia64

Matt,

On Tue, Mar 27, 2001 at 05:18:50PM -0600, Matt_Domsch@Dell.com wrote:
> Does anyone know how to determine the EFI Device Number (such as 0x80) for a
> disk known as /dev/sda, under Linux (ideally from user-space, but I'd take a
> kernel-space trick too)?  There's an equivalent problem in IA-32 which has
> no known solution.  I'm hoping there is for EFI<->Linux.

If you forget about the bios 0x80 stuff, EFI uses device paths as can be
seen from the EFI shell by typing map. The text on the righthand side is 
the device path. It is based on some PCI, ACPI stuff. There is no connection
with the Linux way of doing things.

For instance:
fs0  : VenHw(Unknown Device:80)/HD(Part1,Sig00000000)

If you forget about fs0, there is no a priori way to map
VenHw(Unknown Device:80)/HD(Part1,Sig00000000) to /dev/sda. You would have
to know how (the order) the devices get scanned by both EFI and Linux to make 
the connection. As David pointed out, your best chances are to reconstruct
the hardware path to the device (including partitions) and to somehow convert
this into the equivalent EFI device path.


-- 
-Stephane


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-03-28 17:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-03-27 23:18 [Linux-ia64] Deterimining EFI device number within Linux? Matt_Domsch
2001-03-27 23:18 ` Matt_Domsch
2001-03-28 17:12 ` David Mosberger
2001-03-28 17:59 ` Stephane Eranian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox