UEFI开发与调试---开发环境搭建

EDK2全称为“uEFI Development Kit”,是intel开源的一套符合UEFI标准的实现。

edk2环境搭建

  • 代码下载

github:https://github.com/tianocore/edk2.git

git clone https://github.com/tianocore/edk2.git
  • 安装编译环境
sudo apt-get install build-essential uuid-dev nasm

edk2编译:命令行编译

  • 1.编译base tool
export WORKSPACE=dir/to/edk2
make -C $WORKSPACE/BaseTools
  • 2.初始化编译环境
cd $WORKSPACE
source envsetup.sh
  • 3.命令行编译platform pkg
build -p $WORKSPACE/EmulatorPkg/EmulatorPkg.dsc  -a X64 -b DEBUG -t GCC48 -D BUILD_64 -D UNIX_SEC_BUILD -n 3
option说明:
-p PLATFORMFILE: 目标平台描述文件
-a TARGETARCH:   目标平台X64/IA32
-b BUILDTARGET: 可选项(DEBUG, RELEASE, NOOPT),将只编译dsc文件中特定的模块
-m MODULEFILE:  编译目标module
-t TOOLCHAIN : 使用目标编译器编译
-n THREADNUMBER : 多线程编译
-D MACROS: Macro格式: "Name [= Value]",传入宏定义

edk2编译 :配置文件编译

除了上面介绍的命令行,可以通过配置文件来编译目标,对应的配置文件目录在edk2/Conf中:

Linux@x86_64: ~/edk2 $ ls Conf/
BuildEnv.sh  build_rule.txt  target.txt  tools_def.txt
  • 1.编译base tool
export WORKSPACE=dir/to/edk2
make -C $WORKSPACE/BaseTools
  • 2.初始化编译环境
cd $WORKSPACE
source envsetup.sh

本步骤把build命令加入的环境变量中之外,还会生成默认的Conf文件,我们需要根据自己的需要重新配置对应文件。

  • 3.配置target.txt
ACTIVE_PLATFORM       = EmulatorPkg/EmulatorPkg.dsc
TARGET                = DEBUG
TARGET_ARCH           = X64
TOOL_CHAIN_TAG        = GCC48
MAX_CONCURRENT_THREAD_NUMBER = 9
BUILD_RULE_CONF = Conf/build_rule.txt
  • 4.开始编译
Linux@x86_64: ~/edk2 $ build -D BUILD_64 -D UNIX_SEC_BUILD

通过配置文件的方式,大大简化了命令行的输入,如果命令行传入了相同的配置参数,则会覆盖配置文件target.txt中的定义。

edk2编译清除:

  • 清除BaseTool
Linux@x86_64: ~/edk2 $ make -C BaseTools clean
  • 清除目标板编译文件
build clean
build cleanall

Emulator模拟器运行

EmulatorPkg/build.sh run
  • 0
    点赞
  • 22
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
BIOS-UEFI安全培训包 Training: Security of BIOS/UEFI System Firmware from Attacker and Defender Perspectives This repository contains materials for a hands-on training Security of BIOS/UEFI System Firmware from Attacker and Defender Perspectives A variety of attacks targeting system firmware have been discussed publicly, drawing attention to the pre-boot and firmware components of the platform such as BIOS and SMM, OS loaders and secure booting. This training will detail and organize objectives, attack vectors, vulnerabilities and exploits against various types of system firmware such as legacy BIOS, SMI handlers and UEFI based firmware, mitigations as well as tools and methods available to analyze security of such firmware components. It will also detail protections available in hardware and in firmware such as Secure Boot implemented by modern operating systems against bootkits. The training includes theoretical material describing a structured approach to system firmware security analysis and mitigations as well as many hands-on exercises to test system firmware for vulnerabilities. After the training you should have basic understanding of platform hardware components and various types of system firmware, security objectives and attacks against system firmware, mitigations available in hardware and firmware. You should be able to apply this knowledge in practice to identify vulnerabilities in BIOS and perform forensic analysis of the firmware. Materials Module 0 Introduction to Firmware Security Module 1 BIOS and UEFI Firmware Fundamentals Module 2 Bootkits and UEFI Secure Boot Module 3 Hands-On Platform Hardware and Firmware Module 4 System Firmware Attack Vectors Module 5 Hands-On EFI Environment Module 6 Mitigations Module 7 System Firmware Forensics Miscellaneous Materials

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值