^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) .. SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) =====================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) General note on [U]EFI x86_64 support
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) =====================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) The nomenclature EFI and UEFI are used interchangeably in this document.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) Although the tools below are _not_ needed for building the kernel,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) the needed bootloader support and associated tools for x86_64 platforms
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) with EFI firmware and specifications are listed below.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) 1. UEFI specification: http://www.uefi.org
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) 2. Booting Linux kernel on UEFI x86_64 platform requires bootloader
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) support. Elilo with x86_64 support can be used.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) 3. x86_64 platform with EFI/UEFI firmware.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) Mechanics
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) ---------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) - Build the kernel with the following configuration::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) CONFIG_FB_EFI=y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) CONFIG_FRAMEBUFFER_CONSOLE=y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) If EFI runtime services are expected, the following configuration should
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) be selected::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) CONFIG_EFI=y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) CONFIG_EFI_VARS=y or m # optional
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) - Create a VFAT partition on the disk
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) - Copy the following to the VFAT partition:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) elilo bootloader with x86_64 support, elilo configuration file,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) kernel image built in first step and corresponding
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) initrd. Instructions on building elilo and its dependencies
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) can be found in the elilo sourceforge project.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) - Boot to EFI shell and invoke elilo choosing the kernel image built
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) in first step.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) - If some or all EFI runtime services don't work, you can try following
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) kernel command line parameters to turn off some or all EFI runtime
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) services.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) noefi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) turn off all EFI runtime services
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) reboot_type=k
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) turn off EFI reboot runtime service
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) - If the EFI memory map has additional entries not in the E820 map,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) you can include those entries in the kernels memory map of available
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) physical RAM by using the following kernel command line parameter.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) add_efi_memmap
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) include EFI memory map of available physical RAM