Jump to content

[Question] UEFI, EFI applications, rEFInd, OSx86... How to make them get along?


14 posts in this topic

Recommended Posts

It takes a lot of time on Google for me to ask in a forum, I can't believe I'm the only single being this finnicky with his UEFI...

 

The point is: I already have a 2011 gaming PC, with ArchLinux as primary OS (for normal use) and Windows 8 (AKA gaming console mode). They are both working in UEFI/GPT mode, living along as good friends, sharing the same EFI system partition.

 

I'm bored with this, and I'd like to include OSX in the roster. Point is, I like to keep legacy stuff away. and I consider myself an early adopter. Ergo, I consider BIOS bootloaders legacy stuff. Reading about OSx86 I can only find Chameleon/Chimera (which I understand are basically the same software), Clover and the Darwin bootloader, which is the "actual" Mac loader. AND here lays the problem: as far as i know, Chameleon, Chimera and Clover all only emulate the MAC efi on a BIOS... I actually read someone suggest someone with a similar build to simply reinstall his windows in BIOS/MBR and screw the previous installation... what a brute. As if they couldn't be converted ;). Back to the question, what I want is, before wasting valuable money on an OSX license and bandwith on a DMG (I have no optical drives), to gather all the information about Chameleon/Chimera, Clover and the OSX boot process, including the actual secuence followed by either software, the files each write to the EFISYS partition, and the reason I haven't seen any reference to a .efi file or any kind of native EFI application. (Bold font added because I think I deviated too much :'D)

 

This last point is because, once UEFI started being used on PC's too, the simplest and most elegant method to solve the MAc EFI/PC UEFI differences would be to use a native UEFI application that would emulate (or pass the due variables, or whatever, this is why I'm asking) the Mac EFI to make the system even more vanilla.

 

My intention is to get rEFInd, which is a boot MANAGER, (not LOADER) to pass control as directly as possible to the Linux Kernel (which by itself is an actual EFI application), the Darwin bootloader (or a minimal build or setting for Chameleon/Chimera) or Windows (which must unfortunately be only loaded by the damned bootmgfw, the EFI version of Bootmgr)

Link to comment
Share on other sites

Hi and welcome,

 

currently only Clover supports UEFI mode and it can be started as an EFI application - meaning you wouldn't need to keep any legacy support enabled in your BIOS, if this is your aim.
However it won't recognize the EFI stub used by Arch Linux and this is where dmazar's patchset comes in handy. It allows the customization of menu entries and you can specify the loader and the arguments yourself.

 

You can read more about the boot process of Clover here.

 

The files written to the EFI partition are determined by the installation method you choose. You might want to extract and move them yourself to keep away anything you won't need.

 

I use the same setup myself by the way: Windows 8, Arch Linux and OS X.

Link to comment
Share on other sites

Obviously I didn't get very far when reading about Clover. I see this would be a feasible solution, but my goal is to have the smallest amount of software I can. If I can somehow patch Clover to have editable menu entries (which I supposed was possible), I could use it as the only bootloader, couldn't I? AFAIK it shares code with rEFInd, only I don¡t know the extent to which this happens.

 

Anyway, is it safe to assume that there is no simpler bootloader for Darwin? Is it really necessary to have a specific bootloader because of OSX? I was looking to keep something OS neutral (such as rEFInd) that would not really know anything about the OSes it boots (apart of what I tell it) and could be managed from every OS, in my case preferrably from Linux, but if I wanted I could force Windows to display the EFISYS partition and edit the settings, and presumably from OSX too (it's a FAT32 partition after all).

 

I read on the Clover patch you linked it's quite similar to rEFInd , because they share the original rEFIt codebase and the patch just "exposes" it's configuration. I previously understood that Clover was just another replacement for Chameleon/Chimera, but this proves me wrong. I'll investigate more about it and return if it doesn't fit my purpose :/

 

 

EDIT: In theory, I could just go and use Clover with no OSX installed, am I right? As in, directly replacing rEFInd or installing it by its side?

Link to comment
Share on other sites

Yes, you can have editable menu entries. This feature is not included in the trunk and is a custom modification made by one of the developers. A compiled binary is already available in dmazar's thread Maniac10 and I linked to. However it is made for an older revision and some configuration instructions mentioned in the wiki do not apply here. I can upload a copy of my Clover folder if you need.

 

As you already said, you can modify the content of your EFI partition from any OS. Additionally you can use an EFI shell before you boot an OS to - for example - move around files, which I personally find very handy.

 

I am really not an expert and can't list all the modifications done by an OS X compatible boot loader but the Clover wiki should give a good insight. They are not applied when booting another OS. You probably should ask at projectosx if you want to know more details. And yes, they are mandatory.

 

Clover alone will work just fine for your purpose. You only need to point it to the EFI loaders. Here is a part of my menu file for instance:

#
# OS X Mavericks
# Icons depend on OS X version, default is "mac".
#
menuentry_template "OS X Mavericks" {
    loader \System\Library\CoreServices\boot.efi
    ostype osx
    icon mac 10.8=cougar 10.9=mavericks
    submenuentry "Boot OS X in verbose mode" "${slide=0} -v"
    submenuentry "Boot OS X in safe mode" "${slide=0} -v -x"
    submenuentry "Boot OS X in single user mode" "${slide=0} -v -s"
    submenuentry "Boot OS X without caches" "${slide=0} -v NoCaches"
    submenuentry "Boot OS X without extra kexts" "${slide=0} -v NoKexts"
    submenuentry "Boot OS X without caches or extra kexts" "${slide=0} -v NoCaches NoKexts"
}

#
# Windows 8 EFI
#
menuentry_template "Windows 8" {
    loader \EFI\Microsoft\Boot\bootmgfw.efi
    ostype windows
    icon win
}

#
# Arch Linux EFI stub
#
menuentry_template "Arch Linux" {
    loader \EFI\ARCH\vmlinuz-arch.efi
    ostype linux
    icon arch
    options "root=PARTUUID=146429c0-2b2a-4851-b691-8edb3936b0a6 ro rootfstype=ext4 add_efi_memmap initrd=${Initrd} nomodeset"
}
Link to comment
Share on other sites

As far as I see the menu file (refit.conf if I'm not mistaken) is mostly identical to the rEFInd.conf , only the Clover one uses menuentry_template (why "template, though?) and submenuentries are in single lines, so I can see myself making the switch. I still have two doubts left: firstly, I don't see anywhere in the forum post k3nny linked any references to using icons other than the included and in ICNS format. I'll probably test it anyway, but one of tha main points of rEFInd is it's easy customization of these icons, and I have a couple PNG's I'd like to use. Shouldn't be hard to convert to ICNS and replace the included ones... I hope.

 

Second point: DSDT's are generally only mentioned when talking about OSX, but I observed a nifty feature in the Clover wiki: one of the values Clover may pass to the OS in the DSDT is the "PatchVBIos" key in the config.plist. The NVidia propietary graphics driver doesn't allow me to use my native monitor resolution outside of X11, and so virtual terminals and the boot splash are stuck in 1024x768, which gets horribly stretched in a 1920x1080 display... This key in the config.plist sets, in theory, the maximum resolution my monitor allows (according to it's EDID) in the Clover GUI... and all that comes after it. If a full DSDT is technically a standard feature of a motherboard, this should allow me to get the native resolution in the virtual terminals... and even in the Windows bootloader right? The only point remaining is if I can specify different DSDT's for each system...

Link to comment
Share on other sites

You can define the icon name in the according menu entry, e.g. arch and it will search for os_arch.icns. As far as I know only the Apple image format is supported.

 

PatchVBios is not related to DSDT but to the shadow video bios, which is patched. I'm not sure if it will help in this case but it surely is worth a try.

 

Clover can be configured to do many different things when it starts OS X but is a bit limited in its actions when booting another OS. I'm not sure if this option or a DSDT override for example are supported outside of OS X but you can very easily modify that part in the source code if it isn't.

 

As a side note, you can setup Clover on a thumb drive and test it without modifying your existing setup.

 

EDIT: Or not.. PatchVBios should only be relevant for legacy booting.

Edited by k3nny
Link to comment
Share on other sites

I find that the EFISYS partition is quite helpful when testing this kind of things and virtually removes the need to make backups and such of the (nonexistant) bootsectors or the partition: I can access the EFI Shell if I really, REALLY mess the boot options and boot linux manually to repair the options... so I'm not worried about ESB drives.

 

There is also the option to force a specific resolution with the ScreenResolution key... maybe this works. Anyway, as you said it's worth a try, so I'm going to try to set it up before start messing with OSX...

 

 

 

EDIT: Is it possible that as of Revision 1654 the dmazar patch is already in?

Link to comment
Share on other sites

I've found out that actually it is not included, so could you (k3nny) upload your folder as you offered? Apparently the build the patch is designed to work with didn't work and it can't be downloaded, only built from source and I can't seem to be able to find the way to do so on linux ><

Link to comment
Share on other sites

No, they won't. In comparison to the revision I uploaded previously, the recent revisions have undergone several changes affecting the configuration file structure and options.

Instead you can use my Clover folder, it includes all necessary files. You only need to set up Clover as a boot option (see 5.2).

Link to comment
Share on other sites

But what you uploaded is just the same zip in the dmazar's thread unless I really messed up, and that's only the main EFI binary, a sample refit.conf, the EXT4 EFI driver and the diff file for Clover r1341, which I cannot obtain unless I build from source and I can't without an already working OSX as far as I know. What I thought you would upload was a full 1341 build with the additional files.

 

The reason I can't download r1341 is because apparently it didn't even run, and so there are no public builds in sourceforge.

Link to comment
Share on other sites

Not every revision is uploaded on SF. It works fine and you should be able to build it from Arch, if you really want to - try following the wiki instructions.

 

I uploaded a full build, check it again.

Link to comment
Share on other sites

 Share

×
×
  • Create New...