Setting up a EDK II build environment on Windows and Linux:搭建Windows和Linux开发环境[2.2]
Setting up a EDK II build environment on Windows and Linux:搭建Windows和Linux开发环境[2.2]
2015-07 北京海淀区 张俊浩
2. Setting Up EDKII Development Environment(EDKII开发环境的搭建)
->2.1The General Procedure Of Setting Up EDKII Development Environment(搭建EDKII项目的通用流程)
->2.2 Setting up a EDK II build environment on Windows and Linux(搭建Windows和Linux开发环境)
->2.2.1 Setting up a EDK II build environment on Windows
->2.2.1.1 Get the EDKII Source EDKII源代码获取(下载)。
->2.2.1.2 Install some third-party tools to build EDKII.对应开发工具链的下载。
->2.2.2 Setting up a EDK II build environment on Linux
->2.2.2.1 Get the EDKII Source EDKII源代码获取(下载)。
->2.2.2.2 Install some third-party tools to build EDKII.对应开发工具链的下载。
->2.3 Tools:Installing and using the Required Tools for downloading and Building EDKII.
->2.3.1 Download and Install TortoiseSVN to obtain the EDK II(下载/安装/使用TortoiseSVN工具)
发现不管照《EDKII_UserManual_0_7》手冊(或者说http://www.tianocore.org官网上Getting Started for Developers—>Getting Started with EDK II->Step-by-step Instructions),还是戴正华《UEFI原理与编程》都不能较为顺利的搭建Linux和Windows开发环境。
原因有两个:(1)一些工具源的下载路径随着时间的推移发生了变化(通过文档/书籍上的路径检索不到资源)(2)对project源代码管理工具、编译工具的安装、使用不熟悉(而文档/书籍里面默认是不做详细介绍的)。
但了解EDKII开发环境搭建的一般框架和流程(上一篇博客:The General Procedure Of Setting Up EDKII Development Environment搭建EDKII项目的通用流程[2.1]),再加上參考http://www.tianocore.org官网上Getting Started for Developers—>Getting Started with EDK II->Step-by-step Instructions->Windows systems/Using EDK II with Native GCC的步骤引导,我们应该能够较为顺利的搭建EDKII的Windows和Linux开发环境。
不管是我们获取源代码,还是编译EDKII项目源代码。都须要第三方工具Third-Party Tools. (Getting and Installing the Required Tools for downloading and Building EDK II.)參照TianoCore官网上(http://www.tianocore.org) Getting Started for Developers->Getting Started with EDK II->Tools->follow these instructions来下载安装第三方工具Third-Party Tools。
依据TianoCore官网上,对开发工具链的要求,http://www.tianocore.org->Getting Started for Developers -> Getting Started with EDK II->Tools -> follow these instructions ->Install some external tools->Third Party Tools:要求我们须要第三方工具包含:c预处理器、c编译器、静态链接器、动态连接器、汇编器、汇编连接器、ACPI汇编器。(3rdParty Tools must include: a C pre-processor, C compiler, static linker, dynamic linker, and an assembler and assembly linker. For creating ACPI tables required by platforms, an ACPI assembler is also required.)
2.2.1 Setting up a EDK II build environment on Windows(搭建Windows EDKII开发环境)
2.2.1.1 Get the EDKII Source EDKII源代码获取(下载)。
Windows平台下我们一般使用subversion来管控项目源代码版本号,通过SVN(subversion)下载上传源代码。所以我们想获取源代码。首先须要下载、安装SVN软件,然后通过SVN获取SVN代理server上的EDKII源代码,具体具体过程參看下一篇博文《Tools:Installing and using the Required Tools for downloading and Building EDK II工具篇:安装/使用EDKII源代码获取/编译工具[2.3]》
2.2.1.2 Install some third-party tools to build EDKII.对应开发工具链的下载。
依据TianoCore官网上。对开发工具链的要求,http://www.tianocore.org->Getting Started for Developers -> Getting Started with EDK II->Tools -> follow these instructions ->Install some external tools->Third Party Tools:要安装下面当中(表格因为篇幅原因有删减)至少一个编译工具链(At least one of the following 3rd party compiler tool chain is required),在Windows平台下我们通常採用的集成开发环境Microsoft Visual Studio。
Name |
Version |
URL |
Microsoft Visual Studio |
2005 Professional |
|
Microsoft Visual Studio |
2005 Team Suite |
|
Microsoft Visual Studio |
2003 .NET |
|
Intel C++ Compiler for Windows |
9.1 |
|
Intel C Compiler for EFI Byte Code |
1.2 |
http://www.intel.com/cd/software/products/asmo-na/eng/compilers/efibc/index.htm |
Microsoft ACPI Source Language Assembler |
3.0.0NT or later |
http://www.microsoft.com/whdc/system/pnppwr/powermgmt/default.mspx |
当我们点击Microsoft Visual Studio2005 Professional链接时进入Visual Studio官网,发现官网的Visual Studio镜像下载版本号是相对较新的版本号Visual Studio2013(2015-07月份)。而其它版本号的Visual Studio镜像。在官网非常难找到。
若直接点击官网Visual Studio2013链接直接下载Visual Studio2013也能够(须要用邮箱先注冊微软账号)。但这样下载即便是在网速较佳的情况下,下载和安装时常也得以小时单位,数小时计。着实让人着急。
推荐另外的一个MSDN(Microsoft Developper Network。微软开发网络)站点:http://www.itellyou.cn/。(“MSDN。itellyou”是一个国内project师搭建的专门收集MSDN资源的站点,是一个十分优秀的资源站点)。从上面“开发者工具”,能够非常方便的下载到以往各个版本号的Visual Studio工具,本博文版本号选择Visual Studio2013下的Visual Studio Ultimate 2013 (x86) - DVD (English)(2.82GB)。
在网速较快的环境下。下载非常快,安装也须要小时计,但比Visual Studio官网时间要短得多。
安装Visual Studio Ultimate 2013 (x86) 软件时。建议安装在系统盘C盘。
刚開始对源代码项目不太熟悉,路径冲突也不知道去哪改动,比方会出现例如以下错误:“Cannot open include file: 'windows.h': No such file or directory”
d:\edk2\Nt32Pkg\Include\Common/WinNtInclude.h(54) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
NMAKE : fatal error U1077: '"D:\Program Files (x86)\Microsoft Visual Studio 12.0\VC \bin\ cl.exe"' : return code '0x2'
Stop.
build...
: error 7000: Failed to execute command
D:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\nmake.exe /nologo tbuild
将Microsoft Visual Studio 2013从D盘卸载后(卸载Visual Studio 13也是一个“大project”,大概半小时左右,笔记本CPUI5-3337U处理器,1.8G主频),又一次安装C盘C:\Program Files (x86)\Microsoft Visual Studio 13.0\。没有再出现“ Cannot open include file: 'windows.h': No such file or directory,error 7000: Failed to execute command”错误。
并且当安装不同Visual Studio版本号,或者说在不同Visual Studio切换,尤其是卸载高版本号的Visual Studio转而安装低版本号的Visual Studio,会出现高版本号Visual Studio无法安装问题。比方高版本号的.net框架存在。无法安装低版本号的.net框架,Microsoft VisualC++ 2010已经安装也会导致新的.NET Framework无法安装。“>LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏”。问题说明:当安装VS2013之后。原来的.NET 4.0会被替换为.NET 4.5。卸载VS2013时,不会恢复.NET 4.0。
通过控制面板“卸载或者更改程序”(Uninstall or change a program)找到对应的Microsoft VisualC++ 2010程序进行卸载就可以继续安装。
这样我们通过安装SVN下载EDKII源代码。安装Visual Studio 2013、IASL完毕了Windows开发环境的搭建。在《EDKII Build Process-EDKII项目源代码的配置、编译流程[3]》配置、编译EDKII源代码来检验EDKII项目Windows开发环境是否搭建成功。
2.2.2 Setting up a EDK II build environment on Linux(搭建Linux EDKII开发环境)
2.2.2.1 Get the EDKII Source EDKII源代码获取(下载)。
Linux环境下我们能够用git、svn项目源代码版本号来下载、同步EDKII源代码。本篇博文Linux环境採用的VMware(Virtual Machine ware)的方式,Linux系统为Ubuntu12.0。
另外,不论是在Ubuntu系统下安装软件还是下载EDKII源代码都须要Ubuntu虚拟机在网络连接的状态下。关于Ubuntu虚拟机的网络配置,參看之前的博文《Ubuntu Vmware虚拟机网络配置(一)》,解决Ubuntu虚拟机网络问题后。我们继续EDKII的Linux开发环境搭建步骤。
依据TianoCore官网http://www.tianocore.org->Getting Started for Developers -> Getting Started with EDK II->Step-by-step Instructions->Using EDK II with Native GCC.我们须要用git或svn获取EDKII源代码,开发工具链使用GCC编译器和IASL汇编器。
Download and Install git or svn to obtain the EDK II(下载/安装/使用TortoiseSVN工具)
Install required software from apt(apt - Advanced Package Tool,利用apt工具从aptserver上下载所需的工具)
搭建EDKII开发环境须要一些Ubuntu软件包的支持。能够通过例如以下命令获得对应的安装包。(Several ubuntu packages will be needed to fully set up an edk2 build environment. In order to easily install all the requirements, you need to run this command.)
Shell命令:bash$ sudo apt-get install build-essential subversion git uuid-dev iasl
Checkout the edk2 source tree from git or subversion
Command line Instructions:(DOS终端命令行模式)
在/home下新建工作文件夹src,进入工作文件夹src,再通过git或者svn获取源代码。
linux@ubuntu:~$ mkdir ~/src
linux@ubuntu:~$ cd src/
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" width="300" height="100" alt="">
通过git获取源代码:
linux@ubuntu:~/src$ git clone https://github.com/tianocore/edk2
或者通过svn:
linux@ubuntu:~/src$ svn co https://svn.code.sf.net/p/edk2/code/trunk/edk2
接下来可能是10min左右的等待过程。
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" width="450" height="300" alt="">
2.2.2.2 Install some third-party tools to build EDKII.对应开发工具链的下载。
在Linux环境下开发法工具链通常是GCC,还有编译ACPI汇编源文件ACPI汇编器。
GCC编译器,Ubuntu系统原本有(也能够通过apt工具下载sudo apt-get install gcc),本博客GCC版本号是GCC4.6;
我们在上面步骤:“Install required software from apt”就已经下载iasl汇编器了。
但在接下来的EDKII源代码配置和编译过程中,出现例如以下错误:“/bin/sh: 1: nasm: not found”
"nasm" -I/home/linux/src/edk2/MdePkg/Library/BaseLib/Ia32/ -f elf32 -o /home/linux/src/ edk2/Build/MdeModule/DEBUG_GCC46/IA32/MdePkg/Library/BaseLib/BaseLib/OUTPUT/Ia32/Thunk16.obj /home/linux/src/edk2/Build/MdeModule/DEBUG_GCC46/IA32/MdePkg/Library/BaseLib/BaseLib/OUTPUT/Ia32/Thunk16.iii
/bin/sh: 1: nasm: not found
make: *** [/home/linux/src/edk2/Build/MdeModule/DEBUG_GCC46/IA32/MdePkg/Library/BaseLib/BaseLib/OUTPUT/Ia32/Thunk16.obj] Error 127
build.py...
: error 7000: Failed to execute command
/usr/bin/make tbuild
[/home/linux/src/edk2/Build/MdeModule/DEBUG_GCC46/IA32/MdePkg/Library/BaseLib/BaseLib]
build.py...
: error F002: Failed to build module
/home/linux/src/edk2/MdePkg/Library/BaseLib/BaseLib.inf [IA32, GCC46, DEBUG]
- Failed -
Build end time: 21:44:40, Apr.08 2015
Build total time: 00:00:34
通过shell命令“bash$ sudo apt-get install nasm”下载x86汇编器nasm后,又一次编译EDKII源代码,编译通过。所以搭建EDKII的Linux开发环境,下载所需的软件包的较为保险的命令是:
bash$ sudo apt-get install build-essential subversion git uuid-dev iasl nasm
还有怎样下载指定版本号的Gcc,比方TianoCore官网上指定的Gcc4.4,參考之前的博文《Ubuntu环境下怎样安装指定版本号的Gcc,比方Gcc4.4》》。
这样我们通过apt工具安装git或svn下载EDKII源代码,安装Gcc4.6、IASL、NASM、build-essentia、uuid-dev完毕了Linux开发环境的搭建。在《EDKII Build Process-EDKII项目源代码的配置、编译流程[3]》配置、编译EDKII源代码来检验EDKII项目Linux开发环境是否搭建成功。
通过本篇博文Windows和Linux环境搭建的详细过程。我们发现EDKII开发环境搭建的一般框架和流程是同样的,须要安装的详细功能的源代码版本号控制器、编译器、汇编器、链接器是一样的,仅仅是与Windows和Linux系统环境匹配的详细开发工具不同,Windows採用集成的开发环境Visual Studio,Linux环境下小即是美採用工具链的方式。对照过程中发现Visual Studio採用集成的开发环境,方便开发的同一时候也屏蔽了非常多核心的技术细节,Linux下工具链的安装等多显化了项目的一般开发流程。
Setting up a EDK II build environment on Windows and Linux:搭建Windows和Linux开发环境[2.2]的更多相关文章
- Tools:downloading and Building EDK II工具篇:安装/使用EDKII源代码获取/编译工具[2.3]
Tools:Installing and using the Required Tools for downloading and Building EDK II工具篇:安装/使用EDKII源代码获取 ...
- google官方提供的编译android源码的环境初始化,Initializing a Build Environment
原文网址:http://source.android.com/source/initializing.html Initializing a Build Environment IN THIS DOC ...
- Android Initializing a Build Environment
from://https://source.android.com/source/initializing.html#next-download-the-source Initializing a B ...
- Initializing a Build Environment
This section describes how to set up your local work environment to build the Android source files. ...
- Config the Android 5.0 Build Environment
In this document Choosing a Branch Setting up a Linux build environment Installing the JDK ...
- EDK II之Secure Boot简述
密钥对:公钥分发,私钥自留.常见的公钥格式:cer/der,常见的私钥格式:pfx. BIOS中Secure Boot的原理:把公钥包在code里面,当使用gBS->LoadImage()去加载 ...
- setting up a IPSEC/L2TP vpn on CentOS 6 or Red Hat Enterprise Linux 6 or Scientific Linux
This is a guide on setting up a IPSEC/L2TP vpn on CentOS 6 or Red Hat Enterprise Linux 6 or Scientif ...
- vue dev开发环境跨域和build生产环境跨域问题解决
dev开发时解决请求跨域问题:config-index.js 配置代理dev: { env: require('./dev.env'), port: 8082, assetsSubDirectory: ...
- ASP.NET Core 2.1以上 Bootstrap 4前端模板文件,开发环境与发布环境前端模板 environment的使用
笔者的前端文件如下 笔者增加Bootstrap 4 和 FontAwersome(字体图标),因为Bootsrap 4已经不再包含图标了. ASp.Net Core 中,通常在 _Layout.csh ...
随机推荐
- 在linux服务器centos上使用svn同步代码到项目中
一.需求 1.在多人开发过程中代码的管理以及版本的控制是一个很重要的问题,因为在开发过程中我们可能会同时更改过某个文件或者更改过多个文件, 这会导致我们很容易发生错误.所以我们需要一个方式去管理我们的 ...
- 指令重排序所带来的问题及使用volatile关键字解决问题
首先看下如下代码: 指令重排序和优化后代码如下:if(!stop)while(true){}volatile最适合使用的是一个线程写.其他线程读的场合,如果有多个线程并发写操作,仍然需要使用锁或者线程 ...
- python 11:range(起始索引,终止索引,步数)(默认情况下步数为1,生成从起始索引,每次增加(终止索引-起始索引)/步数,到终止索引前的数字串)
squares = [] for value in range(1,11): #第三参数默认为1,生成从1开始,每次增加1步数,到11前的10为止的数字串 square = value ** 2 sq ...
- A - Word
Problem description Vasya is very upset that many people on the Net mix uppercase and lowercase lett ...
- AES && DES加解密
MD5加密一般不可逆,只能暴力突破.所以这边记录一下一些关于字符串的加解密的两种方法,以便自己学习 AES public class AESHelper { public static string ...
- 在64位WindowsServer2012R2中安装Oracle10g第二版(10.2.0.4.0)-20160106
1.操作系统版本 用于安装数据库的操作系统镜像文件名为:cn_windows_server_2012_r2_vl_with_update_x64_dvd_6052729.iso 安装DataCen ...
- dhtmlxtree动态加载节点数据的小随笔
最近做了一个这个东西,颇有些感触,随笔记录一下自己的过程. 首先特别感谢:https://blog.csdn.net/cfl20121314/article/details/46852591,对我的帮 ...
- Ubuntu安装中文语言包
使用Ubuntu 默认的界面感觉不习惯,于是安装KDE界面. 1.安装kde 使用命令行: sudo apt-get install kubuntu-desktop 安装后发现不能使用中文, 在 se ...
- Combobox 下拉框赋值
string sql = "select distinct RoleName from tb_Role"; DataTable dt = SqlHelper.DataTable(s ...
- Lost connection to MySQL server at 'reading authorization packet', system error: 0_Mysql
1.大多数时候设置"set global connect_timeout=60:"是可以解决问题的. 我们可以通过执行“SHOWSTATUS LIKE 'aborted%'”,可以 ...