Skip to contentSkip to conversation

EFI and 32bit vs. 64bit

DISCUSSION Felix Zielcke 3 participants 4 messages Jun 3, 2009 – Jun 5, 2009

lore
Share & tools
lore
#0 lore raw

Hello,

just talked with a guy from the debian-boot people about using grub-efi for the Intel Mac Users.
Is there any way avaible in Linux to detect somehow if the EFI is 64bit or 32bit?
Maybe some list of CPUs which could be grep'ed from /proc/cpuinfo or so? I read on refit page that Apple introducted fat binaries, which would work on both, but can they actually be created outside of MacOSX? Or is there maybe another solution to solve this problem?

Signature · 1 line
Felix Zielcke
#1 lore raw
Quoted 6 lines · Felix Zielcke

Hello,

just talked with a guy from the debian-boot people about using grub-efi for the Intel Mac Users.
Is there any way avaible in Linux to detect somehow if the EFI is 64bit or 32bit?

If you EFI-boot linux then its architecture is also the one of efi (afaik linux doesn't support efi64 with i386 kernel or otherway round) If it's not the only reasonable way is to use dmidecode's output (especially ProductName)

Quoted 3 lines

Maybe some list of CPUs which could be grep'ed from /proc/cpuinfo or so? I read on refit page that Apple introducted fat binaries, which would work on both, but can they actually be created outside of MacOSX?

fat binary is just a concateneting of 2 binaries with an extra header. So it's quite easy to create one

Quoted 12 lines

Or is there maybe another solution to solve this problem?

--
Felix Zielcke

_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel

Signature · 2 lines
Regards
Vladimir 'phcoder' Serbinenko
#2 lore raw
Quoted 9 lines · Vladimir 'phcoder' Serbinenko
Quoted 7 lines · Felix Zielcke

Hello,

just talked with a guy from the debian-boot people about using grub-efi for the Intel Mac Users.
Is there any way avaible in Linux to detect somehow if the EFI is 64bit or 32bit?

Quoted 5 lines

If you EFI-boot linux then its architecture is also the one of efi (afaik linux doesn't support efi64 with i386 kernel or otherway round) If it's not the only reasonable way is to use dmidecode's output (especially ProductName)

I have a 2.6.29.2 i386 linux kernel boot on a 64bit computer (Apple iMac 8,1). With fakebios it all works fine (although one cannot access efivars). When I boot the i386 kernel (and initrd and root in memory) in EFI mode on 64 bit it boots but not all modules insert. It loads and can start the init script. That suggests that Felix is right the assumption may not be absolute.

Also, will the results of dmidecode be reliable if using fakebios???

Quoted 7 lines
Quoted 4 lines

Maybe some list of CPUs which could be grep'ed from /proc/cpuinfo or so? I read on refit page that Apple introducted fat binaries, which would work on both, but can they actually be created outside of MacOSX?

fat binary is just a concateneting of 2 binaries with an extra header. So it's quite easy to create one

I have already done this using the fatglue.py python script from refit. It works for grub.efi but not for modules. Another solution would be at module insertion that the process tries <name>.<arch>.mod first before <name>.mod. This means i386 and x86_64 modules could coexist in the same directory and be inserted accordingly.

James

Signature · 2 lines
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
#3 lore raw
In reply to Vladimir 'phcoder' Serbinenko

Am Donnerstag, den 04.06.2009, 01:23 +0200 schrieb Vladimir 'phcoder' Serbinenko:

Quoted 11 lines · Felix Zielcke
Quoted 6 lines

Hello,

just talked with a guy from the debian-boot people about using grub-efi for the Intel Mac Users.
Is there any way avaible in Linux to detect somehow if the EFI is 64bit or 32bit?

If you EFI-boot linux then its architecture is also the one of efi (afaik linux doesn't support efi64 with i386 kernel or otherway round) If it's not the only reasonable way is to use dmidecode's output (especially ProductName)

Hm but ProductName is for me the motherboard name.
So it looks like we'll have to maintain a list?
Bah why is EFI so stupid that it can be a different bit size then the CPU uses.

Quoted 5 lines
Quoted 3 lines

Maybe some list of CPUs which could be grep'ed from /proc/cpuinfo or so? I read on refit page that Apple introducted fat binaries, which would work on both, but can they actually be created outside of MacOSX?

fat binary is just a concateneting of 2 binaries with an extra header. So it's quite easy to create one

On refit homepage stands that they're Apple specific, so I don't think it would be a good solution for longterm.
Seems like more and more adopt EFI now [0]

Otavio thought this would be grub's business not grub-installer's but I start to think this just can't be properly solved in grub. And as James said that efivars won't work if you boot the wrong kernel, we even can't use that to detect EFI properly.

[0]
http://en.wikipedia.org/wiki/Extensible_Firmware_Interface#Platforms_that_use_UEFI_or_the_Framework

Signature · 1 line
Felix Zielcke