From nobody Mon Apr 29 01:41:14 2024
Delivered-To: importer@patchew.org
Received-SPF: pass (zohomail.com: domain of groups.io designates
66.175.222.108 as permitted sender) client-ip=66.175.222.108;
envelope-from=bounce+27952+96989+1787277+3901457@groups.io;
helo=mail02.groups.io;
Authentication-Results: mx.zohomail.com;
dkim=pass;
spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as
permitted sender)
smtp.mailfrom=bounce+27952+96989+1787277+3901457@groups.io;
dmarc=fail(p=none dis=none) header.from=linux.microsoft.com
ARC-Seal: i=1; a=rsa-sha256; t=1670286076; cv=none;
d=zohomail.com; s=zohoarc;
b=XWEGd+BktzehrEwmjS3cJlYxvB1l5Vx9h4S1jUXdAO7awdwedvrNDjjFdbOB6WaKSO0p04djQ4QTtWuXBAHTlsS0yWmjYbOhLLTo5poIHZPYd4qoRgRgOl0YKDQ+CkwpLa0WMt70fFI8GdDWb7E2DJZti3KoG+z2TINYxkmfnUk=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com;
s=zohoarc;
t=1670286076;
h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To;
bh=hJ8JVo94OjLXDwo+qFfai3vxJLhT/78zjrTH5hfDIsA=;
b=gryIg2INtCqc9GUvh/waCpIn3XZ8e1mib5lOdCBu6SFknc+bL8Q7UN2l/pBQ6MfnVNiqQFLnbxavMepHmRSZrrHQTwW1sKKixX68aOo/4G/AjI45R7Mcm0U2ljacrhnqUYBmxCREihPbiBJxxUsCyFeMmtYo/hFDcpuYsVoexIo=
ARC-Authentication-Results: i=1; mx.zohomail.com;
dkim=pass;
spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as
permitted sender)
smtp.mailfrom=bounce+27952+96989+1787277+3901457@groups.io;
dmarc=fail header.from=
+ Click to download Visual Studio 2022 Build Tools
+
+ Click to download Visual Studio 2019 Build Tools
+
+ Click to download Visual Studio 2017 Build Tools
+
+ Pre-requisites (Git, Python, Compiler)
+
+
+
+
git
to pull the edk2 source code onto your system,=
make changes in the code, and submit
+ your changes back to the GitHub repository.
+
+ Git Download=
Page
+ stuart<=
/code>, which is written in Python.
+
+ It is recommended you install a Python version that is equal to the vers=
ion used in the
+
UsePythonVersion@0
step in this file
+ .azurepipelines/templates/p=
r-gate-steps.yml.
+
+ That version is constantly tested against the code in the repository.
+
+ Python D=
ownload Page
+
+
Ubuntu GCC Installation Instructions
+ apt-get update && apt-get install -y build-essential git nasm =
wget m4 bison flex uuid-dev python unzip acpica-tools gcc-multilib
+ Visual Studio Installation Instructions (Windows)
+
+ Visual Studio 2022 Installation Instructions
+
+
+
+ vs_Buil=
dTools.exe
file
+ (e.g. C:\Downloads
)
+
+
+ start /w vs_BuildTools.exe --quiet --wait --norestart --noca=
che --installPath C:\BuildTools ^
+ --add Microsoft.VisualStudio.Component.VC.CoreBuildTools --a=
dd Microsoft.VisualStudio.Component.VC.Tools.x86.x64 ^
+ --add Microsoft.VisualStudio.Component.Windows11SDK.22000 --=
add Microsoft.VisualStudio.Component.VC.Tools.ARM ^
+ --add Microsoft.VisualStudio.Component.VC.Tools.ARM64
+
+
+ Visual Studio 2019 Installation Instructions
+
+
+
+ vs_BuildT=
ools.exe
file
+ (e.g. C:\Downloads
)
+
+
+ start /w vs_BuildTools.exe --quiet --wait --norestart --nocach=
e --installPath C:\BuildTools ^
+ --add Microsoft.VisualStudio.Component.VC.CoreBuildTools --add=
Microsoft.VisualStudio.Component.VC.Tools.x86.x64 ^
+ --add Microsoft.VisualStudio.Component.Windows10SDK.19041 --ad=
d Microsoft.VisualStudio.Component.VC.Tools.ARM ^
+ --add Microsoft.VisualStudio.Component.VC.Tools.ARM64
+
+
+ Visual Studio 2017 Installation Instructions
+
+
+
+ vs_BuildToo=
ls.exe
file
+ (e.g. C:\Downloads
)
+
+
+ start /w vs_BuildTools.exe --quiet --wait --norestart --nocach=
e --installPath C:\BuildTools ^
+ --add Microsoft.VisualStudio.Component.VC.CoreBuildTools --add=
Microsoft.VisualStudio.Component.VC.Tools.x86.x64 ^
+ --add Microsoft.VisualStudio.Component.Windows10SDK.17763 --ad=
d Microsoft.VisualStudio.Component.VC.Tools.ARM ^
+ --add Microsoft.VisualStudio.Component.VC.Tools.ARM64
+
+
+
+
+
+ Download the Windows Software Development Kit (SDK) from + Windows Dev Center - Windows SDK +
++ Follow the default options until you reach the "Select the= features you want to install" page. +
+ Select the following options: ++ Click Download and complete the installation proc= ess. +
+Mono= needs to be installed on Linux.
+ apt-get install mono-complete +python -m venv .venv
+ source .venv/bin/activate
+ py -m venv .venv
+ .venv\Scripts\activate.bat
+
+ The important parameter here is the -p
parameter which sp=
ecifies that MdeModulePkg
+ should be built.
+
+ The example below uses: +
TOOL_CHAIN_TAG
parameter to specify the build sho=
uld use VS2019
+ (Visual Studio 2019).
+ -a
parameter is used to specify that the IA=
32
and X64
architectures
+ should be built.
+ + OvmfPkg is considered a "platform firmware" for the + QEMU open-source e= mulator. +
+stuart_build
instead of
+ stuart_ci_build
to compile the code
+
+ If you want to run CI checks such as CI plugins, you can use stu=
art_ci_build
with the CI build file.
+
+ OvmfPkg is considered a "platform firmware" for the + QEMU open-source e= mulator. +
+ +stuart_build
instead of
+ stuart_ci_build
+
+ To see what parameters are supported by this platform build file (at t=
he time this page was written), we can pass
+ the --help
argument to the stuart_build
comm=
and:
+
+ =E2=9D=AF stuart_build -c PlatformBuild.py --help + usage: stuart_build [-h] [--SKIPBUILD] [--SKIPPREBUILD] [--SKIPPOSTBUI= LD] [--FLASHONLY] [--FLASHROM] + [--UPDATECONF] [--CLEAN] [--CLEANONLY] [--OUTPUTCO= NFIG OUTPUTCONFIG] [-a BUILD_ARCH] + [--build-config BUILD_CONFIG] [--verbose] + + options: + -h, --help show this help message and exit + --SKIPBUILD, --skipbuild, --SkipBuild + Skip the build process + --SKIPPREBUILD, --skipprebuild, --SkipPrebuild + Skip prebuild process + --SKIPPOSTBUILD, --skippostbuild, --SkipPostBuild + Skip postbuild process + --FLASHONLY, --flashonly, --FlashOnly + Flash rom after build. + --FLASHROM, --flashrom, --FlashRom + Flash rom. Rom must be built previously. + --UPDATECONF, --updateconf, --UpdateConf + Update Conf. Builders Conf files will be repla= ced with latest template files + --CLEAN, --clean, --CLEAN + Clean. Remove all old build artifacts and inte= rmediate files + --CLEANONLY, --cleanonly, --CleanOnly + Clean Only. Do clean operation and don't build= just exit. + --OUTPUTCONFIG OUTPUTCONFIG, --outputconfig OUTPUTCONFIG, --OutputCo= nfig OUTPUTCONFIG + Provide shell variables in a file + -a BUILD_ARCH, --arch BUILD_ARCH + Optional - CSV of architecture to build. IA32 = will use IA32 for Pei & Dxe. X64 will use + X64 for both PEI and DXE. IA32,X64 will use IA= 32 for PEI and X64 for DXE. default is + IA32,X64 + --build-config BUILD_CONFIG + Provide shell variables in a file + --verbose, --VERBOSE, -v + verbose + + positional arguments: ++=3D - Set an env variable for the pre/post = build process + BLD_*_ =3D - Set a build flag for all build types + (key=3Dvalue will get passed to build pr= ocess) + BLD_ _ =3D - Set a build flag for build type of + (key=3Dvalue will get passed to build pr= ocess for given build type) +
+ The --flashonly
and --flashrom
commands are =
especially useful with OvmfPkg. They
+ automatically load QEMU with the newly built firmware.
+
+ The example below uses: +
TOOL_CHAIN_TAG
parameter to specify that the buil=
d should use GCC5
+ to build with GCC.
+ -a
parameter is used to specify the IA32 and X64
architectures should be
+ built.
+
--flashrom
parameter is used to load the firmware=
in QEMU and boot QEMU after the firmware build
+ is completed.
+ + The file BaseTools/Edk2ToolsBuild.py + can be called as a standalone Python script. You just need to pass the= tool chain tag you would like to build with. +
++ Example: + python BaseTools/Edk2ToolsBuild.py -t GCC5 +
+
+ The NO-TARGET
build target specifies that the actual firm=
ware source code should not be built for any
+ particular target and, instead, the other parts of the CI process will=
be active such as the non-compiler checks
+ (plugins).
+
+ In the following example, the CI plugins will be run against all packa= ges supported by the + CISettings.py file. +
+ stuart_ci_build -c .pytool/CISettings.py -t NO-TARGET +
+ The CI checks could be run against a single package (or a selection of=
packages) by passing the package names to
+ with the -p
parameter.
+
+ Plugins are automatically discovered in the workspace by stuart. +
++ The easiest way to have stuart only one run plugin if many others are = present (as is the case in edk2) is to simply + delete the other plugin directories so they are not discovered. You ca= n then test with the remaining plugins and + then use git to restore the deleted plugin directories back when done = testing. +
+
+ For example, to only test with the SpellCheck
plugin, del=
ete every other plugin folder from
+ .pytool/Plugin in your
+ workspace.
+
+ Run the command to only perform CI checks:
+
+ stuart_ci_build -c .pytool/CISettings.py -t NO-TARGET
+
+ When done, restore the other plugin directories:
+
+ git restore .pytool/Plugin/**
+
+ Continuous integration is used in edk2 to test new contributions befor= e they are merged to the edk2 main branch. + Stuart is used within the edk2 CI process to pull build dependencies a= nd build the code. +
++ You can use stuart to perform the same CI checks locally that are done= on the server (see the examples section). +
++ Also see EDK II Continuous Inte= gration. +
+A collection of build related tools for edk2.
++ Examples: + +
+ Each tool has a user manual located in BaseTool= s/UserManuals. +
++ A more complete list of BaseTools is located in the EDK II Tools List. +
+A collection of Python code for working with edk2.
+
+ CISettings.py
is a common name given to a configuration f=
ile used with Stuart for CI. It is often
+ stored in a folder named .pytools
in the root of a reposi=
tory. So you'll likely encounter commands
+ like the following be used with the file:
+
+ PlatformBuild.py
is a common name given to a configuratio=
n file used with Stuart for platform build.
+ It is often stored in the root directory of the package it builds.
+
+ For example: +
++ Like Stuart CI has "CI plugins", the build process has "build plugins"= . These can hook into the build in + "pre-build" or "post-build". +
++ Note: Build plugins will also run during CI if a CompilerPlugin is pre= sent that builds the code. ++
stuart_ci_build
and =
stuart_build
?
+ stuart_ci_build
- Runs CI plugins. By default, often ru=
ns CI on several packages at once. This
+ includes all of the checks needed to consider the code ready for int=
egration to the mainline.
+ stuart_build
- Does not run CI plugins. Builds one plat=
form. Platforms often expose
+ platform-specific parameters as defined in their PlatformBuild=
.py
file.
+ stuart_ci_b=
uild
do exactly?+ The Stuart CI process is composed of "CI plugins" that get discovered = in the code tree at CI time and hook into + the CI process. Some examples of CI plugins are a host-based unit test= compile and execution, spell checking the + code, performing markdown lint on the code, etc. Firmware (C code) com= pilation is performed during CI by a compiler + CI plugin. +
+
+ Each plugin reports back a pass/fail status. If any plugin fails, CI f=
ails. However, plugins usually provide some
+ level of customization in a "CI package configuration file". If this f=
ile is present, it is in the root of the
+ package with the naming convention PkgName.ci.yaml
. For e=
xample,
+ MdePkg.ci.yaml is
+ the CI package configuration file for MdePkg
. Sometimes, =
CI plugins will allow the plugin to be set to
+ run in "audit mode" so the plugin will run and report results but not =
fail CI if errors are found. As an example,
+ some packages in edk2 currently use this file to run the spell checker=
CI plugin in audit mode.
+
+ The two main places to look for CI settings are: +
+ You can pass the -v
argument to Stuart commands to get mo=
re detailed output.
+
+ Also, look in your /Build
directory.
+
+ Each Stuart command produces a separate file. Open the file correspond= ing to the command you're using that has the + failure. +
+stuart_ci_setup
- CISETUP.txt
stuart_setup
- SETUPLOG.txt
stuart_update
- UPDATE_LOG.txt
stuart_ci_build
- CI_BUILDLOG.txt
stuart_build
- BUILDLOG_PACKAGENAME.txt
<=
/li>
+ + The different types of plugins supported by Stuart and details about e= ach type are available in the + edk2-pytool-ex= tensions Plugin Manager + page. +
++ Start in the + edk2-pytool-extensions User Docu= mentation. +
+-bash$ mkdir ~/src -bash$ cd ~/src -bash$ git clone https://github.com/tianocore/edk2 -- -=3D=3D=3D=3DFor EDKII project developers:=3D=3D=3D=3D -* Clone the EDK II project repository -** git clone https://github.com/tianocore/edk2 -* Change to the edk2 directory -* Build the tools -** make -C BaseTools -* Run the edksetup.sh script -** . edksetup.sh -When the above steps are done, you can work in the edk2 directory for code= development. - -=3D=3D=3DBuild the EDK II BaseTools=3D=3D=3D - -
-bash$ make -C edk2/BaseTools -- -=3D=3D=3DBuild gcc x64 UEFI cross compiler=3D=3D=3D - -In order to build UEFI images for x64, you will need to build a cross-comp= iler build of gcc. This can take quite a while to complete, possibly sever= al hours on older systems. But, a Python script has been provided to autom= ate this build process. - -Note: This is only needed if behind a internet firewall! -
-bash$ export http_proxy=3Dhttp://proxy.domain.com:proxy_port -- -To build gcc for x64, use these commands (this will take quite a while to = complete): - -
-bash$ cd ~/src/edk2/BaseTools/gcc -bash$ ./mingw-gcc-build.py --arch=3Dx64 \ - --prefix=3D~/programs/gcc/x64 -- -=3D=3D=3DSetup build shell environment=3D=3D=3D - -
-bash$ cd ~/src/edk2 -bash$ export EDK_TOOLS_PATH=3D~/src/edk2/BaseTools -bash$ . edksetup.sh BaseTools -- -=3D=3D=3DModify Conf Files=3D=3D=3D - -You will need to edit the Conf/tools_def.txt and Conf/target.txt files. T= hese changes will enable the MdeModulePkg to be built using the gcc x64 com= piler. - -=3D=3D=3D=3DEnable GCC X64 Cross-Compiler=3D=3D=3D=3D - -For the Conf/tools_def.txt file, find the following entry and comment the = line out: - -
-DEFINE UNIXGCC_X64_PETOOLS_PREFIX =3D /opt/tiano/x86_64-pc-mingw64/x86_64= -pc-mingw64/bin/ -- -Next, find the following entry and uncomment the line: - -
-DEFINE UNIXGCC_X64_PETOOLS_PREFIX =3D ENV(HOME)/programs/gcc/x64/bin/x86_= 64-pc-mingw32- -- -=3D=3D=3D=3DSet Build Target Information=3D=3D=3D=3D - -For the Conf/target.txt file, find the following lines: - -
-ACTIVE_PLATFORM =3D Nt32Pkg/Nt32Pkg.dsc -TARGET_ARCH =3D IA32 -TOOL_CHAIN_TAG =3D MYTOOLS -- -And change the cooresponding lines to match these: - -
-ACTIVE_PLATFORM =3D MdeModulePkg/MdeModulePkg.dsc -TARGET_ARCH =3D X64 -TOOL_CHAIN_TAG =3D UNIXGCC -- -=3D=3D=3DBuild Hello World! (and the rest of MdeModulePkg)=3D=3D=3D - -Now you should be able to simply run the build command to compile the MdeM= odulePkg. - -
-bash$ build -- -As a tangible result of the build, you should have the HelloWorld UEFI X64= application. If you have a X64 UEFI system available to you, then this ap= plication should be able to run successfully under the shell. - -
-bash$ ls Build/MdeModule/DEBUG_UNIXGCC/X64/HelloWorld.efi -- -=3D=3DEnabling Other Tools=3D=3D - -The above showed how to setup an X64 build environment for building the co= re MdeModulePkg. However, other packages may require additional tools such= as an IA32 cross-compiler and an ASL compiler. The steps to build these t= ools are described in this section. - -=3D=3D=3DBuild gcc IA32 UEFI cross compiler=3D=3D=3D - -In order to build UEFI images for IA32, you will need to build a cross-com= piler build of gcc. This can take quite a while to complete, possibly seve= ral hours on older systems. But, a Python script has been provided to auto= mate this build process. - -Note: This is only needed if behind a internet firewall! -
-bash$ export http_proxy=3Dhttp://proxy.domain.com:proxy_port -- -To build gcc for IA32, use these commands (this will take quite a while to= complete): - -
-bash$ cd ~/src/edk2/BaseTools/gcc -bash$ ./mingw-gcc-build.py --arch=3Dia32 \ - --prefix=3D~/programs/gcc/ia32 -- -=3D=3D=3D=3DModify Conf Files=3D=3D=3D=3D - -Once the cross-compiler has been successfully built the Conf/tools_def.txt= will need to be updated so the cross-compiler can be used. - -Find the following statement in Conf/tools_def.txt and comment the line ou= t: - -
-DEFINE UNIXGCC_IA32_PETOOLS_PREFIX =3D /opt/tiano/i386-tiano-pe/i386-tiano= -pe/bin/ -- -Next, find the following statement and uncomment the line:=20 - -
-DEFINE UNIXGCC_IA32_PETOOLS_PREFIX =3D ENV(HOME)/programs/gcc/ia32/bin/i68= 6-pc-mingw32- -- -To enable building your target image with IA32 support the Conf/target.txt= will also need to be modified. - -Find the TARGET_ARCH definition in Conf/target.txt and change the correspo= nding line to match this - -
-TARGET_ARCH =3D IA32 -- -=3D=3D=3DBuild the Intel ASL (iasl) compiler=3D=3D=3D - -The Intel ASL compiler is not required for all edk2 developers. It is unl= ikely that UEFI Application or UEFI Driver builds will need an ASL compiler= . But, if you are building an entire system firmware image, then you may n= eed an ASL compiler. For example, the edk2 OVMF sample platform does requi= re an ASL compiler in order to be built. - -First, download the latest ACPI-CA release from http://www.acpica.org. - -'''OS X users''': At this time, the latest versions of ACPI-CA are not bui= lding on Mac OS X, so please use the release from 20081031 instead. - -
-bash$ cd ~/src -bash$ wget http://www.acpica.org/download/acpica-unix-20090521.tar.gz -bash$ tar -zxf acpica-unix-20090521.tar.gz -bash$ make -C acpica-unix-20090521/compiler -bash$ ln -s ~/src/acpica-unix-20090521/compiler/iasl ~/programs/iasl -- -=3D=3D=3D=3DModify Conf Files=3D=3D=3D=3D - -Once the Intel ASL compiler has been successfully built the Conf/tools_def= .txt will need to be updated so the ASL compiler can be used. - -Find the following statement in Conf/tools_def.txt and comment the line ou= t: - -
-DEFINE UNIX_IASL_BIN =3D /usr/bin/iasl -- -Next, find the following statement and uncomment the line: - -
-DEFINE UNIX_IASL_BIN =3D $(HOME)/programs/iasl -- -=3D=3D=3DBuild [http://www.tianocore.org/ovmf/ OVMF]=3D=3D=3D - -Once your build environment is set up you might be interested in building = the [http://www.tianocore.org/ovmf/ OVMF] platform which is included in the= main edk2 source tree. Since [http://www.tianocore.org/ovmf/ OVMF] builds= a full system firmware image this may be of interest to UEFI system firmwa= re developers. +__NOTOC__ +=3D=3DCommon instructions for Unix =3D=3D + + Note: New build instructions are available. It is recommended to start w= ith the new instructions if learning how to + build edk2 for the first time. This page is retained for reference. + +New instructions: [[Build-Instructions.md|Build Instructions]] + +A significant portion of the steps are common on the various UNIX-like pla= tforms. You should start with the instructions for the operating system th= at most closely matches your platform, and it will direct you here at the a= ppropriate time. + +Note these instructions are not for current Linux distributions, only UNIX= -like systems that do not work with the [[Using EDK II with Native GCC]] in= structions. Please follow the [[Using EDK II with Native GCC]] guide for ma= instream Linux distros. + +=3D=3D=3DGet the edk2 source tree using Git =3D=3D=3D + +
+bash$ mkdir ~/src +bash$ cd ~/src +bash$ git clone https://github.com/tianocore/edk2 ++ +=3D=3D=3D=3DFor EDKII project developers:=3D=3D=3D=3D +* Clone the EDK II project repository +** git clone https://github.com/tianocore/edk2 +* Change to the edk2 directory +* Build the tools +** make -C BaseTools +* Run the edksetup.sh script +** . edksetup.sh +When the above steps are done, you can work in the edk2 directory for code= development. + +=3D=3D=3DBuild the EDK II BaseTools=3D=3D=3D + +
+bash$ make -C edk2/BaseTools ++ +=3D=3D=3DBuild gcc x64 UEFI cross compiler=3D=3D=3D + +In order to build UEFI images for x64, you will need to build a cross-comp= iler build of gcc. This can take quite a while to complete, possibly sever= al hours on older systems. But, a Python script has been provided to autom= ate this build process. + +Note: This is only needed if behind a internet firewall! +
+bash$ export http_proxy=3Dhttp://proxy.domain.com:proxy_port ++ +To build gcc for x64, use these commands (this will take quite a while to = complete): + +
+bash$ cd ~/src/edk2/BaseTools/gcc +bash$ ./mingw-gcc-build.py --arch=3Dx64 \ + --prefix=3D~/programs/gcc/x64 ++ +=3D=3D=3DSetup build shell environment=3D=3D=3D + +
+bash$ cd ~/src/edk2 +bash$ export EDK_TOOLS_PATH=3D~/src/edk2/BaseTools +bash$ . edksetup.sh BaseTools ++ +=3D=3D=3DModify Conf Files=3D=3D=3D + +You will need to edit the Conf/tools_def.txt and Conf/target.txt files. T= hese changes will enable the MdeModulePkg to be built using the gcc x64 com= piler. + +=3D=3D=3D=3DEnable GCC X64 Cross-Compiler=3D=3D=3D=3D + +For the Conf/tools_def.txt file, find the following entry and comment the = line out: + +
+DEFINE UNIXGCC_X64_PETOOLS_PREFIX =3D /opt/tiano/x86_64-pc-mingw64/x86_64= -pc-mingw64/bin/ ++ +Next, find the following entry and uncomment the line: + +
+DEFINE UNIXGCC_X64_PETOOLS_PREFIX =3D ENV(HOME)/programs/gcc/x64/bin/x86_= 64-pc-mingw32- ++ +=3D=3D=3D=3DSet Build Target Information=3D=3D=3D=3D + +For the Conf/target.txt file, find the following lines: + +
+ACTIVE_PLATFORM =3D Nt32Pkg/Nt32Pkg.dsc +TARGET_ARCH =3D IA32 +TOOL_CHAIN_TAG =3D MYTOOLS ++ +And change the cooresponding lines to match these: + +
+ACTIVE_PLATFORM =3D MdeModulePkg/MdeModulePkg.dsc +TARGET_ARCH =3D X64 +TOOL_CHAIN_TAG =3D UNIXGCC ++ +=3D=3D=3DBuild Hello World! (and the rest of MdeModulePkg)=3D=3D=3D + +Now you should be able to simply run the build command to compile the MdeM= odulePkg. + +
+bash$ build ++ +As a tangible result of the build, you should have the HelloWorld UEFI X64= application. If you have a X64 UEFI system available to you, then this ap= plication should be able to run successfully under the shell. + +
+bash$ ls Build/MdeModule/DEBUG_UNIXGCC/X64/HelloWorld.efi ++ +=3D=3DEnabling Other Tools=3D=3D + +The above showed how to setup an X64 build environment for building the co= re MdeModulePkg. However, other packages may require additional tools such= as an IA32 cross-compiler and an ASL compiler. The steps to build these t= ools are described in this section. + +=3D=3D=3DBuild gcc IA32 UEFI cross compiler=3D=3D=3D + +In order to build UEFI images for IA32, you will need to build a cross-com= piler build of gcc. This can take quite a while to complete, possibly seve= ral hours on older systems. But, a Python script has been provided to auto= mate this build process. + +Note: This is only needed if behind a internet firewall! +
+bash$ export http_proxy=3Dhttp://proxy.domain.com:proxy_port ++ +To build gcc for IA32, use these commands (this will take quite a while to= complete): + +
+bash$ cd ~/src/edk2/BaseTools/gcc +bash$ ./mingw-gcc-build.py --arch=3Dia32 \ + --prefix=3D~/programs/gcc/ia32 ++ +=3D=3D=3D=3DModify Conf Files=3D=3D=3D=3D + +Once the cross-compiler has been successfully built the Conf/tools_def.txt= will need to be updated so the cross-compiler can be used. + +Find the following statement in Conf/tools_def.txt and comment the line ou= t: + +
+DEFINE UNIXGCC_IA32_PETOOLS_PREFIX =3D /opt/tiano/i386-tiano-pe/i386-tiano= -pe/bin/ ++ +Next, find the following statement and uncomment the line: + +
+DEFINE UNIXGCC_IA32_PETOOLS_PREFIX =3D ENV(HOME)/programs/gcc/ia32/bin/i68= 6-pc-mingw32- ++ +To enable building your target image with IA32 support the Conf/target.txt= will also need to be modified. + +Find the TARGET_ARCH definition in Conf/target.txt and change the correspo= nding line to match this + +
+TARGET_ARCH =3D IA32 ++ +=3D=3D=3DBuild the Intel ASL (iasl) compiler=3D=3D=3D + +The Intel ASL compiler is not required for all edk2 developers. It is unl= ikely that UEFI Application or UEFI Driver builds will need an ASL compiler= . But, if you are building an entire system firmware image, then you may n= eed an ASL compiler. For example, the edk2 OVMF sample platform does requi= re an ASL compiler in order to be built. + +First, download the latest ACPI-CA release from http://www.acpica.org. + +'''OS X users''': At this time, the latest versions of ACPI-CA are not bui= lding on Mac OS X, so please use the release from 20081031 instead. + +
+bash$ cd ~/src +bash$ wget http://www.acpica.org/download/acpica-unix-20090521.tar.gz +bash$ tar -zxf acpica-unix-20090521.tar.gz +bash$ make -C acpica-unix-20090521/compiler +bash$ ln -s ~/src/acpica-unix-20090521/compiler/iasl ~/programs/iasl ++ +=3D=3D=3D=3DModify Conf Files=3D=3D=3D=3D + +Once the Intel ASL compiler has been successfully built the Conf/tools_def= .txt will need to be updated so the ASL compiler can be used. + +Find the following statement in Conf/tools_def.txt and comment the line ou= t: + +
+DEFINE UNIX_IASL_BIN =3D /usr/bin/iasl ++ +Next, find the following statement and uncomment the line: + +
+DEFINE UNIX_IASL_BIN =3D $(HOME)/programs/iasl ++ +=3D=3D=3DBuild [http://www.tianocore.org/ovmf/ OVMF]=3D=3D=3D + +Once your build environment is set up you might be interested in building = the [http://www.tianocore.org/ovmf/ OVMF] platform which is included in the= main edk2 source tree. Since [http://www.tianocore.org/ovmf/ OVMF] builds= a full system firmware image this may be of interest to UEFI system firmwa= re developers. diff --git a/Common-instructions.mediawiki b/Common-instructions.mediawiki index 6e752e5699db..956813cda163 100644 --- a/Common-instructions.mediawiki +++ b/Common-instructions.mediawiki @@ -1,103 +1,108 @@ -__NOTOC__ -=3DCommon EDK II Build Instructions for Linux=3D - -These instructions assume you have installed Linux packages required for a= n [[EDK II]] build environment, including git (example: [https://github.com= /tianocore/tianocore.github.io/wiki/Using-EDK-II-with-Native-GCC#Ubuntu_160= 4_LTS__Ubuntu_1610|Ubuntu 16.04/16.10]). The following instructions are com= mon to the majority of Linux environments. - -=3D=3D=3DGet the edk2 source tree using Git =3D=3D=3D - -
-bash$ mkdir ~/src -bash$ cd ~/src -bash$ git clone https://github.com/tianocore/edk2 -- -Note: the 'git clone' command above pulls the latest code from edk2. If yo= u want to work from a stable release, specify a release tag when cloning. E= xample: - -
-bash$ git clone https://github.com/tianocore/edk2.git vUDK2017 -- -=3D=3D=3DInitialize submodules=3D=3D=3D - -
-bash$ git submodule update --init -- -=3D=3D=3DCompile build tools =3D=3D=3D - -
-bash$ cd ~/src/edk2 -bash$ make -C BaseTools -bash$ . edksetup.sh -- -When the above steps are done, you can work in the edk2 directory for code= development. - -=3D=3D=3DBuild the EDK II BaseTools=3D=3D=3D - -
-bash$ make -C edk2/BaseTools -- -=3D=3D=3DSetup build shell environment=3D=3D=3D - -
-bash$ cd ~/src/edk2 -bash$ export EDK_TOOLS_PATH=3D$HOME/src/edk2/BaseTools -bash$ . edksetup.sh BaseTools -- -=3D=3D=3DModify Conf Files=3D=3D=3D - -Running
edksetup.sh
populates the edk2/Conf
dire=
ctory with default configuration files. You will need to edit the Con=
f/target.txt
file to set the build platform, target architecture, to=
ol chain, and multi-threading options. The example below is based on buildi=
ng the MdeModulePkg
using GCC5.
-
-=3D=3D=3D=3DSet Build Target Information=3D=3D=3D=3D
-
-For the Conf/target.txt
file, find the following lines:
-
--ACTIVE_PLATFORM =3D Nt32Pkg/Nt32Pkg.dsc -TOOL_CHAIN_TAG =3D MYTOOLS -- -And change the corresponding lines to match these: - -
-ACTIVE_PLATFORM =3D MdeModulePkg/MdeModulePkg.dsc -TOOL_CHAIN_TAG =3D GCC5 -- -:Note: The
gcc --version
command can be used to find out your=
GCC version. Use the '''GCC45''' toolchain for gcc 4.5.* and the '''GCC46=
''' toolchain for gcc 4.6.*.
-
-:Note: for GCC5 please install the gcc-5 package. Example for Ubuntu: -TARGET_ARCH =3D IA32 -- -Change this reflect the build architecture for the final UEFI binary. - -:Example:
X64
, IA32 X64
(which will build both a=
rchitectures).
-
-Optional: enable multi-threaded build. The default value for MAX_CON=
CURRENT_THREAD_NUMBER
is 1, which disables multi-threaded build. Cha=
nge this value based on your system's multi-threading capabilities. The for=
mula is '1 + (2 x processor threads)'.
-
-:Example: for an Intel Core i5 (two processor cores w/ hyperthreading), th=
e value is 9
.
-
-=3D=3D=3DBuild Hello World! (and the rest of MdeModulePkg)=3D=3D=3D
-
-Now you should be able to simply run the build command to compile Md=
eModulePkg
.
-
--bash$ build -- -One result of the build is that you should have the HelloWorld UEFI applic= ation: -
-bash$ ls Build/MdeModule/DEBUG_*/*/HelloWorld.efi -- -=3D=3D=3DBuild [[OVMF]]=3D=3D=3D - -Once your build environment is set up you might be interested in [[How to = build OVMF|building the OVMF platform]] which is included in the main [[EDK= II]] source tree. Since [[OVMF]] builds a full system firmware image, thi= s may be of interest to UEFI system firmware developers. +__NOTOC__ +=3DCommon EDK II Build Instructions for Linux=3D + + Note: New build instructions are available. It is recommended to start w= ith the new instructions if learning how to + build edk2 for the first time. This page is retained for reference. + +New instructions: [[Build-Instructions.md|Build Instructions]] + +These instructions assume you have installed Linux packages required for a= n [[EDK II]] build environment, including git (example: [https://github.com= /tianocore/tianocore.github.io/wiki/Using-EDK-II-with-Native-GCC#Ubuntu_160= 4_LTS__Ubuntu_1610|Ubuntu 16.04/16.10]). The following instructions are com= mon to the majority of Linux environments. + +=3D=3D=3DGet the edk2 source tree using Git =3D=3D=3D + +
+bash$ mkdir ~/src +bash$ cd ~/src +bash$ git clone https://github.com/tianocore/edk2 ++ +Note: the 'git clone' command above pulls the latest code from edk2. If yo= u want to work from a stable release, specify a release tag when cloning. E= xample: + +
+bash$ git clone https://github.com/tianocore/edk2.git vUDK2017 ++ +=3D=3D=3DInitialize submodules=3D=3D=3D + +
+bash$ git submodule update --init ++ +=3D=3D=3DCompile build tools =3D=3D=3D + +
+bash$ cd ~/src/edk2 +bash$ make -C BaseTools +bash$ . edksetup.sh ++ +When the above steps are done, you can work in the edk2 directory for code= development. + +=3D=3D=3DBuild the EDK II BaseTools=3D=3D=3D + +
+bash$ make -C edk2/BaseTools ++ +=3D=3D=3DSetup build shell environment=3D=3D=3D + +
+bash$ cd ~/src/edk2 +bash$ export EDK_TOOLS_PATH=3D$HOME/src/edk2/BaseTools +bash$ . edksetup.sh BaseTools ++ +=3D=3D=3DModify Conf Files=3D=3D=3D + +Running
edksetup.sh
populates the edk2/Conf
dire=
ctory with default configuration files. You will need to edit the Con=
f/target.txt
file to set the build platform, target architecture, to=
ol chain, and multi-threading options. The example below is based on buildi=
ng the MdeModulePkg
using GCC5.
+
+=3D=3D=3D=3DSet Build Target Information=3D=3D=3D=3D
+
+For the Conf/target.txt
file, find the following lines:
+
++ACTIVE_PLATFORM =3D Nt32Pkg/Nt32Pkg.dsc +TOOL_CHAIN_TAG =3D MYTOOLS ++ +And change the corresponding lines to match these: + +
+ACTIVE_PLATFORM =3D MdeModulePkg/MdeModulePkg.dsc +TOOL_CHAIN_TAG =3D GCC5 ++ +:Note: The
gcc --version
command can be used to find out your=
GCC version. Use the '''GCC45''' toolchain for gcc 4.5.* and the '''GCC46=
''' toolchain for gcc 4.6.*.
+
+:Note: for GCC5 please install the gcc-5 package. Example for Ubuntu: +TARGET_ARCH =3D IA32 ++ +Change this reflect the build architecture for the final UEFI binary. + +:Example:
X64
, IA32 X64
(which will build both a=
rchitectures).
+
+Optional: enable multi-threaded build. The default value for MAX_CON=
CURRENT_THREAD_NUMBER
is 1, which disables multi-threaded build. Cha=
nge this value based on your system's multi-threading capabilities. The for=
mula is '1 + (2 x processor threads)'.
+
+:Example: for an Intel Core i5 (two processor cores w/ hyperthreading), th=
e value is 9
.
+
+=3D=3D=3DBuild Hello World! (and the rest of MdeModulePkg)=3D=3D=3D
+
+Now you should be able to simply run the build command to compile Md=
eModulePkg
.
+
++bash$ build ++ +One result of the build is that you should have the HelloWorld UEFI applic= ation: +
+bash$ ls Build/MdeModule/DEBUG_*/*/HelloWorld.efi ++ +=3D=3D=3DBuild [[OVMF]]=3D=3D=3D + +Once your build environment is set up you might be interested in [[How to = build OVMF|building the OVMF platform]] which is included in the main [[EDK= II]] source tree. Since [[OVMF]] builds a full system firmware image, thi= s may be of interest to UEFI system firmware developers. diff --git a/Getting-Started-with-EDK-II.mediawiki b/Getting-Started-with-E= DK-II.mediawiki index f616d1e86e4c..eb6da7dfdc56 100644 --- a/Getting-Started-with-EDK-II.mediawiki +++ b/Getting-Started-with-EDK-II.mediawiki @@ -1,4 +1,10 @@ __NOTOC__ + + Note: New build instructions are available. It is recommended to start w= ith the new instructions if learning how to + build edk2 for the first time. This page is retained for reference. + +New instructions: [[Build-Instructions.md|Build Instructions]] + =3DDownloading and Compiling Code=3D =20 This page shows the steps for downloading [[EDK II]] from GitHub and compi= ling projects under various OS/compiler environments. @@ -15,24 +21,24 @@ Several build environments are supported and documented= . If instructions are no '''Note:''' Some other build tools may be required depending on the projec= t or package: * [[Nasm Setup|Nasm]] * [[ASL Setup|ASL Compiler]] -* Install Python 3.7 or later (https://www.python.org/) to run python too= l from source=20 +* Install Python 3.7 or later (https://www.python.org/) to run python too= l from source ** Python 2.7.10 or later can still be used with PYTHON_HOME =20 -'''Note:''' Some of the examples use the [[Multiple_Workspace]] `PACKAGES_= PATH` feature to the configure EDK II build environment. For example, this = is required for using platform code based on edk2-platforms: (https://githu= b.com/tianocore/edk2-platforms).=20 +'''Note:''' Some of the examples use the [[Multiple_Workspace]] `PACKAGES_= PATH` feature to the configure EDK II build environment. For example, this = is required for using platform code based on edk2-platforms: (https://githu= b.com/tianocore/edk2-platforms). =20 Once you have a basic build environment running, you can build a project i= n RELEASE or [[EDK II Debugging|DEBUG]] mode. =20 =3D=3DGitHub Help=3D=3D =20 -GitHub (https://help.github.com/index.html) provides step-by-step instruct= ions for user registration and basic features supported by GitHub=20 +GitHub (https://help.github.com/index.html) provides step-by-step instruct= ions for user registration and basic features supported by GitHub =20 * Setup GitHub for Linux/Windows/MAC (https://help.github.com/articles/set= -up-git) * Download and install a git GUI interface: git GUI Clients (https://git-s= cm.com/download/gui/win) | TortoiseGit (https://tortoisegit.org/) =20 =3D=3D=3DGitHub EDK II Project Repositories=3D=3D=3D =20 -* The EDK II project repository is available at https://github.com/tianoco= re/edk2.=20 -* Prebuilt Windows tools are available at https://github.com/tianocore/edk= 2-BaseTools-win32.=20 +* The EDK II project repository is available at https://github.com/tianoco= re/edk2. +* Prebuilt Windows tools are available at https://github.com/tianocore/edk= 2-BaseTools-win32. * [[EDK II Platforms]] are available at https://github.com/tianocore/edk2-= platforms. * Content that is not released under an accepted open source license can b= e found at https://github.com/tianocore/edk2-non-osi. =20 diff --git a/UDK2017-How-to-Build.md b/UDK2017-How-to-Build.md index 4eca47f98e21..2f7f80125513 100644 --- a/UDK2017-How-to-Build.md +++ b/UDK2017-How-to-Build.md @@ -1,123 +1,129 @@ -# How to Build [[UDK2017]]=20 -Table of Contents -1) [HOW TO BUILD (WINDOWS SYSTEM)](#how-to-build-windows-system) -2) [ HOW TO BUILD (LINUX-LIKE SYSTEM)](#how-to-build-linux-like-system) - -## HOW TO BUILD (WINDOWS SYSTEM) - -The steps below are verified on Microsoft Windows 10 Enterprise*: - -1. Setup Build Environment - 1) Install Microsoft Visual Studio 2015* in the build machine and make - sure that AMD64 complier was selected when installing. - 2) Download NASM 2.0.7 or later from http://www.nasm.us/ and install = it to - C:\Nasm. Make sure C:\Nasm is added to system environment variable= 'PATH' - 3) Set up for using GitHub for Windows. See: - https://github.com/tianocore/tianocore.github.io/wiki/Getting-Started-= with-EDK-II#github-help - 4) Download and install Python2.7.x https://www.python.org/ for buil= ding the BaseTools - Default install directory is: C:/Python27 - -2. Create the full Source Code directory for the UDK2017 release - 1) Create a working space directory in the build machine, for example= , C:\MyWorkspace - 2) Download the official UDK2017 release .zip file from the [UDK2017 = Release Page](https://github.com/tianocore/edk2/releases/tag/vUDK2017) - 1) Download - UDK2017 edk-vUDK2017 Workspace [Source code (zip fil= e)](https://github.com/tianocore/edk2/archive/vUDK2017.zip)=20 - 2) Extract files in [edk2-vUDK2017] to the working space directory= C:\MyWorkspace. - 3) **OR** Checkout the vUDK2017 Tag from GitHub with the following "g= it" command
- set PYTHON_HOME=3DC:\Python27 - set EDK_TOOLS_PATH=3D%CD%\BaseTools - BaseTools\toolssetup.bat Rebuild -- -5. Build Steps - *** NT32 *** - - 1) Open a Microsoft Visual Studio* command prompt, type `cd C:\MyWork= space` - to enter the workspace directory - 2) Use edksetup.bat command to initialize the working environment. - `edksetup --nt32` - 3) Type following command to build Nt32 platform - `build -t VS2015x86` - 4) Upon the build completing successfully there should be the UEFI Ap= plication "`HelloWorld.efi`" in the C:\MyWorkspace\Build\MdeModule\DEBUG_V= S2015x86\IA32 directory - - ---- - -## HOW TO BUILD (LINUX-LIKE SYSTEM) -The below steps are verified on Ubuntu 16.04 LTS Desktop*: - -1. Setup Build Environment - 1) Follow instructions for setting up the build environment on tianoc= ore.org. - "https://github.com/tianocore/tianocore.github.io/wiki/Using-EDK-I= I-with-Native-GCC" - 2) Please notice that here the root is `"~/src/MyWorkspace"` instead - of `"~/src/edk2"` - 3) Make sure BaseTools is built and required software like iASL com= piler - are installed. Some operations need switch to user "root" to ex= ecute. - At Ubuntu, you can type `"sudo apt-get install git"` under termin= al prompt "Cnt-Alt-T" to - install git. - 2) Install NASM 2.0.7 or later. - At Ubuntu, you can type `"sudo apt-get install nasm"` under termin= al prompt to - install it. - You can also download the source package from http://www.nasm.us/ = and - install it following the instruction on the website. - 3) Install IASL 20150818 or later. - At Ubuntu, you can type `"sudo apt-get install iasl"` under termin= al prompt to - install it. - You can also download the source package from https://acpica.org/d= ownloads - and install it following the instruction on the website. - 4) Install the C Compiler- Ubuntu 16.04 LTS you can use GNU C compil= er (v5.4.0)=20 - At Ubuntu, you can type `"sudo apt-get install gcc-5"` under termi= nal prompt to install it. - - -2. Create the full Source Code directory for the UDK2017 release - 1) Create a working space directory in the build machine, for example= , ~/src/MyWorkspace - 2) Download the official UDK2017 release .tar file from the [UDK2017 = Release Page](https://github.com/tianocore/edk2/releases/tag/vUDK2017) - 1) Download - UDK2017 edk-vUDK2017 Workspace [Source code (tar.gz = file)](https://github.com/tianocore/edk2/archive/vUDK2017.tar.gz)=20 - 2) Extract files in [edk2-vUDK2017] to the working space directory= ~/src/MyWorkspace. - 3) **OR** Checkout the vUDK2017 tag from GitHub with the following "g= it" command=20 - 1) Run `"git clone https://github.com/tianocore/edk2.git vUDK2017= "` - 2) Move all files and folders under "vUDK2017" to "~/src/MyWorksp= ace" - =20 -3. Generate OpenSSL* Crypto Library - 1) Open file "~/src/MyWorkspace/CryptoPkg/Library/OpensslLib/OpenSSL-= HOWTO.txt" - and follow the instruction to install OpenSSL* for UEFI building. - For this release, please use OpenSSL-1.1.0e. - -4. Build Steps - *** MdeModulePkg *** - 1) Open a terminal and type `"cd ~/src/MyWorkspace"` to enter the wor= kspace - directory. - 2) First build the BaseTools by typing=20 - `"make -C BaseTools"` - 3) Initialize the build environment by typing=20 - `". edksetup.sh"`. - 4) Type following command to build platforms using GCC v5.4.0
+ set PYTHON_HOME=3DC:\Python27 + set EDK_TOOLS_PATH=3D%CD%\BaseTools + BaseTools\toolssetup.bat Rebuild ++ +5. Build Steps + *** NT32 *** + + 1) Open a Microsoft Visual Studio* command prompt, type `cd C:\MyWork= space` + to enter the workspace directory + 2) Use edksetup.bat command to initialize the working environment. + `edksetup --nt32` + 3) Type following command to build Nt32 platform + `build -t VS2015x86` + 4) Upon the build completing successfully there should be the UEFI Ap= plication "`HelloWorld.efi`" in the C:\MyWorkspace\Build\MdeModule\DEBUG_V= S2015x86\IA32 directory + + +--- + +## HOW TO BUILD (LINUX-LIKE SYSTEM) +The below steps are verified on Ubuntu 16.04 LTS Desktop*: + +1. Setup Build Environment + 1) Follow instructions for setting up the build environment on tianoc= ore.org. + "https://github.com/tianocore/tianocore.github.io/wiki/Using-EDK-I= I-with-Native-GCC" + 2) Please notice that here the root is `"~/src/MyWorkspace"` instead + of `"~/src/edk2"` + 3) Make sure BaseTools is built and required software like iASL com= piler + are installed. Some operations need switch to user "root" to ex= ecute. + At Ubuntu, you can type `"sudo apt-get install git"` under termin= al prompt "Cnt-Alt-T" to + install git. + 2) Install NASM 2.0.7 or later. + At Ubuntu, you can type `"sudo apt-get install nasm"` under termin= al prompt to + install it. + You can also download the source package from http://www.nasm.us/ = and + install it following the instruction on the website. + 3) Install IASL 20150818 or later. + At Ubuntu, you can type `"sudo apt-get install iasl"` under termin= al prompt to + install it. + You can also download the source package from https://acpica.org/d= ownloads + and install it following the instruction on the website. + 4) Install the C Compiler- Ubuntu 16.04 LTS you can use GNU C compil= er (v5.4.0) + At Ubuntu, you can type `"sudo apt-get install gcc-5"` under termi= nal prompt to install it. + + +2. Create the full Source Code directory for the UDK2017 release + 1) Create a working space directory in the build machine, for example= , ~/src/MyWorkspace + 2) Download the official UDK2017 release .tar file from the [UDK2017 = Release Page](https://github.com/tianocore/edk2/releases/tag/vUDK2017) + 1) Download - UDK2017 edk-vUDK2017 Workspace [Source code (tar.gz = file)](https://github.com/tianocore/edk2/archive/vUDK2017.tar.gz) + 2) Extract files in [edk2-vUDK2017] to the working space directory= ~/src/MyWorkspace. + 3) **OR** Checkout the vUDK2017 tag from GitHub with the following "g= it" command + 1) Run `"git clone https://github.com/tianocore/edk2.git vUDK2017= "` + 2) Move all files and folders under "vUDK2017" to "~/src/MyWorksp= ace" + +3. Generate OpenSSL* Crypto Library + 1) Open file "~/src/MyWorkspace/CryptoPkg/Library/OpensslLib/OpenSSL-= HOWTO.txt" + and follow the instruction to install OpenSSL* for UEFI building. + For this release, please use OpenSSL-1.1.0e. + +4. Build Steps + *** MdeModulePkg *** + 1) Open a terminal and type `"cd ~/src/MyWorkspace"` to enter the wor= kspace + directory. + 2) First build the BaseTools by typing + `"make -C BaseTools"` + 3) Initialize the build environment by typing + `". edksetup.sh"`. + 4) Type following command to build platforms using GCC v5.4.0
- set PYTHON_HOME=3DC:\Python27 - edksetup.bat Rebuild -- -5. Build Steps - *** NT32 *** - - 1) Open a Microsoft Visual Studio* command prompt, type `cd C:\MyWork= space` - to enter the workspace directory - 2) Use edksetup.bat command to initialize the working environment. - `edksetup --nt32` - 3) Type following command to build Nt32 platform - `build -t VS2015x86` - 4) Upon the build completing successfully there should be the UEFI Ap= plication "`HelloWorld.efi`" in the C:\MyWorkspace\Build\NT32IA32\DEBUG_VS= 2015x86\IA32 directory - - ---- - -## HOW TO BUILD (LINUX-LIKE SYSTEM) -The below steps are verified on Ubuntu 16.04 LTS Desktop*: - -1. Setup Build Environment - 1) Follow instructions for setting up the build environment on tianoc= ore.org. - "https://github.com/tianocore/tianocore.github.io/wiki/Using-EDK-I= I-with-Native-GCC" - - 2) Please notice that here the root is `"~/src/MyWorkspace`" inste= ad - of `"~/src/edk2"` - - 3) Make sure BaseTools is built and required software like iASL co= mpiler - is installed well. - a) Some operations need switch to user "root" to execute. - b) At Ubuntu, you can type `"sudo apt-get install git"` under = terminal "Cnt-Alt-T" to - install git. - 2) Install NASM 2.12.01 or later. - At Ubuntu, you can type "sudo apt-get install nasm" under terminal= to - install it. - You can also download the source package from http://www.nasm.us/ = and - install it following the instruction on the website. - 3) Install IASL 20150818 or later. - At Ubuntu, you can type `"sudo apt-get install iasl"` under termin= al to - install it. - You can also download the source package from https://acpica.org/d= ownloads - and install it following the instruction on the website. - -2. Create the full Source Code directory for the UDK2018 release - 1) Create a working space directory in the build machine, for example= , ~/src/MyWorkspace - 2) Download the official UDK2018 release .tar file from the [UDK2018 = Release Page](https://github.com/tianocore/edk2/releases/tag/vUDK2018) - 1) Download - UDK2018 edk-vUDK2018 Workspace [Source code (tar.gz = file)](https://github.com/tianocore/edk2/archive/vUDK2018.tar.gz)=20 - 2) Extract files in [edk2-vUDK2018] to the working space directory= ~/src/MyWorkspace. - 3) **OR** Checkout the vUDK2018 tag from GitHub with the following "g= it" command=20 - 1) Run `"git clone https://github.com/tianocore/edk2.git vUDK2018= "` - 2) Go to the vUDK2018 directory, and from there run: `git checkou= t tags/vUDK2018 -b vUDK2018` - 3) Move all files and folders under "vUDK2018" to "~/src/MyWorksp= ace" - =20 -3. Generate OpenSSL* Crypto Library - 1) Open file "~/src/MyWorkspace/CryptoPkg/Library/OpensslLib/OpenSSL-= HOWTO.txt" - and follow the instruction to install OpenSSL* for UEFI building. - For this release, please use OpenSSL-1.1.0g. Download it fro= m=20 - https://github.com/openssl/openssl/archive/OpenSSL_1_1_0g.zip - Extract it to ~/src/MyWorkspace/CryptoPkg/Library/OpensslLib, - and rename its directory name to openssl - - -4. Build Steps - *** MdeModulePkg *** - 1) Open a terminal and type `"cd ~/src/MyWorkspace"` to enter the wor= kspace - directory. - 2) First build the BaseTools by typing=20 - `"make -C BaseTools"` - 3) Initialize the build environment by typing=20 - `". edksetup.sh"`. - 4) Type following command to build platforms using GCC v5.4.0
+ set PYTHON_HOME=3DC:\Python27 + edksetup.bat Rebuild ++ +5. Build Steps + *** NT32 *** + + 1) Open a Microsoft Visual Studio* command prompt, type `cd C:\MyWork= space` + to enter the workspace directory + 2) Use edksetup.bat command to initialize the working environment. + `edksetup --nt32` + 3) Type following command to build Nt32 platform + `build -t VS2015x86` + 4) Upon the build completing successfully there should be the UEFI Ap= plication "`HelloWorld.efi`" in the C:\MyWorkspace\Build\NT32IA32\DEBUG_VS= 2015x86\IA32 directory + + +--- + +## HOW TO BUILD (LINUX-LIKE SYSTEM) +The below steps are verified on Ubuntu 16.04 LTS Desktop*: + +1. Setup Build Environment + 1) Follow instructions for setting up the build environment on tianoc= ore.org. + "https://github.com/tianocore/tianocore.github.io/wiki/Using-EDK-I= I-with-Native-GCC" + + 2) Please notice that here the root is `"~/src/MyWorkspace`" inste= ad + of `"~/src/edk2"` + + 3) Make sure BaseTools is built and required software like iASL co= mpiler + is installed well. + a) Some operations need switch to user "root" to execute. + b) At Ubuntu, you can type `"sudo apt-get install git"` under = terminal "Cnt-Alt-T" to + install git. + 2) Install NASM 2.12.01 or later. + At Ubuntu, you can type "sudo apt-get install nasm" under terminal= to + install it. + You can also download the source package from http://www.nasm.us/ = and + install it following the instruction on the website. + 3) Install IASL 20150818 or later. + At Ubuntu, you can type `"sudo apt-get install iasl"` under termin= al to + install it. + You can also download the source package from https://acpica.org/d= ownloads + and install it following the instruction on the website. + +2. Create the full Source Code directory for the UDK2018 release + 1) Create a working space directory in the build machine, for example= , ~/src/MyWorkspace + 2) Download the official UDK2018 release .tar file from the [UDK2018 = Release Page](https://github.com/tianocore/edk2/releases/tag/vUDK2018) + 1) Download - UDK2018 edk-vUDK2018 Workspace [Source code (tar.gz = file)](https://github.com/tianocore/edk2/archive/vUDK2018.tar.gz) + 2) Extract files in [edk2-vUDK2018] to the working space directory= ~/src/MyWorkspace. + 3) **OR** Checkout the vUDK2018 tag from GitHub with the following "g= it" command + 1) Run `"git clone https://github.com/tianocore/edk2.git vUDK2018= "` + 2) Go to the vUDK2018 directory, and from there run: `git checkou= t tags/vUDK2018 -b vUDK2018` + 3) Move all files and folders under "vUDK2018" to "~/src/MyWorksp= ace" + +3. Generate OpenSSL* Crypto Library + 1) Open file "~/src/MyWorkspace/CryptoPkg/Library/OpensslLib/OpenSSL-= HOWTO.txt" + and follow the instruction to install OpenSSL* for UEFI building. + For this release, please use OpenSSL-1.1.0g. Download it from + https://github.com/openssl/openssl/archive/OpenSSL_1_1_0g.zip + Extract it to ~/src/MyWorkspace/CryptoPkg/Library/OpensslLib, + and rename its directory name to openssl + + +4. Build Steps + *** MdeModulePkg *** + 1) Open a terminal and type `"cd ~/src/MyWorkspace"` to enter the wor= kspace + directory. + 2) First build the BaseTools by typing + `"make -C BaseTools"` + 3) Initialize the build environment by typing + `". edksetup.sh"`. + 4) Type following command to build platforms using GCC v5.4.0
-bash$ echo this bold text is a sample command -- -To execute this command, highlight the bold text of the command in your we= b browser. Most web browsers should be able to copy the text by selecting = Copy under the Edit menu. Now, change back to the terminal application, an= d there should be a Paste operation under the Edit menu. After pasting the= command into the shell, you may need to press the enter or return key to e= xecute the command.=20 - -Of course, there may be other ways to copy and paste the command into the = terminal which are specific to the windowing environment and applications t= hat you are using. If all else fails, however, you can type the command by= hand. - -Some commands are very long, and we use the backslash character (\) to tel= l the shell program that the command is not finished. For example: - -
-bash$ echo this bold text is a sample command \ - which is broken into two lines -- -When you copy and paste, make sure you include all lines of the command (i= ncluding the backslash (\) characters). If you are typing the command, you= can remove the backslash character (\) and combine the lines into a single= line if you prefer. - -If a command starts with the sudo command, then you may be prompted for yo= ur user password. This will be the same password as you used to login to t= he system. - -For the purposes of this set of instructions, we will be using the followi= ng paths. -{| -|Edk2 source tree: || ~/src/edk2 -|- -|GCC X64 cross-compiler installation: || ~/programs/gcc/x64 -|- -|GCC IA32 cross-compiler installation: || ~/programs/gcc/ia32 -|- -|Intel ASL Compiler installation: || ~/src/acpica-unix-20090521/compiler/i= asl (symlink to compiler at ~/programs/iasl) -|} - -You will need to change the commands if you want to use different location= s, but this is not recommended unless you are sure that you know what you a= re doing. - -=3D=3D=3DInternet proxies=3D=3D=3D - -If your network utilizes a firewall with a web proxy, then you may need to= configure your proxy information for various command line applications to = work. You may need to consult with your network administrator to find out = the computer name and port to use for proxy setup. The following commands = are common examples of how you would configure your proxy by setting an env= ironment variable: - -
-bash$ export http_proxy=3Dhttp://proxy.domain.com:proxy_port -bash$ export ftp_proxy=3D$http_proxy -- -To utilize the subversion source control command behind an internet firewa= ll with a web proxy, you should configure the ~/.subversion/servers file. - -=3D=3D Cygwin 1.7.1 =3D=3D -Notes: -* Cygwin is not officially supported or tested by the edk2 project at this= time. -* Building of [http://www.tianocore.org/edk2/ EDK II] components will be d= one using bash. -Prerequisites: -* Cygwin 1.7.1 is currently installed on the system. -* Cygwin 1.7.1 setup.exe is available on the system to install additional = packages as needed. - -Run Cygwin setup.exe and install the following additional packages. -* bison -* flex -* libgmp-devel -* libiconv -* libmpfr-devel -* gcc (use the compiler upgrade helper option under Devel) -* make -* python -* subversion -* wget -* libuuid-devel -* util-linux (for uuidgen) - -When pulling source files using subversion you may choose to get them to a= more Windows friendly location. All system drives are mapped under /cygdr= ive when using CYGWIN and bash (ie. C:\ maps to /cygdrive/c). This allows = you to substitute ~/src/edk2 for an alternate path such as /cygdrive/c/src/= edk2 so files can be access at C:\src\edk2 as well. - - -Continue with common instructions for Unix - - -The [[Common instructions for Unix|remaining instructions]] are common for= most UNIX-like systems. - -=3D=3DFedora 11=3D=3D -Please note: -* Fedora 11 is not officially supported or tested by the edk2 project at t= his time. -* These instructions assume that the Software Development option was enabl= ed during the Fedora installation. - -=3D=3D=3DOpen the GNOME Terminal program=3D=3D=3D - -These instructions will utilize Fedora's built in command shell (bash) via= the GNOME Terminal application. To open the Terminal application, locate = it under the Applications menu and the System Tools sub-menu. - -=3D=3D=3DInstall MPFR library=3D=3D=3D - -The MPFR library must be installed to allow the gcc cross compiler to be b= uilt. - -
-bash$ mkdir ~/src -bash$ cd ~/src -bash$ wget http://www.mpfr.org/mpfr-current/mpfr-2.4.1.tar.bz2 -bash$ tar -jxf mpfr-2.4.1.tar.bz2 -bash$ cd mpfr-2.4.1 -bash$ ./configure --prefix=3D/usr -bash$ make -- -To install the library, you must be root. Therefore we use 'su' to become= the root user, for the 'make install' command. - -
-bash$ su -bash$ make install -bash$ exit -- - -Continue with common instructions for Unix - - -The [[Common instructions for Unix |remaining instructions]] are common fo= r most UNIX-like systems. - -=3D=3DMac OS X 10.5=3D=3D -=3D=3D=3DXcode Tools=3D=3D=3D - -The first step is to install the Apple Xcode development environment: - http://developer.apple.com/tools/xcode - -To install Xcode, you must register as an Apple developer, and download th= e Xcode installation disk image (which is fairly large). These instruction= s were verified with Xcode 3.0. Within the Xcode Tools disk image, only th= e Xcode Tools.mpkg package needs to be installed. - -=3D=3D=3DOpen OS X Terminal program=3D=3D=3D - -Past this point, the remaining instructions will utilize OS X's built in c= ommand shell (bash) via the Terminal application. To open the command term= inal application, open Finder, then press the Cmd-Shift-U key combination. = (This opens the Applications =3D> Utilities folder.) In the Utilities fol= der, you should see the Terminal application. - -=3D=3D=3DGMP & MPFR (if behind a web proxy)=3D=3D=3D - -The gmp and mpfr libraries are needed to build the gcc cross compiler at a= later point in these instructions. Building these libraries on OS X can p= resent some difficulties, so if you are not behind a network firewall, then= consider using the macports project to install these libraries. (see below= ) Be sure to set the http_proxy and ftp_proxy environment variables before= using the 'curl' commands below. - -
-bash$ mkdir ~/src -bash$ cd ~/src -bash$ curl --remote-name \ - ftp://ftp.gnu.org/gnu/gmp/gmp-4.2.2.tar.bz2 -bash$ tar jxvf gmp-4.2.2.tar.bz2 -bash$ cd gmp-4.2.2 -bash$ ./configure --prefix=3D/usr -bash$ make -bash$ make check -bash$ sudo make install -- -Note: This might be needed for 64-bit machines if the MPFR configure fails= below. -
-bash$ export CFLAGS=3D"-m64" -- -
-bash$ cd ~/src -bash$ curl --remote-name \ - http://www.mpfr.org/mpfr-current/mpfr-2.4.1.tar.bz2 -bash$ tar -jxf mpfr-2.4.1.tar.bz2 -bash$ cd mpfr-2.4.1 -bash$ ./configure --prefix=3D/usr -bash$ make -bash$ sudo make install -- -=3D=3D=3DGMP & MPFR via Macports (if not behind web proxy)=3D=3D=3D - -If you are not behind a network firewall, then the http://www.macports.org= project can greatly simlify the installation of gmp & mpfr. (Macports doe= s not work easily with web proxies at this time.) After installing macports= you should be able to simply run this command at the shell prompt. - -
-bash$ sudo port install gmp mpfr -- - -Continue with common instructions for Unix - - -The [[Common instructions for Unix|remaining instructions]] are common for= most UNIX-like systems. - - - - -=3D=3DUbuntu 9.10=3D=3D -Note: The Ubuntu platform is not officially supported or tested by the edk= 2 project at this time. - -=3D=3D=3DOpen the GNOME Terminal program=3D=3D=3D - -These instructions will utilize Ubuntu's built in command shell (bash) via= the GNOME Terminal application. To open the Terminal application, locate = it under the Applications menu and the Accessories sub-menu. - -=3D=3D=3DInstall required software from apt=3D=3D=3D - -Several ubuntu packages will be needed to fully set up an edk2 build envir= onment. In order to easily install all the requirements, you need to run t= his command. - -
-bash$ sudo apt-get install build-essential uuid-dev texinfo \ - bison flex libgmp3-dev libmpfr-dev subversion -- - -=3D=3DContinue with common instructions for Unix=3D=3D - - -The [[Common instructions for Unix|remaining instructions]] are common for= most UNIX-like systems. - + Note: New build instructions are available. It is recommended to start w= ith the new instructions if learning how to + build edk2 for the first time. This page is retained for reference. + +New instructions: [[Build-Instructions.md|Build Instructions]] + +This page provides ''step-by-step instructions'' for setting up a [http://= www.tianocore.org/edk2/ EDK II] build environment on various Unix-like syst= ems. + +'''Note''': These instructions are not recommended for most EDK II develop= ers. If you are working with a supported Linux distribution, then the [[Usi= ng EDK II with Native GCC]] instructions are faster, easier, and produce a = smaller UEFI binary image. + +=3D=3DGetting started for UNIX-like operating systems=3D=3D + +These instructions will be written as a series of commands executed from a= command terminal. + +Often these instructions will contain a command which needs to be executed= in the terminal window. For example: + +
+bash$ echo this bold text is a sample command ++ +To execute this command, highlight the bold text of the command in your we= b browser. Most web browsers should be able to copy the text by selecting = Copy under the Edit menu. Now, change back to the terminal application, an= d there should be a Paste operation under the Edit menu. After pasting the= command into the shell, you may need to press the enter or return key to e= xecute the command. + +Of course, there may be other ways to copy and paste the command into the = terminal which are specific to the windowing environment and applications t= hat you are using. If all else fails, however, you can type the command by= hand. + +Some commands are very long, and we use the backslash character (\) to tel= l the shell program that the command is not finished. For example: + +
+bash$ echo this bold text is a sample command \ + which is broken into two lines ++ +When you copy and paste, make sure you include all lines of the command (i= ncluding the backslash (\) characters). If you are typing the command, you= can remove the backslash character (\) and combine the lines into a single= line if you prefer. + +If a command starts with the sudo command, then you may be prompted for yo= ur user password. This will be the same password as you used to login to t= he system. + +For the purposes of this set of instructions, we will be using the followi= ng paths. +{| +|Edk2 source tree: || ~/src/edk2 +|- +|GCC X64 cross-compiler installation: || ~/programs/gcc/x64 +|- +|GCC IA32 cross-compiler installation: || ~/programs/gcc/ia32 +|- +|Intel ASL Compiler installation: || ~/src/acpica-unix-20090521/compiler/i= asl (symlink to compiler at ~/programs/iasl) +|} + +You will need to change the commands if you want to use different location= s, but this is not recommended unless you are sure that you know what you a= re doing. + +=3D=3D=3DInternet proxies=3D=3D=3D + +If your network utilizes a firewall with a web proxy, then you may need to= configure your proxy information for various command line applications to = work. You may need to consult with your network administrator to find out = the computer name and port to use for proxy setup. The following commands = are common examples of how you would configure your proxy by setting an env= ironment variable: + +
+bash$ export http_proxy=3Dhttp://proxy.domain.com:proxy_port +bash$ export ftp_proxy=3D$http_proxy ++ +To utilize the subversion source control command behind an internet firewa= ll with a web proxy, you should configure the ~/.subversion/servers file. + +=3D=3D Cygwin 1.7.1 =3D=3D +Notes: +* Cygwin is not officially supported or tested by the edk2 project at this= time. +* Building of [http://www.tianocore.org/edk2/ EDK II] components will be d= one using bash. +Prerequisites: +* Cygwin 1.7.1 is currently installed on the system. +* Cygwin 1.7.1 setup.exe is available on the system to install additional = packages as needed. + +Run Cygwin setup.exe and install the following additional packages. +* bison +* flex +* libgmp-devel +* libiconv +* libmpfr-devel +* gcc (use the compiler upgrade helper option under Devel) +* make +* python +* subversion +* wget +* libuuid-devel +* util-linux (for uuidgen) + +When pulling source files using subversion you may choose to get them to a= more Windows friendly location. All system drives are mapped under /cygdr= ive when using CYGWIN and bash (ie. C:\ maps to /cygdrive/c). This allows = you to substitute ~/src/edk2 for an alternate path such as /cygdrive/c/src/= edk2 so files can be access at C:\src\edk2 as well. + + +Continue with common instructions for Unix + + +The [[Common instructions for Unix|remaining instructions]] are common for= most UNIX-like systems. + +=3D=3DFedora 11=3D=3D +Please note: +* Fedora 11 is not officially supported or tested by the edk2 project at t= his time. +* These instructions assume that the Software Development option was enabl= ed during the Fedora installation. + +=3D=3D=3DOpen the GNOME Terminal program=3D=3D=3D + +These instructions will utilize Fedora's built in command shell (bash) via= the GNOME Terminal application. To open the Terminal application, locate = it under the Applications menu and the System Tools sub-menu. + +=3D=3D=3DInstall MPFR library=3D=3D=3D + +The MPFR library must be installed to allow the gcc cross compiler to be b= uilt. + +
+bash$ mkdir ~/src +bash$ cd ~/src +bash$ wget http://www.mpfr.org/mpfr-current/mpfr-2.4.1.tar.bz2 +bash$ tar -jxf mpfr-2.4.1.tar.bz2 +bash$ cd mpfr-2.4.1 +bash$ ./configure --prefix=3D/usr +bash$ make ++ +To install the library, you must be root. Therefore we use 'su' to become= the root user, for the 'make install' command. + +
+bash$ su +bash$ make install +bash$ exit ++ + +Continue with common instructions for Unix + + +The [[Common instructions for Unix |remaining instructions]] are common fo= r most UNIX-like systems. + +=3D=3DMac OS X 10.5=3D=3D +=3D=3D=3DXcode Tools=3D=3D=3D + +The first step is to install the Apple Xcode development environment: + http://developer.apple.com/tools/xcode + +To install Xcode, you must register as an Apple developer, and download th= e Xcode installation disk image (which is fairly large). These instruction= s were verified with Xcode 3.0. Within the Xcode Tools disk image, only th= e Xcode Tools.mpkg package needs to be installed. + +=3D=3D=3DOpen OS X Terminal program=3D=3D=3D + +Past this point, the remaining instructions will utilize OS X's built in c= ommand shell (bash) via the Terminal application. To open the command term= inal application, open Finder, then press the Cmd-Shift-U key combination. = (This opens the Applications =3D> Utilities folder.) In the Utilities fol= der, you should see the Terminal application. + +=3D=3D=3DGMP & MPFR (if behind a web proxy)=3D=3D=3D + +The gmp and mpfr libraries are needed to build the gcc cross compiler at a= later point in these instructions. Building these libraries on OS X can p= resent some difficulties, so if you are not behind a network firewall, then= consider using the macports project to install these libraries. (see below= ) Be sure to set the http_proxy and ftp_proxy environment variables before= using the 'curl' commands below. + +
+bash$ mkdir ~/src +bash$ cd ~/src +bash$ curl --remote-name \ + ftp://ftp.gnu.org/gnu/gmp/gmp-4.2.2.tar.bz2 +bash$ tar jxvf gmp-4.2.2.tar.bz2 +bash$ cd gmp-4.2.2 +bash$ ./configure --prefix=3D/usr +bash$ make +bash$ make check +bash$ sudo make install ++ +Note: This might be needed for 64-bit machines if the MPFR configure fails= below. +
+bash$ export CFLAGS=3D"-m64" ++ +
+bash$ cd ~/src +bash$ curl --remote-name \ + http://www.mpfr.org/mpfr-current/mpfr-2.4.1.tar.bz2 +bash$ tar -jxf mpfr-2.4.1.tar.bz2 +bash$ cd mpfr-2.4.1 +bash$ ./configure --prefix=3D/usr +bash$ make +bash$ sudo make install ++ +=3D=3D=3DGMP & MPFR via Macports (if not behind web proxy)=3D=3D=3D + +If you are not behind a network firewall, then the http://www.macports.org= project can greatly simlify the installation of gmp & mpfr. (Macports doe= s not work easily with web proxies at this time.) After installing macports= you should be able to simply run this command at the shell prompt. + +
+bash$ sudo port install gmp mpfr ++ + +Continue with common instructions for Unix + + +The [[Common instructions for Unix|remaining instructions]] are common for= most UNIX-like systems. + + + + +=3D=3DUbuntu 9.10=3D=3D +Note: The Ubuntu platform is not officially supported or tested by the edk= 2 project at this time. + +=3D=3D=3DOpen the GNOME Terminal program=3D=3D=3D + +These instructions will utilize Ubuntu's built in command shell (bash) via= the GNOME Terminal application. To open the Terminal application, locate = it under the Applications menu and the Accessories sub-menu. + +=3D=3D=3DInstall required software from apt=3D=3D=3D + +Several ubuntu packages will be needed to fully set up an edk2 build envir= onment. In order to easily install all the requirements, you need to run t= his command. + +
+bash$ sudo apt-get install build-essential uuid-dev texinfo \ + bison flex libgmp3-dev libmpfr-dev subversion ++ + +=3D=3DContinue with common instructions for Unix=3D=3D + + +The [[Common instructions for Unix|remaining instructions]] are common for= most UNIX-like systems. + diff --git a/Using-EDK-II-with-Native-GCC.mediawiki b/Using-EDK-II-with-Nat= ive-GCC.mediawiki index e17f5056b446..ea8c8f9326dc 100644 --- a/Using-EDK-II-with-Native-GCC.mediawiki +++ b/Using-EDK-II-with-Native-GCC.mediawiki @@ -1,241 +1,244 @@ - - -This page provides ''step-by-step instructions'' for setting up a [http://= www.tianocore.org/edk2/ EDK II] build environment on Linux using a native G= CC installation (4.4+). This EDK II setup does not require the Mingw versi= on of GCC to be built, and therefore can be much faster to setup. - -=3D=3DGetting Started=3D=3D - -These instructions will be written as a series of commands executed from a= command terminal.Often these instructions will contain a command which nee= ds to be executed in the terminal window. For example: - -
-bash$ echo this text is a sample command -- -To execute this command, highlight the text of the command in your web bro= wser. (Note that the 'bash$' text is not part of the command!) Most web b= rowsers should be able to copy the text by selecting Copy under the Edit me= nu. Now, change back to the terminal application, and there should be a Pa= ste operation under the Edit menu. After pasting the command into the shel= l, you may need to press the enter or return key to execute the command.=20 - -Of course, there may be other ways to copy and paste the command into the = terminal which are specific to the windowing environment and applications t= hat you are using. If all else fails, however, you can type the command by= hand. - -Some commands are very long, and we use the backslash character (\) to tel= l the shell program that the command is not finished. For example: - -
-bash$ echo this bold text is a sample command \ - which is broken into two lines -- -When you copy and paste, make sure you include all lines of the command (i= ncluding the backslash (\) characters). If you are typing the command, you= can remove the backslash character (\) and combine the lines into a single= line if you prefer. - -If a command starts with the sudo command, then you may be prompted for yo= ur user password. This will be the same password as you used to login to t= he system. - -For the purposes of this set of instructions, we will be using the followi= ng paths. -{| -|Edk2 source tree: || $HOME/src/edk2 -|- -|Native GCC 4.x compiler installation: || /usr/bin/gcc -|- -|Intel ASL Compiler installation: || /usr/bin/iasl -|} - -You will need to change the commands if you want to use different location= s, but this is not recommended unless you are sure that you know what you a= re doing. - -=3D=3D=3DInternet proxies=3D=3D=3D - -If your network utilizes a firewall with a web proxy, then you may need to= configure your proxy information for various command line applications to = work. You may need to consult with your network administrator to find out = the computer name and port to use for proxy setup. The following commands = are common examples of how you would configure your proxy by setting an env= ironment variable: - -
-bash$ export http_proxy=3Dhttp://proxy.domain.com:proxy_port -bash$ export ftp_proxy=3D$http_proxy -- -To utilize the subversion source control command behind an internet firewa= ll with a web proxy, you should configure the ~/.subversion/servers file. - -=3D=3D=3DUbuntu 20.04 LTS=3D=3D=3D - -Note: These instructions utilize GCC5 & NASM compiler support (added in ea= rly 2016), along with git (replaces subversion). GCC 4.x is still supported= . GCC5 is not mandatory. - -=3D=3D=3D=3DOpen the GNOME Terminal program=3D=3D=3D=3D - -These instructions will utilize Ubuntu's built in command shell (bash) via= the GNOME Terminal application. To open the Terminal application, locate = it under the Applications menu and the Accessories sub-menu. - -=3D=3D=3D=3DInstall required software from apt=3D=3D=3D=3D - -Several Ubuntu packages will be needed to set up the build environment for= EDK II. The following command will install all required packages: - -
-bash$ sudo apt install build-essential uuid-dev iasl git nasm python-is-= python3 -- -:build-essential - Informational list of build-essential packages=20 -:uuid-dev - Universally Unique ID library (headers and static libraries) -:iasl - Intel ASL compiler/decompiler (also provided by acpica-tools) -:git - support for git revision control system=20 -:nasm - General-purpose x86 assembler -:python-is-python3 - Ubuntu 20.04 python command is 'python3' but edk2 too= ls use 'python' - - -=3D=3D=3DContinue with common instructions=3D=3D=3D - -The [[Common instructions|remaining instructions]] are common for most UNI= X-like systems. - - - -=3D=3D=3DUbuntu 16.04 LTS / Ubuntu 16.10=3D=3D=3D - -Note: These instructions utilize GCC5 & NASM compiler support (added in ea= rly 2016), along with git (replaces subversion). GCC 4.x is still supported= . GCC5 is not mandatory. - -=3D=3D=3D=3DOpen the GNOME Terminal program=3D=3D=3D=3D - -These instructions will utilize Ubuntu's built in command shell (bash) via= the GNOME Terminal application. To open the Terminal application, locate = it under the Applications menu and the Accessories sub-menu. - -=3D=3D=3D=3DInstall required software from apt=3D=3D=3D=3D - -Several Ubuntu packages will be needed to set up the build environment for= EDK II. The following command will install all required packages: - -
-bash$ sudo apt-get install build-essential uuid-dev iasl git gcc-5 nasm py= thon3-distutils -- -:build-essential - Informational list of build-essential packages=20 -:uuid-dev - Universally Unique ID library (headers and static libraries) -:iasl - Intel ASL compiler/decompiler (also provided by acpica-tools) -:git - support for git revision control system=20 -:gcc-5 - GNU C compiler (v5.4.0 as of Ubuntu 16.04 LTS) -:nasm - General-purpose x86 assembler -:python3-distutils - distutils module from the Python standard library - -=3D=3D=3DContinue with common instructions=3D=3D=3D - -The [[Common instructions|remaining instructions]] are common for most UNI= X-like systems. - - -=3D=3DInstructions for older Linux Environments=3D=3D - -Note: the instructions below have not been updated for compilers newer tha= n GCC 4.4, git (replaces subversion) or NASM. Newer builds may fail without= satisfying these dependecies. We recommend moving to newer Linux distribut= ions unless you have a dependency on a specific version. - -=3D=3D=3DNote: Limitations of GCC 4.4=3D=3D=3D - -Note: The GCC 4.4 toolchain only supports building images for the IA32 and= X64 architectures. We recommend using newer toolchains. - -Also, in some cases if GCC 4.4 is installed under Linux x86 (32-bit mode),= then it may only support building UEFI images for the IA32 architecture. - -=3D=3D=3DArch Linux 2010.05=3D=3D=3D -Note: Arch Linux is not officially supported or tested by the edk2 project= at this time. - -=3D=3D=3D=3DOpen the GNOME Terminal program=3D=3D=3D=3D - -These instructions will utilize Arch Linux's built in command shell (bash)= via the GNOME Terminal application. To open the Terminal application, loc= ate it under the Applications menu and the System Tools sub-menu. - -=3D=3D=3D=3DInstall required software with pacman=3D=3D=3D=3D - -To install the required packages, you must be root. Therefore we use 'su'= to become the root user. - -
-bash$ su - -bash$ pacman -S base-devel glibc iasl python2 subversion -bash$ exit -- - -Continue with common instructions - - -The [[Common instructions|remaining instructions]] are common for most UNI= X-like systems. - -=3D=3D=3DFedora 13=3D=3D=3D -Note: Fedora is not officially supported or tested by the edk2 project at = this time. - -Note: x86 (32-bit) Fedora will install GCC 4.4 which is only capable of bu= ilding UEFI for the IA32 architecture. - -=3D=3D=3D=3DOpen the GNOME Terminal program=3D=3D=3D=3D - -These instructions will utilize Fedora's built in command shell (bash) via= the GNOME Terminal application. To open the Terminal application, locate = it under the Applications menu and the System Tools sub-menu. - -=3D=3D=3D=3DInstall required software with yum=3D=3D=3D=3D - -To install the required packages, you must be root. Therefore we use 'su'= to become the root user. - -
-bash$ su - -bash$ yum groupinstall development-tools -bash$ yum install iasl libuuid-devel -bash$ exit -- - -Continue with common instructions - - -The [[Common instructions|remaining instructions]] are common for most UNI= X-like systems. - -=3D=3D=3DMandriva 2010=3D=3D=3D -Note: Mandriva is not officially supported or tested by the edk2 project a= t this time. - -Note: x86 (32-bit) Mandriva will install GCC 4.4 which is only capable of = building UEFI for the IA32 architecture. - -=3D=3D=3D=3DOpen the Terminal program=3D=3D=3D=3D - -These instructions will utilize Mandriva's built in command shell (bash) v= ia the Terminal application. To open the Terminal application, locate it u= nder the Applications menu and the Tools sub-menu. - -=3D=3D=3D=3DInstall required software with urpmi=3D=3D=3D=3D - -To install the required packages, you must be root. Therefore we use 'su'= to become the root user. - -
-bash$ su - -bash$ urpmi task-c++-devel iasl libuuid-devel subversion -bash$ exit -- - -Continue with common instructions - - -The [[Common instructions|remaining instructions]] are common for most UNI= X-like systems. - -=3D=3D=3DopenSUSE 12.1=3D=3D=3D - -Note: openSUSE is not officially supported or tested by the edk2 project a= t this time. - -=3D=3D=3D=3DOpen the GNOME Terminal program=3D=3D=3D=3D - -These instructions will utilize openSUSE's built in command shell (bash) v= ia the GNOME Terminal application. To open the Terminal application, click= the 'Computer' menu, click the 'More Applications' button, and then enter = 'terminal' into the filter text box. - -=3D=3D=3D=3DInstall required software with zypper=3D=3D=3D=3D - -Several openSUSE packages will be needed to fully set up an edk2 build env= ironment. In order to easily install all the requirements, you need to run= this command. - -
-bash> sudo zypper in -t pattern devel_basis -- - -Continue with common instructions - - -The [[Common instructions|remaining instructions]] are common for most UNI= X-like systems. - -=3D=3D=3DUbuntu 10.10=3D=3D=3D -Notes: -* The Ubuntu platform is not officially supported or tested by the edk2 pr= oject at this time. -* Both the x86 (32-bit) and x86-64 (64-bit) Ubuntu versions will install G= CC 4.4 which is capable of building UEFI for both the IA32 and X64 architec= tures. -* These instructions should work for Ubuntu 10.04 as well - -=3D=3D=3D=3DOpen the GNOME Terminal program=3D=3D=3D=3D - -These instructions will utilize Ubuntu's built in command shell (bash) via= the GNOME Terminal application. To open the Terminal application, locate = it under the Applications menu and the Accessories sub-menu. - -=3D=3D=3D=3DInstall required software from apt=3D=3D=3D=3D - -Several ubuntu packages will be needed to fully set up an edk2 build envir= onment. In order to easily install all the requirements, you need to run t= his command. - -
-bash$ sudo apt-get install build-essential subversion uuid-dev iasl -- - -=3D=3D=3DContinue with common instructions=3D=3D=3D - -The [[Common instructions|remaining instructions]] are common for most UNI= X-like systems. - - -=3DSee Also=3D - + Note: New build instructions are available. It is recommended to start w= ith the new instructions if learning how to + build edk2 for the first time. This page is retained for reference. + +New instructions: [[Build-Instructions.md|Build Instructions]] + +This page provides ''step-by-step instructions'' for setting up a [http://= www.tianocore.org/edk2/ EDK II] build environment on Linux using a native G= CC installation (4.4+). This EDK II setup does not require the Mingw versi= on of GCC to be built, and therefore can be much faster to setup. + +=3D=3DGetting Started=3D=3D + +These instructions will be written as a series of commands executed from a= command terminal.Often these instructions will contain a command which nee= ds to be executed in the terminal window. For example: + +
+bash$ echo this text is a sample command ++ +To execute this command, highlight the text of the command in your web bro= wser. (Note that the 'bash$' text is not part of the command!) Most web b= rowsers should be able to copy the text by selecting Copy under the Edit me= nu. Now, change back to the terminal application, and there should be a Pa= ste operation under the Edit menu. After pasting the command into the shel= l, you may need to press the enter or return key to execute the command. + +Of course, there may be other ways to copy and paste the command into the = terminal which are specific to the windowing environment and applications t= hat you are using. If all else fails, however, you can type the command by= hand. + +Some commands are very long, and we use the backslash character (\) to tel= l the shell program that the command is not finished. For example: + +
+bash$ echo this bold text is a sample command \ + which is broken into two lines ++ +When you copy and paste, make sure you include all lines of the command (i= ncluding the backslash (\) characters). If you are typing the command, you= can remove the backslash character (\) and combine the lines into a single= line if you prefer. + +If a command starts with the sudo command, then you may be prompted for yo= ur user password. This will be the same password as you used to login to t= he system. + +For the purposes of this set of instructions, we will be using the followi= ng paths. +{| +|Edk2 source tree: || $HOME/src/edk2 +|- +|Native GCC 4.x compiler installation: || /usr/bin/gcc +|- +|Intel ASL Compiler installation: || /usr/bin/iasl +|} + +You will need to change the commands if you want to use different location= s, but this is not recommended unless you are sure that you know what you a= re doing. + +=3D=3D=3DInternet proxies=3D=3D=3D + +If your network utilizes a firewall with a web proxy, then you may need to= configure your proxy information for various command line applications to = work. You may need to consult with your network administrator to find out = the computer name and port to use for proxy setup. The following commands = are common examples of how you would configure your proxy by setting an env= ironment variable: + +
+bash$ export http_proxy=3Dhttp://proxy.domain.com:proxy_port +bash$ export ftp_proxy=3D$http_proxy ++ +To utilize the subversion source control command behind an internet firewa= ll with a web proxy, you should configure the ~/.subversion/servers file. + +=3D=3D=3DUbuntu 20.04 LTS=3D=3D=3D + +Note: These instructions utilize GCC5 & NASM compiler support (added in ea= rly 2016), along with git (replaces subversion). GCC 4.x is still supported= . GCC5 is not mandatory. + +=3D=3D=3D=3DOpen the GNOME Terminal program=3D=3D=3D=3D + +These instructions will utilize Ubuntu's built in command shell (bash) via= the GNOME Terminal application. To open the Terminal application, locate = it under the Applications menu and the Accessories sub-menu. + +=3D=3D=3D=3DInstall required software from apt=3D=3D=3D=3D + +Several Ubuntu packages will be needed to set up the build environment for= EDK II. The following command will install all required packages: + +
+bash$ sudo apt install build-essential uuid-dev iasl git nasm python-is-= python3 ++ +:build-essential - Informational list of build-essential packages +:uuid-dev - Universally Unique ID library (headers and static libraries) +:iasl - Intel ASL compiler/decompiler (also provided by acpica-tools) +:git - support for git revision control system +:nasm - General-purpose x86 assembler +:python-is-python3 - Ubuntu 20.04 python command is 'python3' but edk2 too= ls use 'python' + + +=3D=3D=3DContinue with common instructions=3D=3D=3D + +The [[Common instructions|remaining instructions]] are common for most UNI= X-like systems. + + + +=3D=3D=3DUbuntu 16.04 LTS / Ubuntu 16.10=3D=3D=3D + +Note: These instructions utilize GCC5 & NASM compiler support (added in ea= rly 2016), along with git (replaces subversion). GCC 4.x is still supported= . GCC5 is not mandatory. + +=3D=3D=3D=3DOpen the GNOME Terminal program=3D=3D=3D=3D + +These instructions will utilize Ubuntu's built in command shell (bash) via= the GNOME Terminal application. To open the Terminal application, locate = it under the Applications menu and the Accessories sub-menu. + +=3D=3D=3D=3DInstall required software from apt=3D=3D=3D=3D + +Several Ubuntu packages will be needed to set up the build environment for= EDK II. The following command will install all required packages: + +
+bash$ sudo apt-get install build-essential uuid-dev iasl git gcc-5 nasm py= thon3-distutils ++ +:build-essential - Informational list of build-essential packages +:uuid-dev - Universally Unique ID library (headers and static libraries) +:iasl - Intel ASL compiler/decompiler (also provided by acpica-tools) +:git - support for git revision control system +:gcc-5 - GNU C compiler (v5.4.0 as of Ubuntu 16.04 LTS) +:nasm - General-purpose x86 assembler +:python3-distutils - distutils module from the Python standard library + +=3D=3D=3DContinue with common instructions=3D=3D=3D + +The [[Common instructions|remaining instructions]] are common for most UNI= X-like systems. + + +=3D=3DInstructions for older Linux Environments=3D=3D + +Note: the instructions below have not been updated for compilers newer tha= n GCC 4.4, git (replaces subversion) or NASM. Newer builds may fail without= satisfying these dependecies. We recommend moving to newer Linux distribut= ions unless you have a dependency on a specific version. + +=3D=3D=3DNote: Limitations of GCC 4.4=3D=3D=3D + +Note: The GCC 4.4 toolchain only supports building images for the IA32 and= X64 architectures. We recommend using newer toolchains. + +Also, in some cases if GCC 4.4 is installed under Linux x86 (32-bit mode),= then it may only support building UEFI images for the IA32 architecture. + +=3D=3D=3DArch Linux 2010.05=3D=3D=3D +Note: Arch Linux is not officially supported or tested by the edk2 project= at this time. + +=3D=3D=3D=3DOpen the GNOME Terminal program=3D=3D=3D=3D + +These instructions will utilize Arch Linux's built in command shell (bash)= via the GNOME Terminal application. To open the Terminal application, loc= ate it under the Applications menu and the System Tools sub-menu. + +=3D=3D=3D=3DInstall required software with pacman=3D=3D=3D=3D + +To install the required packages, you must be root. Therefore we use 'su'= to become the root user. + +
+bash$ su - +bash$ pacman -S base-devel glibc iasl python2 subversion +bash$ exit ++ + +Continue with common instructions + + +The [[Common instructions|remaining instructions]] are common for most UNI= X-like systems. + +=3D=3D=3DFedora 13=3D=3D=3D +Note: Fedora is not officially supported or tested by the edk2 project at = this time. + +Note: x86 (32-bit) Fedora will install GCC 4.4 which is only capable of bu= ilding UEFI for the IA32 architecture. + +=3D=3D=3D=3DOpen the GNOME Terminal program=3D=3D=3D=3D + +These instructions will utilize Fedora's built in command shell (bash) via= the GNOME Terminal application. To open the Terminal application, locate = it under the Applications menu and the System Tools sub-menu. + +=3D=3D=3D=3DInstall required software with yum=3D=3D=3D=3D + +To install the required packages, you must be root. Therefore we use 'su'= to become the root user. + +
+bash$ su - +bash$ yum groupinstall development-tools +bash$ yum install iasl libuuid-devel +bash$ exit ++ + +Continue with common instructions + + +The [[Common instructions|remaining instructions]] are common for most UNI= X-like systems. + +=3D=3D=3DMandriva 2010=3D=3D=3D +Note: Mandriva is not officially supported or tested by the edk2 project a= t this time. + +Note: x86 (32-bit) Mandriva will install GCC 4.4 which is only capable of = building UEFI for the IA32 architecture. + +=3D=3D=3D=3DOpen the Terminal program=3D=3D=3D=3D + +These instructions will utilize Mandriva's built in command shell (bash) v= ia the Terminal application. To open the Terminal application, locate it u= nder the Applications menu and the Tools sub-menu. + +=3D=3D=3D=3DInstall required software with urpmi=3D=3D=3D=3D + +To install the required packages, you must be root. Therefore we use 'su'= to become the root user. + +
+bash$ su - +bash$ urpmi task-c++-devel iasl libuuid-devel subversion +bash$ exit ++ + +Continue with common instructions + + +The [[Common instructions|remaining instructions]] are common for most UNI= X-like systems. + +=3D=3D=3DopenSUSE 12.1=3D=3D=3D + +Note: openSUSE is not officially supported or tested by the edk2 project a= t this time. + +=3D=3D=3D=3DOpen the GNOME Terminal program=3D=3D=3D=3D + +These instructions will utilize openSUSE's built in command shell (bash) v= ia the GNOME Terminal application. To open the Terminal application, click= the 'Computer' menu, click the 'More Applications' button, and then enter = 'terminal' into the filter text box. + +=3D=3D=3D=3DInstall required software with zypper=3D=3D=3D=3D + +Several openSUSE packages will be needed to fully set up an edk2 build env= ironment. In order to easily install all the requirements, you need to run= this command. + +
+bash> sudo zypper in -t pattern devel_basis ++ + +Continue with common instructions + + +The [[Common instructions|remaining instructions]] are common for most UNI= X-like systems. + +=3D=3D=3DUbuntu 10.10=3D=3D=3D +Notes: +* The Ubuntu platform is not officially supported or tested by the edk2 pr= oject at this time. +* Both the x86 (32-bit) and x86-64 (64-bit) Ubuntu versions will install G= CC 4.4 which is capable of building UEFI for both the IA32 and X64 architec= tures. +* These instructions should work for Ubuntu 10.04 as well + +=3D=3D=3D=3DOpen the GNOME Terminal program=3D=3D=3D=3D + +These instructions will utilize Ubuntu's built in command shell (bash) via= the GNOME Terminal application. To open the Terminal application, locate = it under the Applications menu and the Accessories sub-menu. + +=3D=3D=3D=3DInstall required software from apt=3D=3D=3D=3D + +Several ubuntu packages will be needed to fully set up an edk2 build envir= onment. In order to easily install all the requirements, you need to run t= his command. + +
+bash$ sudo apt-get install build-essential subversion uuid-dev iasl ++ + +=3D=3D=3DContinue with common instructions=3D=3D=3D + +The [[Common instructions|remaining instructions]] are common for most UNI= X-like systems. + + +=3DSee Also=3D + * [[Unix-like systems]] - Instructions which walk through building the Min= gw GCC cross-compiler \ No newline at end of file diff --git a/Windows-systems.mediawiki b/Windows-systems.mediawiki index ebb717a22464..6be6e9187be8 100644 --- a/Windows-systems.mediawiki +++ b/Windows-systems.mediawiki @@ -1,156 +1,162 @@ -__NOTOC__ -This page provides step-by-step instructions or setting up a [http://www.t= ianocore.org/edk2/ EDK II] build environment on Windows systems. - -''Table of Contents'' -* [[Windows-systems#github-help|GitHub Help]] -* [[Windows-systems#how-to-setup-the-edk-ii-tree| How to Setup the EDK II = Tree]] -* [[Windows-systems#download| Download]] Checkout EDK II source tree from= Github=20 -* [[Windows-systems#compile-tools |Compile Tools]] Build EDK II BaseTools = for Windows=20 -* [[Windows-systems#build | BUILD]] EDK II - -=3D=3DGitHub Help=3D=3D - -GitHub (https://help.github.com/index.html) provides step-by-step instruct= ions for user registration and basic features supported by GitHub. - -=3D=3D=3D Git GUI Interface for Windows OS =3D=3D=3D -* Git for Windows OS is available at: (http://git-scm.com/download/win) -* TortoiseGit for windows OS is available at (https://tortoisegit.org/down= load/) - -=3D=3D'''GitHub EDK II Project Repositories'''=3D=3D - -* The EDK II project repository is available at https://github.com/tianoco= re/edk2.=20 - -Content that is not released under an accepted open source license can be = found at https://github.com/tianocore/edk2-non-osi.
- $ git config --global https.proxy- - -=3D=3D'''How to Setup the EDK II Tree'''=3D=3D -'''Note:''' Some of the following examples use the Multiple Workspace feat= ure to configure the EDK II BaseTools. More information on the Multiple Wo= rkspace feature can be found at the following location..domain.com: - $ git config --global http.proxy .domain.com: -
- $git clone https://github.com/tianocore/edk2 -- -Continue to [[Windows-systems#compile-tools |Compile Tools]] and then [[Wi= ndows-systems#build | BUILD]] sections - -=3D=3D'''Compile Tools'''=3D=3D -=3D=3D=3D=3D=3DFor EDK II project developers on Windows with source BaseTo= ols:=3D=3D=3D=3D=3D -* Create a workspace directory -* Change to the workspace directory -* Clone the EDK II project repository (See [[Windows-systems#download| Dow= nload]] section above) -** Example: git clone https://github.com/tianocore/edk2 -* Install Python37 or late version (https://www.python.org/) to run pytho= n tool from source=20 -* Compile BaseTools C source tools -Example: -* Inside Git Bash -
- $ git clone https://github.com/tianocore/edk2 --=3D=3D=3D=3D=3DCompile BaseTools=3D=3D=3D=3D=3D -Example: -*Open Command prompt and CD C:\edk2: -
+__NOTOC__ + + Note: New build instructions are available. It is recommended to start w= ith the new instructions if learning how to + build edk2 for the first time. This page is retained for reference. + +New instructions: [[Build-Instructions.md|Build Instructions]] + +This page provides step-by-step instructions or setting up a [http://www.t= ianocore.org/edk2/ EDK II] build environment on Windows systems. + +''Table of Contents'' +* [[Windows-systems#github-help|GitHub Help]] +* [[Windows-systems#how-to-setup-the-edk-ii-tree| How to Setup the EDK II = Tree]] +* [[Windows-systems#download| Download]] Checkout EDK II source tree from= Github +* [[Windows-systems#compile-tools |Compile Tools]] Build EDK II BaseTools = for Windows +* [[Windows-systems#build | BUILD]] EDK II + +=3D=3DGitHub Help=3D=3D + +GitHub (https://help.github.com/index.html) provides step-by-step instruct= ions for user registration and basic features supported by GitHub. + +=3D=3D=3D Git GUI Interface for Windows OS =3D=3D=3D +* Git for Windows OS is available at: (http://git-scm.com/download/win) +* TortoiseGit for windows OS is available at (https://tortoisegit.org/down= load/) + +=3D=3D'''GitHub EDK II Project Repositories'''=3D=3D + +* The EDK II project repository is available at https://github.com/tianoco= re/edk2. + +Content that is not released under an accepted open source license can be = found at https://github.com/tianocore/edk2-non-osi.+ + +=3D=3D'''Build'''=3D=3D +* Set up the [[Nasm-Setup| Nasm]] open source assembly compiler +* Set up the [[Asl Setup| ASL Compiler]] +* [[Windows-systems#compile-tools |Compile Tools]] above +* Open a Windows CMD prompt: +* Change to the edk2 directory +* Run the edksetup.bat script + + C:\Users\MySid> CD \edk2 + C:\edk2> edksetup + +=3D=3D=3DBuild MdeModulePkg=3D=3D=3D + + +=3D=3D=3D=3DModify Conf files=3D=3D=3D=3D + +You will need to edit the Conf\target.txt file. First, change the ACTIVE_= PLATFORM to the MdeModulePkg: + +
+
+Note: the steps below will pull the latest code from edk2 master. To work = from a stable release, please refer to the Microsoft Windows build steps fo= r [[UDK2017]]: https://github.com/tianocore/tianocore.github.io/wiki/UDK201= 7-How-to-Build#how-to-build-windows-system + +=3D=3D=3DInternet proxies=3D=3D=3D + +If your network utilizes a firewall with a web proxy, then you may need to= configure your proxy information for various command line applications to = work. You may need to consult with your network administrator to find out = the computer name and port to use for proxy setup. The following commands = are common '''Git Bash''' examples of how you would configure your proxy by= setting an environment variable: + ++ $ git config --global https.proxy+ + +=3D=3D'''How to Setup the EDK II Tree'''=3D=3D +'''Note:''' Some of the following examples use the Multiple Workspace feat= ure to configure the EDK II BaseTools. More information on the Multiple Wo= rkspace feature can be found at the following location..domain.com: + $ git config --global http.proxy .domain.com: +
+* [[Multiple_Workspace]] + +=3D=3D'''Download'''=3D=3D +Download/Checkout the EDK II source tree from Github +=3D=3D=3D Download Using a Web browser =3D=3D=3D + +# Download EDK II Project +## Open https://github.com/tianocore/edk2 in web browser +## Click on the ''Clone or Download'' button (Right Green) +## Click on Download ZIP +## Unzip to C:/ +## Rename directory =E2=80=9Cedk2-master=E2=80=9D to =E2=80=9Cedk2=E2=80= =9D + +Continue to [[Windows-systems#compile-tools |Compile Tools]] + +=3D=3D=3D Using '''Git for Windows''' Application =3D=3D=3D +=3D=3D=3D=3D ''Git GUI''=3D=3D=3D=3D +# Clone the EDK II project repository +## Open Git GUI +## Use ''Clone Exiting Repository'' with Source location https://github.co= m/tianocore/edk2.git +## Select a Target directory C:/edk2 +## Check Recursively clone submodules too +## click Clone button + +Continue to [[Windows-systems#compile-tools |Compile Tools]] section + +=3D=3D=3D=3D ''Git CMD'' =3D=3D=3D=3D +If you use the command line version, then you can easily checkout the edk2= to the C:\edk2 directory with the following git command: +Main repository: https://github.com/tianocore/edk2 ++ $git clone https://github.com/tianocore/edk2 ++ +Continue to [[Windows-systems#compile-tools |Compile Tools]] and then [[Wi= ndows-systems#build | BUILD]] sections + +=3D=3D'''Compile Tools'''=3D=3D +=3D=3D=3D=3D=3DFor EDK II project developers on Windows with source BaseTo= ols:=3D=3D=3D=3D=3D +* Create a workspace directory +* Change to the workspace directory +* Clone the EDK II project repository (See [[Windows-systems#download| Dow= nload]] section above) +** Example: git clone https://github.com/tianocore/edk2 +* Install Python37 or late version (https://www.python.org/) to run pytho= n tool from source +* Compile BaseTools C source tools +Example: +* Inside Git Bash ++ $ git clone https://github.com/tianocore/edk2 ++=3D=3D=3D=3D=3DCompile BaseTools=3D=3D=3D=3D=3D +Example: +*Open Command prompt and CD C:\edk2: +C:\edk2> set PYTHON_HOME=3DC:\Python37 - C:\edk2> edksetup.bat Rebuild -- - -=3D=3D'''Build'''=3D=3D -* Set up the [[Nasm-Setup| Nasm]] open source assembly compiler -* Set up the [[Asl Setup| ASL Compiler]]=20 -* [[Windows-systems#compile-tools |Compile Tools]] above -* Open a Windows CMD prompt: -* Change to the edk2 directory -* Run the edksetup.bat script - - C:\Users\MySid> CD \edk2 - C:\edk2> edksetup - -=3D=3D=3DBuild MdeModulePkg=3D=3D=3D - - -=3D=3D=3D=3DModify Conf files=3D=3D=3D=3D - -You will need to edit the Conf\target.txt file. First, change the ACTIVE_= PLATFORM to the MdeModulePkg: - --C:\edk2> notepad Conf\target.txt -- -ACTIVE_PLATFORM should look like this in Conf\target.txt: - --ACTIVE_PLATFORM =3D MdeModulePkg/MdeModulePkg.dsc -- -Modify TOOL_CHAIN_TAG in target.txt for the toolchain installed on your sy= stem. There are many options, so review the tools_def.txt to find the appro= priate toolchain for your system. Search for 'Supported Tool Chains' in to= ols_def.txt to see the valid options for TOOL_CHAIN_TAG.=20 --TOOL_CHAIN_TAG =3D VS2015x86 -- - - -See also: [[Windows-systems-ToolChain-Matrix]] for how to change the Tool = Chain Tag. - -Also, consider if you want to build a different processor architecture by = changing the TARGET_ARCH value in target.txt. Please consider that certain= toolchains only support building certain processor architectures. - -=3D=3D=3D=3DBuild Hello World! (and the rest of MdeModulePkg)=3D=3D=3D=3D - -Now you should be able to simply run the build command to compile the MdeM= odulePkg. - --C:\edk2> build -- -As a tangible result of the build, you should have the HelloWorld UEFI app= lication. If you have a UEFI system available to you which matches the pro= cessor architecture that you built, then this application should be able to= run successfully under the shell. - --C:\edk2> dir /s Build\MdeModule\DEBUG_...\IA32\HelloWorld.efi -- -=3D=3D=3DBuild [[OVMF]] (OPTIONAL)=3D=3D=3D - -Once your build environment is set up you might be interested in building = the [[OVMF]] platform which is included in the main edk2 source tree. Sin= ce [[OVMF]] builds a full system firmware image this may be of interest to = UEFI system firmware developers. - -=3DSee Also=3D -* [[Getting-Started-Writing-Simple-Application]] - + C:\edk2> edksetup.bat Rebuild +
+C:\edk2> notepad Conf\target.txt ++ +ACTIVE_PLATFORM should look like this in Conf\target.txt: + +
+ACTIVE_PLATFORM =3D MdeModulePkg/MdeModulePkg.dsc ++ +Modify TOOL_CHAIN_TAG in target.txt for the toolchain installed on your sy= stem. There are many options, so review the tools_def.txt to find the appro= priate toolchain for your system. Search for 'Supported Tool Chains' in to= ols_def.txt to see the valid options for TOOL_CHAIN_TAG. +
+TOOL_CHAIN_TAG =3D VS2015x86 ++ + + +See also: [[Windows-systems-ToolChain-Matrix]] for how to change the Tool = Chain Tag. + +Also, consider if you want to build a different processor architecture by = changing the TARGET_ARCH value in target.txt. Please consider that certain= toolchains only support building certain processor architectures. + +=3D=3D=3D=3DBuild Hello World! (and the rest of MdeModulePkg)=3D=3D=3D=3D + +Now you should be able to simply run the build command to compile the MdeM= odulePkg. + +
+C:\edk2> build ++ +As a tangible result of the build, you should have the HelloWorld UEFI app= lication. If you have a UEFI system available to you which matches the pro= cessor architecture that you built, then this application should be able to= run successfully under the shell. + +
+C:\edk2> dir /s Build\MdeModule\DEBUG_...\IA32\HelloWorld.efi ++ +=3D=3D=3DBuild [[OVMF]] (OPTIONAL)=3D=3D=3D + +Once your build environment is set up you might be interested in building = the [[OVMF]] platform which is included in the main edk2 source tree. Sin= ce [[OVMF]] builds a full system firmware image this may be of interest to = UEFI system firmware developers. + +=3DSee Also=3D +* [[Getting-Started-Writing-Simple-Application]] + \ No newline at end of file --=20 2.28.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#96992): https://edk2.groups.io/g/devel/message/96992 Mute This Topic: https://groups.io/mt/95483154/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-