← Documents Documentation/arch/arm/uefi.rst GitHub 원문 ↗

Linux 6.18.37 · Architecture

The Unified Extensible Firmware Interface (UEFI)

ARM Linux UEFI 지원 구성, PE/COFF stub 부팅, UEFI memory map과 FDT /chosen 전달 속성을 설명합니다.

Source pathDocumentation/arch/arm/uefi.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약과 해설

uefi.rst:1-72

ARM과 arm64의 UEFI 부팅은 kernel image에 포함된 stub을 통해서만 지원됩니다. Stub은 UEFI loader 역할을 수행하고 DT memory node 대신 UEFI memory map을 사용하도록 `/chosen`에 system table·map descriptor·KASLR seed·bootargs를 전달합니다.

ARM UEFI 부팅 정보 전달
UEFI firmwarePE/COFF kernel stubGetMemoryMap()FDT /chosenARM Linux kernel

펌웨어 정보가 UEFI stub과 FDT /chosen을 거쳐 커널 초기화 코드로 전달됩니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 ================================================
2 The Unified Extensible Firmware Interface (UEFI)
3 ================================================
4
5 UEFI, the Unified Extensible Firmware Interface, is a specification
6 governing the behaviours of compatible firmware interfaces. It is
7 maintained by the UEFI Forum - http://www.uefi.org/.
8
9 UEFI is an evolution of its predecessor 'EFI', so the terms EFI and
10 UEFI are used somewhat interchangeably in this document and associated
11 source code. As a rule, anything new uses 'UEFI', whereas 'EFI' refers
12 to legacy code or specifications.
13
14 UEFI support in Linux
15 =====================
16 Booting on a platform with firmware compliant with the UEFI specification
17 makes it possible for the kernel to support additional features:
18
19 - UEFI Runtime Services
20 - Retrieving various configuration information through the standardised
21 interface of UEFI configuration tables. (ACPI, SMBIOS, ...)
22
23 For actually enabling [U]EFI support, enable:
24
25 - CONFIG_EFI=y
26 - CONFIG_EFIVAR_FS=y or m
27
28 The implementation depends on receiving information about the UEFI environment
29 in a Flattened Device Tree (FDT) - so is only available with CONFIG_OF.
30
31 UEFI stub
32 =========
33 The "stub" is a feature that extends the Image/zImage into a valid UEFI
34 PE/COFF executable, including a loader application that makes it possible to
35 load the kernel directly from the UEFI shell, boot menu, or one of the
36 lightweight bootloaders like Gummiboot or rEFInd.
37
38 The kernel image built with stub support remains a valid kernel image for
39 booting in non-UEFI environments.
40
41 UEFI kernel support on ARM
42 ==========================
43 UEFI kernel support on the ARM architectures (arm and arm64) is only available
44 when boot is performed through the stub.
45
46 When booting in UEFI mode, the stub deletes any memory nodes from a provided DT.
47 Instead, the kernel reads the UEFI memory map.
48
49 The stub populates the FDT /chosen node with (and the kernel scans for) the
50 following parameters:
51
52 ========================== ====== ===========================================
53 Name Type Description
54 ========================== ====== ===========================================
55 linux,uefi-system-table 64-bit Physical address of the UEFI System Table.
56
57 linux,uefi-mmap-start 64-bit Physical address of the UEFI memory map,
58 populated by the UEFI GetMemoryMap() call.
59
60 linux,uefi-mmap-size 32-bit Size in bytes of the UEFI memory map
61 pointed to in previous entry.
62
63 linux,uefi-mmap-desc-size 32-bit Size in bytes of each entry in the UEFI
64 memory map.
65
66 linux,uefi-mmap-desc-ver 32-bit Version of the mmap descriptor format.
67
68 kaslr-seed 64-bit Entropy used to randomize the kernel image
69 base address location.
70
71 bootargs String Kernel command line
72 ========================== ====== ===========================================
73

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

UEFI와 EFI

1-13

UEFI(Unified Extensible Firmware Interface)는 호환 펌웨어 인터페이스의 동작을 규정하는 사양이며 UEFI Forum이 유지합니다.

UEFI는 이전 EFI의 발전형이므로 이 문서와 관련 소스 코드에서는 EFI와 UEFI라는 용어를 어느 정도 혼용합니다. 일반적으로 새 기능은 `UEFI`, 기존 코드나 사양은 `EFI`라고 부릅니다.

Linux의 UEFI 지원

14-30

UEFI 사양을 준수하는 펌웨어에서 부팅하면 커널은 UEFI Runtime Services를 사용할 수 있고, UEFI configuration table의 표준 인터페이스를 통해 ACPI·SMBIOS 같은 구성 정보를 가져올 수 있습니다.

[U]EFI 지원을 실제로 활성화하려면 다음 구성이 필요합니다.

  • `CONFIG_EFI=y`
  • `CONFIG_EFIVAR_FS=y` 또는 `m`

구현은 UEFI 환경 정보를 Flattened Device Tree(FDT)로 전달받는 데 의존하므로 `CONFIG_OF`가 활성화된 경우에만 사용할 수 있습니다.

UEFI stub

31-40

UEFI "stub"은 `Image` 또는 `zImage`를 유효한 UEFI PE/COFF executable로 확장하고 loader application을 포함합니다. 그 결과 UEFI shell, boot menu, Gummiboot나 rEFInd 같은 경량 bootloader에서 커널을 직접 적재할 수 있습니다.

Stub 지원을 포함해 빌드한 kernel image는 비UEFI 환경에서도 부팅 가능한 유효한 커널 이미지로 남습니다.

ARM에서의 UEFI 커널 지원

41-51

ARM 아키텍처의 `arm`과 `arm64`에서 UEFI 커널 지원은 stub을 통해 부팅할 때만 사용할 수 있습니다.

UEFI 모드로 부팅하면 stub은 전달받은 DT의 모든 memory node를 삭제합니다. 커널은 대신 UEFI memory map을 읽습니다.

Stub은 다음 매개변수를 FDT `/chosen` node에 채우고 커널은 이 값을 검색합니다.

FDT /chosen 매개변수

52-72
이름형식설명
`linux,uefi-system-table`64-bitUEFI System Table의 physical address
`linux,uefi-mmap-start`64-bitUEFI `GetMemoryMap()` 호출이 채운 UEFI memory map의 physical address
`linux,uefi-mmap-size`32-bit앞 항목이 가리키는 UEFI memory map의 byte 크기
`linux,uefi-mmap-desc-size`32-bitUEFI memory map 각 entry의 byte 크기
`linux,uefi-mmap-desc-ver`32-bitmmap descriptor 형식의 version
`kaslr-seed`64-bitkernel image base address 위치를 무작위화하는 entropy
`bootargs`StringKernel command line