高通平台UEFI 启动流程浅析

初次接触UEFI,一脸懵逼。不过接触新认知事务都得有个熟悉过程,那么就先顺藤摸瓜。

UEFI启动流程依次 SEC ->DEX ->BDS ->OS Loader

/**************************SEC Pre-PI**************************/
BOOT.XF.4.1\boot_images\QcomPkg\XBLCore\ModuleEntryPoint.S
        |
BOOT.XF.4.1\boot_images\QcomPkg\XBLCore\Sec.c
        |
    CEntryPoint
        |
VOID Main (IN  VOID  *StackBase, IN  UINTN StackSize) //初始化ddr、debug uart打印、早期cache、共享库
        |
LoadAndParsePlatformCfg -> InitSplitBoot-> UefiBootContinue -> LoadDxeCoreFromFv
/**************************SEC Pre-PI**************************/

/**************DEX (driver execution environment)***************/
                InitSplitBoot//配置CPU启动线程和多核启动配置
                    |
                kern_init    //被高通封装成库函数
                    |
                _ModuleEntryPoint
                    |
        
/**************DEX (driver execution environment)***************/

/**************BDS (boot devices select)***************/
boot_images/QcomPkg/Tools/load_drvr_sym.cmm:122:          &EntryPoint="\\&ModuleName\AutoGen\ProcessModuleEntryPointList"
boot_images/QcomPkg/Tools/sym.cmm:96:    &ModuleBkpt="\\&ModName\AutoGen\ProcessModuleEntryPointList"

                ProcessModuleEntryPointList
                    |
                BdsInitialize -> gEfiBdsArchProtocolGuid //After DxeCore finish DXE phase, gEfiBdsArchProtocolGuid->BdsEntry will be invoked  to enter BDS phase
                    |
                BdsEntry
                    |
                BdsBootDeviceSelect();  // BDS select the boot device to load OS
                    |
                BdsLibBootViaBootOption
                    |
                gBS->LoadImage //Load the default boot file \EFI\BOOT\boot{machinename}.EFI from removable, Media machinename is ia32, ia64, x64, ...
                    |
                gBS->StartImage
                    |
                gST、gBS的出处在MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.c中被定义和初始化。
                所以从UEFI XBL阶段过渡到ABL阶段
                    |
                CoreStartImage//Transfer control to a loaded image's entry point.
                    |
                Image->EntryPoint (ImageHandle, Image->Info.SystemTable); //这里的Image->Info.SystemTable和gST指向同一个结构体
/**************BDS (boot devices select)***************/

/**************OS Loader (Linux Loader)***************/
                LinuxLoaderEntry
/**************OS Loader (Linux Loader)***************/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值