# 啟動流程和架構概覽

冷啟動是指從關機狀態啟動系統的流程。冷啟動流程涉及以下步驟：

1. 冷啟動從主要啟動載入器 (PBL) 開始執行，為可擴充啟動載入器 (XBL) 設定初始系統。
2. XBL 執行更廣的系統初始化 (包括 DDR 初始化) 並載入 UEFI 映像。
3. UEFI 提供豐富的韌體介面，在 Qualcomm Linux 上載入 systemd-boot 作為啟動管理程式以管理 OS 映像。

欲深入瞭解完整的冷啟動流程，請參閱 [冷啟動架構](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-4/bootloader-architecture.html)。

## UEFI 啟動管理程式

Qualcomm Linux 支援 systemd-boot 作為統一可延伸韌體介面 (UEFI) 啟動管理程式，以載入和啟動 Linux 核心。在此情況下，Qualcomm Linux 核心被建置為 EFI stub。

## Systemd-boot

Systemd-boot 是 UEFI 啟動管理程式，執行 EFI 映像、提供啟動項目並支援統一核心映像 (UKI)。Systemd-boot 支援以下元件：

- 啟動項目：類型 1 啟動載入器規格項目位於 ESP 上的 `loader/entries/` 目錄中。這些檔案描述 Qualcomm^®^ Linux 核心映像，以及相關的 initrd 映像及其他 EFI 可執行檔。
- UKI：類型 2 啟動載入器規格 EFI 統一核心映像是可執行 EFI 二進位檔案，位於 ESP 上的 `/EFI/Linux/` 目錄中。

    欲深入瞭解啟動項目和統一核心映像(UKI)，請參閱 [The Boot Loader Specification](https://uapi-group.org/specifications/specs/boot_loader_specification/)。

Systemd-boot 是 Yocto 中繼層的 systemd 套件的一部分。Yocto 配方使用 `systemd-boot_254.4.bb` 配方檔案來建置 systemd-boot，並使用 `uki.bbclass` 配方檔案處理 ESP 映像產生。

欲深入瞭解 systemd-boot，請參閱 [使用 systemd-boot 和 UKI 進行配置和安全開機](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-27/qualcomm_linux_software_components.html#configure-and-secure-boot-with-systemd-boot-and-uki)。

## Qualcomm Linux 核心作為 EFI stub

EFI 啟動 stub 允許直接啟動 Qualcomm Linux 核心，而不需要傳統的 EFI 啟動載入器。

使用 `CONFIG_EFI_STUB` 核心組態選項編譯 Qualcomm Linux 核心時，啟動韌體可載入 EFI 映像作為可執行檔。在此情況下，韌體載入器會前往 EFI 映像 `drivers/firmware/efi/libstub/` 中的 `EFI boot stub` 位置以啟動核心。

如果是 Arm^®^ (Arm64)，由於不支援壓縮核心，因此核心映像以可移植可執行 (PE) 檔案格式或通用物件檔案格式 (COFF) 映像的形式運作，且 EFI stub 連結至核心。

欲深入瞭解如何以 EFI 映像形式啟動 Linux 核心，請參閱 [The EFI Boot Stub](https://docs.kernel.org/admin-guide/efi-stub.html)。

## 啟動映像和 ESP 或啟動分區

ESP 或啟動分區是封裝 systemd-boot 和 UKI 的 `efi.bin` 映像的儲存位置。UKI 包含核心映像、initramfs 及核心命令列引數。

UEFI 韌體啟動 UEFI 啟動載入器並載入核心啟動映像。以 UEFI 規格中支援的檔案分配表 (FAT) 檔案系統將 ESP 格式化。欲深入瞭解 UKI 映像格式和基礎 Qualcomm Linux 中繼層中的對應支援，請參閱 [使用 systemd-boot 和 UKI 進行配置和安全開機](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-27/configure_and_secure_boot_with_systemd_boot_and_uki.html)。

## 裝置樹 blob 選擇

所有裝置樹 blob 都被封裝為 `dtb.bin` 的一部分。UEFI 為 Qualcomm Linux 核心選擇並載入正確的 DTB。

若要瞭解啟動時 DTB 選擇，請參閱 [平台裝置樹](https://docs.qualcomm.com/doc/80-70020-3TC/topic/kernel-development.html#device-tree)。

Last Published: Jan 01, 2026

[Previous Topic
開始使用 Qualcomm Linux 核心](https://docs.qualcomm.com/bundle/publicresource/80-70020-3TC/topics/getting_started_chapter2.md) [Next Topic
設定啟動後（postboot）的參數](https://docs.qualcomm.com/bundle/publicresource/80-70020-3TC/topics/post-boot-settings.md)