What is the UEFI boot process?

This is meant to be a 5-minute tutorial on UEFI booting for those familiar with BIOS booting.
It is intended to tersely summarize more detailed pages such as this, this, or this.

UEFI booting happens from a FAT12, FAT16, or FAT32 file system on the boot partition, which:
• Is the partition marked as active on an MBR disk.
• Is the special EFI System Partition (UUID C12A7328-F81F-11D2-BA4B-00A0C93EC93B) on a GPT disk.

There exist two types of UEFI boot entries:
• Static boot entries:
  ◦ Persist across reboots
  ◦ Can refer to the same device
  ◦ Are stored in NVRAM (on motherboard)
• Dynamic boot entries:
  ◦ Are auto-detected on boot: \EFI\Boot\BootARCH.efi where ARCH is your CPU (x64, IA32, IA64, ARM, AA64, ...)
  ◦ Cannot refer to the same device (1 entry appears per device, and only if a boot loader is detected)
  ◦ Are auto-generated (but the device detection order is stored in NVRAM)

Static entries can be edited using command-line tools before or after booting in UEFI mode:
• bcfg in the UEFI shell, an installable pre-boot shell
  ◦ List: bcfg boot dump -v
  ◦ Help: bcfg -? -v -b
  ◦ Sometimes the only way that works, because other methods don't always persist
• bcdedit in Windows:
  ◦ List: bcdedit /enum firmware
  ◦ Help: bcdedit /?efibootmgr in Linux
  ◦ List: sudo efibootmgr -v
  ◦ Help: sudo efibootmgr --help
• Direct modification of /sys/firmware/efi/vars/ in Linux (dangerous)

How do you make a cross-OS, cross-firmware multiboot USB flash drive?

1. Ensure it uses an MBR partition table format, not GPT, so BIOS systems can boot it.
2. Create a small FAT32 boot partition at the end of the drive and mark it as active. We'll call it fat32:.
3. Install any BIOS boot loaders you want to the partition as you would have originally done.
4. Install GRUB (or rEFInd) to fat32:\EFI\Boot\BootARCH.efi.
5. Create (or edit) the configuration script that does what you want, such as chainloading BootMgr.
7. Create a large NTFS partition at the beginning of the drive for usage in Windows. We'll call it ntfs:.
8. Copy the configuration script to ntfs:\Somewhere\menu.cfg
6. Create another configuration script beside the boot manager that loads ntfs:\Somewhere\menu.cfg.
    (You can use the cd and configfile commands in GRUB for this.)
9. Put all other boot managers, bootable images, etc. in the ntfs: partition.

This has several advantages:
1. You can edit everything later from Windows (since everything is in the first partition) as well as Linux.
2. The flash drive will be bootable from any firmware that follows the BIOS or UEFI standards.
3. You will not need any static boot entries on your system.