When booting or restarting a PC, Clover loads operating system as follows:
Option A: BIOS-based PC (old motherboards)
OSLoader is boot.efi in case of Mac OS X and bootmgr.efi in case of Windows.
Option B: UEFI-based PC (newer motherboard)
In order to boot as described in the two variants above the boot files must be located in the following places:
Master Boot Record (MBR) is the boot sector in the very beginning of a storage device (HDD, SSD, CD/DVD or any kind of USB storage device like USB stick, USB-HDD, etc.). The first 440 bytes contain data from one of the following:
boot0- searches for an active partition in the MBR and passes control to its PBR sector. Hybrid GPT/MBR layout is possible. However if the filesystem is pure GPT,
boot0passes control to the EFI partition, further referred to as boot0af (active first).
boot0hfs- searches for the first HFS+ partition - that would be a partition with signature (type) 0xAF. If it contains an OS X installation, control is passed to its PBR. This way the system can be booted from a HFS+ partition on a GPT partitioned drive, however the limitation is that OS X partition may only be the first partition on the disc. Further referred to as boot0ss (scan signature).
boot0ab- searches for a partition with signature 0xAB - Apple Boot Partition.
boot0md- combined variant which searches multiple drives for a HFS+ partition, not just the main one.
Partition Boot Record (PBR) is a boot sector located in the beginning of each partition on a storage device. The phase two loader is stored here. PBR has the information of its partition's file system and may find and load the boot file and pass the control to it. Different variants exist according to the filesystem type:
boot1h2- supports HFS+ with a boot file size of up to 472kb. The old variant (boot1h) which is bundled with "Chameleon" boot loader only supports 440kb boot file (while 472kb are needed). This boot file pauses for two seconds providing an option to switch loaders.
boot1h- same as above, but without the 2 sec pause.
boot1f32alt- supports FAT32. This file system is able to be written at the booting stage thus very well suited for boot loader installation. It is possible to use it as a EFI partition or on a USB flash drive (USB sticks are usually sold pre-formatted in FAT32). It also gives a pause for two seconds.
boot1f32- same as above without the pause.
Additionally they provide another useful functionality. During the two second pause a number key can be pressed on the keyboard to run a specific loader. Pressing key "1" will start file boot1, pressing "3" will start boot3 and pressing "6" starts boot6. This way a number of different loaders can be kept in one place, e.g:
boot - Clover, recent or testing version
boot1 - Chameleon
boot3 - Clover 32-bit, tested and working version
boot6 - Clover 64-bit, tested and working version
boot7 - Clover 64-bit with BiosBlockIO driver that works with any controller supported by the BIOS.
Apart from these variants the PBR may contain the Windows boot manager (being able to handle NTFS), GRUB (being able to handle EXT4) and other boot loaders not related to Clover - at least at the moment.
In Chameleon, the boot file is a complete bootloader. In Clover however, it contains the whole EFI system and a boot service for passing control to the next phase (option A). Alternatively, all this is supposed to be contained in the PC motherboard ROM (option B). In reality, however, this is not always the case and some other parts need to be loaded additionally in order to boot the OS. In contrast to the earlier stages, different boot files are designed for PCs of different bit-size, i.e. there are different variants for loading 32-bit and 64-bit operating systems. Usually it is advised to choose 64-bit loader for 64-bit CPUs. However if you work with a 32-bit OS, it makes sense to load it with a 32-bit EFI. It is 20% smaller, slightly faster, but not compatible with Windows 7 EFI - you can only load 64-bit Windows with it. In general the boot file is a modified variant of DUET with barely 1% of changes. Nonetheless, this 1% makes the big difference - Clover manages to do what it is designed for. If anyone assumes that adding AppleSim to DUET is enough, well, good luck then! This is by far not enough. DUET can be compiled for one specific computer defined by its PCD constants but Clover needs to work for everyone. I have no intention to explain the details, the work is already done. Further this program will be referred to as CloverEFI.
This file - available in two variants for two different bit sizes - represents the graphical interface of the loader. It is used for selecting the operating system be loaded, tweaking settings, loading additional drivers and finally for loading the OS. Graphics and the menu are based on the rEFIt project, which is reflected on the according directory name and the About screen. Currently the original part of rEFIt codebase (partially fixed) takes about 10% of the whole program.
The loader needs supporting files. Their directory structure is as follows(as of v2k r2334):
I.e. the file CLOVERX64.efi needs to be in the folder /EFI/CLOVER/, the font WoB_PTMono_10W_NA.png in /EFI/CLOVER/themes/black_green/, etc. Usually these and other folders have more content. The purpose of specific files will be described later.
The purpose of the directory /EFI/CLOVER/OEM/
It is designated to store different configurations. A typical situation involves a bootable USB flash drive with multiple configurations. Besides the common /EFI/CLOVER/config.plist, it may contain a /EFI/CLOVER/OEM/Inspiron 1525/config.plist or a /EFI/CLOVER/OEM/H61M-S1/UEFI/config.plist and additionally different customised DSDT.aml tables, unique for each PC.
The folder's name is deduced from the SMBIOS and can be viewed in preboot.log, which you can store into the folder /EFI/CLOVER/misc by pressing F2 on the Clover boot screen. The following is the case of Inspiron 1525 with Clover r1709:
In case of desktops, the following will have been logged. Eg. Gigabyte Z68MX-UD2H-B3 with Clover r2334 when SystemProductName is not defined:
10:061 0:000 Clover revision: 1709 running on Inspiron 1525 10:061 0:000 ... with board 0U990C
The system name is listed in the first line and the motherboard model in the second. While notebooks can usually be identified with the system name, desktop systems are identified with the motherboard model. Choose the variant you are more comfortable with. Furthermore, your configuration directory may contain a UEFI folder to differentiate between a UEFI (option B) and a legacy boot (option A) on one computer (whoever may need it).
0:100 0:000 Clover revision: 2334 running on To be filled by O.E.M. 0:100 0:000 ... with board Z68MX-UD2H-B3
The directories drivers32, drivers64 are used for BIOS booting according to (option A) and drivers64UEFI for UEFI booting (option B). Their content will be different depending on the BIOS revision and on the configuration setup.
It is worth mentioning that these drivers are only effective while the boot loader is working. They have no impact on a loaded OS.
It is up to the user to decide which drivers are needed and which not.
NTFS file system driver. Provides the possibility to load Windows EFI.
HFS+ file system driver. Necessary for booting Mac OS X with (option B). Already present in the boot file when using (option A).
Legal alternative for HFSPlus.efi. May be slower.
EXT2/3 file system driver. Necessary for booting Linux EFI.
EXT4 file system driver. Necessary for booting Linux EFI.
Takes control of the file system for the possibility to inject external kexts into the system. See WithKexts for a detailed explanation.
Already present in CloverEFI and in UEFI, however neither optimised for Apple partitions, nor for GPT/MBR. Most probably necessary for (option B).
Enables starting of FAT modules like boot.efi. Necessary for (option B).
Fixes memory map created by AMI Aptio EFI. Booting OS X is impossible otherwise.
Simplified variant of OsxAptioFixDrv. Do not use both simultaneously.
Set of drivers for the case when built-in driver do not work well with (option B) because a dependancy might have been cut off.
Set of drivers for mouse/trackpad/touchpad support in CloverGUI. They have no effect on the OS.
Already present in CloverEFI and possibly in UEFI. The recommendation is to use anyway, no conflict will arise.
Video driver for providing a wider set of resolutions than the ones present in UEFI for (option B).
Last edited by Andrey Yurkevich (andrey.yurkevich.58), 2015-04-14 14:04:18