From nobody Fri Dec 19 17:36:25 2025 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+97097+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+97097+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linux.microsoft.com ARC-Seal: i=1; a=rsa-sha256; t=1670430276; cv=none; d=zohomail.com; s=zohoarc; b=TRIn6GwZ8g3KZnhZdAgT/M6O62nJWVKRGM+KKovFHDuOC42nmxpLFxFdn8LVFodv4cwyLq0KAX3mgAiXVUt76ADokSR78ug8vVPlkSRdpAaR1EZliXoq1Gt7UZMxHinlSeP81nszsg7I4E/Oh2s/Q1x6+E8s3hJLdFDbSk4SMq4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1670430276; 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=AVsCePv1mMigdB0zSi+lYtVvXdcYuxw6grHW/vGe1iM=; b=RJbIEhfzxmL0XYXV+454xQ8MS1hsSOJEsLzwpsHMSUU5C8WmXEBd/XnuVOTpZfmxNKi9yYnmeX5I342gwp/NGereQKmIEdmvHs1LADs4ZY9OrO9oQkWUbpoULYWaD65C+ijL5gbH2/tJWYc80Ec3w07k+O5tVFveXKdFCeb/5PU= 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+97097+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1670430276082861.9821569908681; Wed, 7 Dec 2022 08:24:36 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id UC53YY1788612xbnFYvQZhOQ; Wed, 07 Dec 2022 08:24:35 -0800 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web10.20076.1670430274755685986 for ; Wed, 07 Dec 2022 08:24:34 -0800 X-Received: from localhost.localdomain (unknown [47.201.8.94]) by linux.microsoft.com (Postfix) with ESMTPSA id 9B85D20B83E2; Wed, 7 Dec 2022 08:24:33 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 9B85D20B83E2 From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Sean Brogan , Michael D Kinney , Liming Gao Subject: [edk2-devel] [edk2-wiki][PATCH v3 4/4] Update existing build instructions Date: Wed, 7 Dec 2022 11:24:03 -0500 Message-Id: <20221207162403.337-5-mikuback@linux.microsoft.com> In-Reply-To: <20221207162403.337-1-mikuback@linux.microsoft.com> References: <20221207162403.337-1-mikuback@linux.microsoft.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,mikuback@linux.microsoft.com X-Gm-Message-State: mWeggIWjjqka0b1NCQoCv2Prx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1670430275; bh=XQ9Ms7N35Lb/z+khxXHToYuBUE47YlwdYE2wx15vp0g=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=mOfKk+d33eqZ5wMo0SUN7bMbScdQfhEWnioCUivz6VXMEdYSl8F1mGYdr3XKEEAKNLj WAgtPb6CuuKxua4q5zz1ZhPbFNJK5fuF2x2htdhiIJGWiSuzYErlqIOOXI6SCIUnCJrV5 ORUBmsgulZewKwYWq4krkdEMdDDX0Gi9380= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1670430278241100002 Content-Type: text/plain; charset="utf-8" From: Michael Kubacki Adds a reference to existing documents in the wiki with build instructions to point to the new top-level build file. The original files are left in place for information reference and to prevent breaking links that may be pointing to them. Cc: Sean Brogan Cc: Michael D Kinney Cc: Liming Gao Signed-off-by: Michael Kubacki --- Build.mediawiki | 229 +++++----- BuildTool-Setup-Guide.mediawiki | 89 ++-- Common-instructions-for-Unix.mediawiki | 377 +++++++-------- Common-instructions.mediawiki | 211 ++++----- Getting-Started-with-EDK-II.mediawiki | 16 +- UDK2017-How-to-Build.md | 252 +++++----- UDK2018-How-to-Build.md | 262 +++++------ Unix-like-systems.mediawiki | 425 ++++++++--------- Using-EDK-II-with-Native-GCC.mediawiki | 483 ++++++++++---------- Windows-systems.mediawiki | 314 ++++++------- 10 files changed, 1352 insertions(+), 1306 deletions(-) diff --git a/Build.mediawiki b/Build.mediawiki index 19517eaef4e3..8e16cb12576b 100644 --- a/Build.mediawiki +++ b/Build.mediawiki @@ -1,114 +1,115 @@ -=3DFrequently asked EDK II build questions=3D - -=3D=3DRegarding the Build for EDK II, how do you specify a different compi= ler tool chain on the command line?=3D=3D - -Use =E2=80=93t parameter for the build command. Example: Using the Microso= ft Visual Studio 2005 tool chain ...=20 - - build =E2=80=93t VS2005 - -For using other tools see [[Getting_Started_with_EDK_II]]. This provides s= ome detailed instructions for setting up some different tool chains? The fi= le Conf/tools_def.txt contains a list of targets. - -=3D=3DIs it possible to use PCDs @ build time?=3D=3D - -It depends on what you are trying to do. For use in code, yes.=20 -For example Featureflag PCD type can be used. For determining if something= should be built then it might be better to use the =E2=80=9CBuild =E2=80= =93D MACRO-NAME=E2=80=9D options. - -=3D=3DIs there information on Building on Linux?=3D=3D - -For EDK II, yes, the build tools will need to be recompiled for GCC. Link= for how to Build for GCC:=20 -* [[Using EDK II with Native GCC]] -* [[Unix-like systems]] (For older Linux distributions, or when using Cygw= in or Mac OS X) - -=3D=3DWhat is the state of Python?=3D=3D - -For Building EDK II Python of at least version 2.5 is needed. On Linux we'= ve used 2.6 & 2.7. Python 3+ is not supported and will not work currently.= On Windows, python is not required to be installed to build with EDK II.=20 -There is a Python interpreter that is part of the EFI toolkit on tianocor= e.org and is at the Python version level 2.4, There are long term plans to= move to EDK II and support a later version of Python as part of the [[AppP= kg]]. It is currently (01/2012) in Aplha stage. - -=3D=3DWhat does the parsing tool do?=3D=3D - -The parsing is part of the first stage of the build process. There are to= ols for parsing the set build description files and the target.txt for a p= ackage or platform and creates the intermediate make and autogen files - -=3D=3DRegarding writing UEFI Applications in EDK II, where is the output a= nd/or the binary UEFI application after doing a build?=3D=3D - -The Build output directory is defined in the defines section of a .DSC fil= e. -For example, Nt32Pkg\Nt32Pkg.dsc - the UEFI application would be in Build\= NT32\DEBUG_MYTOOLS\IA32 - - OUTPUT_DIRECTORY =3D Build/NT32 - SUPPORTED_ARCHITECTURES =3D IA32 - BUILD_TARGETS =3D DEBUG - -=3D=3DHow do I get my UEFI application to the target UEFI System?=3D=3D - -Copy the UEFI Binary image from the output directory after the build to a = USB thumb drive. Insert the USB drive in the UEFI target system. Boot to th= e EFI Shell. The USB thumb drive should be one of the file systems, e.g. F= S0:. Cd to that USB drive and run your UEFI application from the shell pro= mpt - -=3D=3DIs the Build tool source code part of the Build?=3D=3D - -No, the repository for the Tool Source is a separate project. The binaries= by default are for a Windows build machine. For building on a non Windows = machine there are instructions for recompiling the build tools. - -The sources are also in the BaseTools directory with the pre-build Windows= executables. These sources are provided because they are the sources that= were used to build the binaries. On Windows systems, the tools do not nee= d to be built. The pre-build binaries can be used. One Linux, Unix, and O= S/X systems, these sources are used to build the binaries for that OS, or i= n the case of Python, the Python sources are executed directly. - -The [[BaseTools]] Source Project is where advanced development is done on = the EDK II tools. Tool developers work in this separate project until a ne= w feature is stable, and only once it is stable is a feature added to the B= aseTools directory and new binaries are generated. - -=3D=3DCan we use Ifdefs?=3D=3D - -This is not recommended but can be used within the DSC or FDF as part of t= he build. -But here is an example: - - !ifdef $(SOURCE_DEBUG_ENABLE) - MSFT:*_*_X64_GENFW_FLAGS =3D --keepexceptiontable - GCC:*_*_X64_GENFW_FLAGS =3D --keepexceptiontable - INTEL:*_*_X64_GENFW_FLAGS =3D --keepexceptiontable - !endif - -=3D=3DWhen can the report generator show the protocols produced by modules= ?=3D=3D - -The report generator can show protocols produced by modules. The Runtime D= XE core will also report what is missing before handing off. - -=3D=3DWhy is the Buffer Security check flag (Build options) disabled for b= uilding EDK II UEFI applications and drivers but it is enabled for building= tools. =3D=3D - -UEFI applications and drivers are not executed in an Operating System envi= ronment. This is important, as the switches have very specific (and, in the= pre-boot space, negative) impacts on generated code. The switch does two t= hings in the code that are not acceptable for the pre-boot environment: - -* The switch enables additional code in the compiled code base, which requ= ires a larger stack space than may be available in the pre-boot environment=20 -* The switch injects a call to a compiler specific function that is not pr= esent in our Firmware builds, and which we do not have information on how t= o emulate.=20 - -We disable these settings, as enabling them would create non-functioning c= ode. - -However, please be aware that Detecting Stack Overflows in Firmware is cri= tical in validation and development, and we use other techniques in our cod= e to do so. We just cannot generically support the /Gs flags (as noted abo= ve). - -The tools do have this flag set, as they are used within the Operating Sys= tem environment, where the intrinsic added by the compiler can be processed= correctly.=20 -=20 -=3D=3DAre there Dual-mode drivers in EDK II?=3D=3D - -No. The EDK II build system does not support the dual mode drivers descri= bed in the PI Specification. These types of modules are very difficult to = implement correctly, so we recommend that developer implement two different= modules instead. The EDK II does allow them to share sources, but 2 diffe= rent PE/COFF images would be generated when built. - -=3D=3DIs there a tool to parse the BIOS Build tree?=3D=3D - -a) Use the report generator build into the build tool =E2=80=9CBUILD =E2= =80=93Y=E2=80=9D on the command line=20 - - -Y REPORTTYPE, --report-type=3DREPORTTYPE - Flags that control the type of build report to - generate. Must be one of: [PCD, LIBRARY, FLASH, = DEPEX,=20 - BUILD_FLAGS, FIXED_ADDRESS, EXECUTION_ORDER]. - To specify more than one flag, repeat this option= on - the command line and the default flag set is [PCD, - LIBRARY, FLASH, DEPEX, BUILD_FLAGS, FIXED_ADDRESS] - Use =E2=80=9C=E2=80=93Y DEPEX=E2=80=9D and this will generate = a text file with dependencies - - -b) Predicted dispatch order is limited because it makes assumptions about = the behavior of the modules. It cannot handle that some PPI and DXE protoco= ls that might be conditionally produced. Documented in the EDK2010 March 20= 10 release notes. - -c) Behavior of dispatch =E2=80=93 filter for DEBUG_DISPATCH in DSC in the = PCD for the error level PcdDebugPrintErrorLevel - -=3D=3DHow does the build tool load the reset vector at 0xFFFFFFF0?=3D=3D - -This is defined in the PI Specification, Volume 3. http://www.uefi.org/spe= cs - -In the FV (Firmware Volume) there is something called a Volume Top File in= f the FV . A Volume Top File (VTF) is a file that must be located such that= the last byte of the file is also the last byte of the firmware volume. Re= gardless of the file type, a VTF must have the file name GUID of EFI_FFS_VO= LUME_TOP_FILE_GUID as defined below. - -From a PI point of view the first module that runs is the SEC core. If you= look at the VTF file it is basically the code that contains the reset vect= or, and it jumps to the SEC code. - -Reference: https://github.com/tianocore/edk2/tree/master/UefiCpuPkg/ResetV= ector/Vtf0 - -So the hard code bit is the FV (Firmware Volume) that that contains the Vo= lume Top File needs to start at an address where the end of the FV will end= up at the magic reset vector address.=20 - -In general the EFI build system constructs relocatable PE/COFF images, and= every image is linked at zero. If the code executes from FLASH, then when = the FV is constructed the PE/COFF images that are XIP (eXecute In Place) ha= ve their PE/COFF image relocated based on where they end up in the FV (base= d on info in FDF file). This is done by the build system. If the EFI code r= uns from RAM then it is loaded by a PE/COFF loader and relocated to its loa= d address. +=3DFrequently asked EDK II build questions=3D + + Note: This page is retained for reference. Most of the content as of 202= 2 is still relevant but it is recommended to + view the new set of build instructions that describe how to develo= p using containers and build with the Stuart + application. + +New instructions: [[Build-Instructions.md|Build Instructions]] + +=3D=3DRegarding the Build for EDK II, how do you specify a different compi= ler tool chain on the command line?=3D=3D + +Use =E2=80=93t parameter for the build command. Example: Using the Microso= ft Visual Studio 2019 tool chain ... + + build =E2=80=93t VS2019 + +For using other tools see [[Getting_Started_with_EDK_II]]. This provides s= ome detailed instructions for setting up some different tool chains? The fi= le Conf/tools_def.txt contains a list of targets. + +=3D=3DIs it possible to use PCDs @ build time?=3D=3D + +It depends on what you are trying to do. For use in code, yes. +For example Featureflag PCD type can be used. For determining if something= should be built then it might be better to use the =E2=80=9CBuild =E2=80= =93D MACRO-NAME=E2=80=9D options. + +=3D=3DIs there information on Building on Linux?=3D=3D + +For EDK II, yes, the build tools will need to be recompiled for GCC. Link= for how to Build for GCC: +* [[Using EDK II with Native GCC]] +* [[Unix-like systems]] (For older Linux distributions, or when using Cygw= in or Mac OS X) + +=3D=3DWhat does the parsing tool do?=3D=3D + +The parsing is part of the first stage of the build process. There are to= ols for parsing the set build description files and the target.txt for a p= ackage or platform and creates the intermediate make and autogen files + +=3D=3DRegarding writing UEFI Applications in EDK II, where is the output a= nd/or the binary UEFI application after doing a build?=3D=3D + +The Build output directory is defined in the defines section of a .DSC fil= e. +For example, Nt32Pkg\Nt32Pkg.dsc - the UEFI application would be in Build\= NT32\DEBUG_MYTOOLS\IA32 + + OUTPUT_DIRECTORY =3D Build/NT32 + SUPPORTED_ARCHITECTURES =3D IA32 + BUILD_TARGETS =3D DEBUG + +=3D=3DHow do I get my UEFI application to the target UEFI System?=3D=3D + +Copy the UEFI Binary image from the output directory after the build to a = USB thumb drive. Insert the USB drive in the UEFI target system. Boot to th= e EFI Shell. The USB thumb drive should be one of the file systems, e.g. F= S0:. Cd to that USB drive and run your UEFI application from the shell pro= mpt + +=3D=3DIs the Build tool source code part of the Build?=3D=3D + +No, the repository for the Tool Source is a separate project. The binaries= by default are for a Windows build machine. For building on a non Windows = machine there are instructions for recompiling the build tools. + +The sources are also in the BaseTools directory with the pre-build Windows= executables. These sources are provided because they are the sources that= were used to build the binaries. On Windows systems, the tools do not nee= d to be built. The pre-build binaries can be used. One Linux, Unix, and O= S/X systems, these sources are used to build the binaries for that OS, or i= n the case of Python, the Python sources are executed directly. + +The [[BaseTools]] Source Project is where advanced development is done on = the EDK II tools. Tool developers work in this separate project until a ne= w feature is stable, and only once it is stable is a feature added to the B= aseTools directory and new binaries are generated. + +=3D=3DCan we use Ifdefs?=3D=3D + +This is not recommended but can be used within the DSC or FDF as part of t= he build. +But here is an example: + + !ifdef $(SOURCE_DEBUG_ENABLE) + MSFT:*_*_X64_GENFW_FLAGS =3D --keepexceptiontable + GCC:*_*_X64_GENFW_FLAGS =3D --keepexceptiontable + INTEL:*_*_X64_GENFW_FLAGS =3D --keepexceptiontable + !endif + +=3D=3DWhen can the report generator show the protocols produced by modules= ?=3D=3D + +The report generator can show protocols produced by modules. The Runtime D= XE core will also report what is missing before handing off. + +=3D=3DWhy is the Buffer Security check flag (Build options) disabled for b= uilding EDK II UEFI applications and drivers but it is enabled for building= tools. =3D=3D + +UEFI applications and drivers are not executed in an Operating System envi= ronment. This is important, as the switches have very specific (and, in the= pre-boot space, negative) impacts on generated code. The switch does two t= hings in the code that are not acceptable for the pre-boot environment: + +* The switch enables additional code in the compiled code base, which requ= ires a larger stack space than may be available in the pre-boot environment +* The switch injects a call to a compiler specific function that is not pr= esent in our Firmware builds, and which we do not have information on how t= o emulate. + +We disable these settings, as enabling them would create non-functioning c= ode. + +However, please be aware that Detecting Stack Overflows in Firmware is cri= tical in validation and development, and we use other techniques in our cod= e to do so. We just cannot generically support the /Gs flags (as noted abo= ve). + +The tools do have this flag set, as they are used within the Operating Sys= tem environment, where the intrinsic added by the compiler can be processed= correctly. + +=3D=3DAre there Dual-mode drivers in EDK II?=3D=3D + +No. The EDK II build system does not support the dual mode drivers descri= bed in the PI Specification. These types of modules are very difficult to = implement correctly, so we recommend that developer implement two different= modules instead. The EDK II does allow them to share sources, but 2 diffe= rent PE/COFF images would be generated when built. + +=3D=3DIs there a tool to parse the BIOS Build tree?=3D=3D + +a) Use the report generator build into the build tool =E2=80=9CBUILD =E2= =80=93Y=E2=80=9D on the command line + + -Y REPORTTYPE, --report-type=3DREPORTTYPE + Flags that control the type of build report to + generate. Must be one of: [PCD, LIBRARY, FLASH, = DEPEX, + BUILD_FLAGS, FIXED_ADDRESS, EXECUTION_ORDER]. + To specify more than one flag, repeat this option= on + the command line and the default flag set is [PCD, + LIBRARY, FLASH, DEPEX, BUILD_FLAGS, FIXED_ADDRESS] + Use =E2=80=9C=E2=80=93Y DEPEX=E2=80=9D and this will generate = a text file with dependencies + + +b) Predicted dispatch order is limited because it makes assumptions about = the behavior of the modules. It cannot handle that some PPI and DXE protoco= ls that might be conditionally produced. Documented in the EDK2010 March 20= 10 release notes. + +c) Behavior of dispatch =E2=80=93 filter for DEBUG_DISPATCH in DSC in the = PCD for the error level PcdDebugPrintErrorLevel + +=3D=3DHow does the build tool load the reset vector at 0xFFFFFFF0?=3D=3D + +This is defined in the PI Specification, Volume 3. http://www.uefi.org/spe= cs + +In the FV (Firmware Volume) there is something called a Volume Top File in= f the FV . A Volume Top File (VTF) is a file that must be located such that= the last byte of the file is also the last byte of the firmware volume. Re= gardless of the file type, a VTF must have the file name GUID of EFI_FFS_VO= LUME_TOP_FILE_GUID as defined below. + +From a PI point of view the first module that runs is the SEC core. If you= look at the VTF file it is basically the code that contains the reset vect= or, and it jumps to the SEC code. + +Reference: https://github.com/tianocore/edk2/tree/master/UefiCpuPkg/ResetV= ector/Vtf0 + +So the hard code bit is the FV (Firmware Volume) that that contains the Vo= lume Top File needs to start at an address where the end of the FV will end= up at the magic reset vector address. + +In general the EFI build system constructs relocatable PE/COFF images, and= every image is linked at zero. If the code executes from FLASH, then when = the FV is constructed the PE/COFF images that are XIP (eXecute In Place) ha= ve their PE/COFF image relocated based on where they end up in the FV (base= d on info in FDF file). This is done by the build system. If the EFI code r= uns from RAM then it is loaded by a PE/COFF loader and relocated to its loa= d address. diff --git a/BuildTool-Setup-Guide.mediawiki b/BuildTool-Setup-Guide.mediaw= iki index 445ef25af598..45a80406395f 100644 --- a/BuildTool-Setup-Guide.mediawiki +++ b/BuildTool-Setup-Guide.mediawiki @@ -1,43 +1,46 @@ -=3DGitHub Help=3D - -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 | All (https://help.github.com/ar= ticles/set-up-git) -* To download and install a Git GUI interface (http://git-scm.com/) - -=3D=3D'''GitHub EDK II Project Repositories'''=3D=3D - -* The EDK II BaseTools are part of the EDK II project repository.=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 -* Content that is not released under an accepted open source license can b= e found at https://github.com/tianocore/edk2-non-osi.
-=3D Getting the extra tools=3D -=3D=3D Compiler =3D=3D -For both the BuildTools and [http://www.tianocore.org/edk2/ EDK II] projec= ts, you will need to obtain a compiler from somewhere else. These instructi= ons do not cover obtaining or installation of a compiler tools chain. The B= aseTools build requires a C compiler; an assembler or ACPI assembler are no= t required to build tools in this project. BaseTools assume that a compiler= is already configured in the environment. - -=3D=3D Python =3D=3D -The BaseTools build supports the Makefile based build for EDK II. All Tool= s are written in either C or Python. The C tools must compile on all operat= ing systems with various compilers, so the code is written using simple, st= andard functions and libraries. The Python-based tools are written assuming= the features that were available in Python. GUI applications can be create= d in Python, using the wxPython package and all Python applications can be = converted to run under a native OS (Windows, Linux or OS/X.) via the [[Pyth= on Tools]]. - -The tools in this section are NOT required to build the EDK II project; th= ey are needed to compile the -BaseTools used to build the EDK II project. - -The Python 2.7.x tools may be obtained from http://www.python.org/, while = additional Python modules may be installed using setuptools or pip. Be sure= to check-out the appropriate tool set for your OS. - -*Linux and OS/X developers using a command line, create a directory that w= ill be used to hold the files, then change to that directory.=20 -**Replace URL with apropriate one from [[Python Tools]]. Installation and = configuration for these tools are left to the developer. - - - - -Refer to documentation in either the UserManuals or Source folders for mor= e information.=20 -* BuildTools [https://github.com/tianocore/buildtools-BaseTools/tree/maste= r/UserManuals User Manuals] - -=3D'''How to Setup the EDK II Tree'''=3D -See [[Getting Started with EDK II]] - -=3D=3D EDK II Development Process =3D=3D -After setting up your build environment see [[EDK II Development Process]= ] for making contributions to the EDK II Project. - -=3DFurther Help=3D - -If you have questions about the code or run into obstacles getting things = to work for you, please join our [[edk2-devel]] email list and ask your EDK= II related questions on the list. +=3DGitHub Help=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]] + +GitHub (https://help.github.com/index.html) provides step-by-step instruct= ions for user registration and basic features supported by GitHub + +* Setup GitHub for Linux | Windows | MAC | All (https://help.github.com/ar= ticles/set-up-git) +* To download and install a Git GUI interface (http://git-scm.com/) + +=3D=3D'''GitHub EDK II Project Repositories'''=3D=3D + +* The EDK II BaseTools are part of the EDK II project repository. +* 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. +* Content that is not released under an accepted open source license can b= e found at https://github.com/tianocore/edk2-non-osi.
+=3D Getting the extra tools=3D +=3D=3D Compiler =3D=3D +For both the BuildTools and [http://www.tianocore.org/edk2/ EDK II] projec= ts, you will need to obtain a compiler from somewhere else. These instructi= ons do not cover obtaining or installation of a compiler tools chain. The B= aseTools build requires a C compiler; an assembler or ACPI assembler are no= t required to build tools in this project. BaseTools assume that a compiler= is already configured in the environment. + +=3D=3D Python =3D=3D +The BaseTools build supports the Makefile based build for EDK II. All Tool= s are written in either C or Python. The C tools must compile on all operat= ing systems with various compilers, so the code is written using simple, st= andard functions and libraries. The Python-based tools are written assuming= the features that were available in Python. GUI applications can be create= d in Python, using the wxPython package and all Python applications can be = converted to run under a native OS (Windows, Linux or OS/X.) via the [[Pyth= on Tools]]. + +The tools in this section are NOT required to build the EDK II project; th= ey are needed to compile the +BaseTools used to build the EDK II project. + +*Linux and OS/X developers using a command line, create a directory that w= ill be used to hold the files, then change to that directory. +**Replace URL with apropriate one from [[Python Tools]]. Installation and = configuration for these tools are left to the developer. + + + + +Refer to documentation in either the UserManuals or Source folders for mor= e information. +* BuildTools [https://github.com/tianocore/buildtools-BaseTools/tree/maste= r/UserManuals User Manuals] + +=3D'''How to Setup the EDK II Tree'''=3D +See [[Getting Started with EDK II]] + +=3D=3D EDK II Development Process =3D=3D +After setting up your build environment see [[EDK II Development Process]= ] for making contributions to the EDK II Project. + +=3DFurther Help=3D + +If you have questions about the code or run into obstacles getting things = to work for you, please join our [[edk2-devel]] email list and ask your EDK= II related questions on the list. diff --git a/Common-instructions-for-Unix.mediawiki b/Common-instructions-f= or-Unix.mediawiki index d15d3ffa0881..2432695e8844 100644 --- a/Common-instructions-for-Unix.mediawiki +++ b/Common-instructions-for-Unix.mediawiki @@ -1,186 +1,191 @@ -__NOTOC__ -=3D=3DCommon instructions for Unix =3D=3D - -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:=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: sudo apt-get install gcc-5 - -Locate the TARGET_ARCH setting: - -
-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: sudo apt-get install gcc-5 + +Locate the TARGET_ARCH setting: + +
+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
- 1) run `git clone https://github.com/tianocore/edk2.git vUDK2017` - 2) Move all files and folders under "vUDK2017" to "C:\MyWorkspace" - 4) **Optional** (See _Compile the BaseTools_ below) Checkout BaseTool= s binaries and copy them to BaseTools binary folder. Warning the Windows* = Binary tools are only valid for the tip of the https://github.com/tianocor= e/edk2 repository. - 1) `Cd C:\MyWorkspace` - 2) Run `git clone https://github.com/tianocore/edk2-BaseTools-wi= n32.git` - 3) Enter folder edk2-BaseTools-win32 - 4) Run the command `git checkout 0e088c19ab31fccd1d2f55d9e4fe031= 4b57c0097` - 5) `Cd C:\MyWorkSpace` - 6) Rename this folder from edk2-BaseTools-win32 to win32, then c= opy the win32 - directory into the BaseTools/Bin directory under the workspace.=20 - (e.g. "C:\MyWorkspace\BaseTools\Bin\") =20 -3. Generate OpenSSL* Crypto Library - 1) Open file "C:\MyWorkspace\CryptoPkg\Library\OpensslLib\OpenSSL-HOW= TO.txt" - and follow the instruction to install OpenSSL* for UEFI building. - For this release, please use OpenSSL-1.1.0e. - -4. Compile the BaseTools (Skip if Optional Step 2.iv was done above) See:=20 - https://github.com/tianocore/tianocore.github.io/wiki/Windows-systems= #compile-tools - 1) Open a Microsoft Visual Studio* command prompt, type `cd C:\MyWork= space` - to enter the workspace directory - 2) Compile the BaseTools C source tools =20 -
-	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
- `"build -p MdeModulePkg/MdeModulePkg.dsc -t GCC5"` - 5) Upon the build completing successfully there should be the UEFI Ap= plication "`HelloWorld.efi`" in the ~/src/MyWorkspace/Build/MdeModule/DEBU= G_GCC5/IA32 directory -*** - -If you have questions please email the [[edk2-devel]] mail list. - -See also [[Getting Started with EDK II]] - +# How to Build [[UDK2017]] + +> 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 and not specifically targeting UDK2017. Th= is page is retained for reference. + +New instructions: [Build Instructions](Build-Instructions.md) + +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) + 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
+ 1) run `git clone https://github.com/tianocore/edk2.git vUDK2017` + 2) Move all files and folders under "vUDK2017" to "C:\MyWorkspace" + 4) **Optional** (See _Compile the BaseTools_ below) Checkout BaseTool= s binaries and copy them to BaseTools binary folder. Warning the Windows* = Binary tools are only valid for the tip of the https://github.com/tianocor= e/edk2 repository. + 1) `Cd C:\MyWorkspace` + 2) Run `git clone https://github.com/tianocore/edk2-BaseTools-wi= n32.git` + 3) Enter folder edk2-BaseTools-win32 + 4) Run the command `git checkout 0e088c19ab31fccd1d2f55d9e4fe031= 4b57c0097` + 5) `Cd C:\MyWorkSpace` + 6) Rename this folder from edk2-BaseTools-win32 to win32, then c= opy the win32 + directory into the BaseTools/Bin directory under the workspace. + (e.g. "C:\MyWorkspace\BaseTools\Bin\") +3. Generate OpenSSL* Crypto Library + 1) Open file "C:\MyWorkspace\CryptoPkg\Library\OpensslLib\OpenSSL-HOW= TO.txt" + and follow the instruction to install OpenSSL* for UEFI building. + For this release, please use OpenSSL-1.1.0e. + +4. Compile the BaseTools (Skip if Optional Step 2.iv was done above) See: + https://github.com/tianocore/tianocore.github.io/wiki/Windows-systems= #compile-tools + 1) Open a Microsoft Visual Studio* command prompt, type `cd C:\MyWork= space` + to enter the workspace directory + 2) Compile the BaseTools C source tools +
+	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
+ `"build -p MdeModulePkg/MdeModulePkg.dsc -t GCC5"` + 5) Upon the build completing successfully there should be the UEFI Ap= plication "`HelloWorld.efi`" in the ~/src/MyWorkspace/Build/MdeModule/DEBU= G_GCC5/IA32 directory +*** + +If you have questions please email the [[edk2-devel]] mail list. + +See also [[Getting Started with EDK II]] + diff --git a/UDK2018-How-to-Build.md b/UDK2018-How-to-Build.md index b981b2162cc4..06a963a8e1e2 100644 --- a/UDK2018-How-to-Build.md +++ b/UDK2018-How-to-Build.md @@ -1,128 +1,134 @@ -# How to Build [[UDK2018]]=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.12.01 or later from http://www.nasm.us/ and instal= l 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 - 5) Download the pre-compiled Openssl binary from https://wiki.openssl= .org/index.php/Binaries. Search for a - Windows binary in the list of "_Third Party OpenSSL Related Binary= Distributions_" table that will be=20 - Windows binary. Go to the third party site to download the latest = version of Windows x64 86 or Win32 binary. - Download and extract to C:\Openssl. Make sure C:\Openssl is added = to system environment=20 - variable 'PATH'.=20 - -2. Create the full Source Code directory for the UDK2018 release - 1) Create a working space directory in the build machine, for example= , C:\MyWorkspace - 2) Download the official UDK2018 release .zip file from the [UDK2018 = Release Page](https://github.com/tianocore/edk2/releases/tag/vUDK2018) - 1) Download - UDK2018 edk-vUDK2018 Workspace [Source code (zip fil= e)](https://github.com/tianocore/edk2/archive/vUDK2018.zip)=20 - 2) Extract files in [edk2-vUDK2018] to the working space directory= C:\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 vUDK201= 8` - 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 "C:\MyWorkspace" - -3. Generate OpenSSL* Crypto Library - 1) Open file "C:\MyWorkspace\CryptoPkg\Library\OpensslLib\OpenSSL-HOW= TO.txt" - and follow the instruction to install OpenSSL* for UEFI building. - For this release, please use OpenSSL-1.1.0g. Download it from=20 - https://github.com/openssl/openssl/archive/OpenSSL_1_1_0g.zip - Extract it to C:\MyWorkspace\CryptoPkg\Library\OpensslLib, - and rename its directory name to openssl - -4. Compile the BaseTools See:=20 - https://github.com/tianocore/tianocore.github.io/wiki/Windows-systems= #compile-tools - 1) Open a Microsoft Visual Studio* command prompt, type `cd C:\MyWork= space` - to enter the workspace directory - 2) Compile the BaseTools C source tools =20 -
-	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
- `"build -p MdeModulePkg/MdeModulePkg.dsc -t GCC5"` - 5) Upon the build completing successfully there should be the UEFI Ap= plication "`HelloWorld.efi`" in the ~/src/MyWorkspace/Build/MdeModule/DEBU= G_GCC5/IA32 directory -*** - -If you have questions please email the [[edk2-devel]] mail list. - -See also [[Getting Started with EDK II]] - +# How to Build [[UDK2018]] + +> 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 and not specifically targeting UDK2018. Th= is page is retained for reference. + +New instructions: [Build Instructions](Build-Instructions.md) + +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.12.01 or later from http://www.nasm.us/ and instal= l 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 + 5) Download the pre-compiled Openssl binary from https://wiki.openssl= .org/index.php/Binaries. Search for a + Windows binary in the list of "_Third Party OpenSSL Related Binary= Distributions_" table that will be + Windows binary. Go to the third party site to download the latest = version of Windows x64 86 or Win32 binary. + Download and extract to C:\Openssl. Make sure C:\Openssl is added = to system environment + variable 'PATH'. + +2. Create the full Source Code directory for the UDK2018 release + 1) Create a working space directory in the build machine, for example= , C:\MyWorkspace + 2) Download the official UDK2018 release .zip file from the [UDK2018 = Release Page](https://github.com/tianocore/edk2/releases/tag/vUDK2018) + 1) Download - UDK2018 edk-vUDK2018 Workspace [Source code (zip fil= e)](https://github.com/tianocore/edk2/archive/vUDK2018.zip) + 2) Extract files in [edk2-vUDK2018] to the working space directory= C:\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 vUDK201= 8` + 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 "C:\MyWorkspace" + +3. Generate OpenSSL* Crypto Library + 1) Open file "C:\MyWorkspace\CryptoPkg\Library\OpensslLib\OpenSSL-HOW= TO.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 C:\MyWorkspace\CryptoPkg\Library\OpensslLib, + and rename its directory name to openssl + +4. Compile the BaseTools See: + https://github.com/tianocore/tianocore.github.io/wiki/Windows-systems= #compile-tools + 1) Open a Microsoft Visual Studio* command prompt, type `cd C:\MyWork= space` + to enter the workspace directory + 2) Compile the BaseTools C source tools +
+	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
+ `"build -p MdeModulePkg/MdeModulePkg.dsc -t GCC5"` + 5) Upon the build completing successfully there should be the UEFI Ap= plication "`HelloWorld.efi`" in the ~/src/MyWorkspace/Build/MdeModule/DEBU= G_GCC5/IA32 directory +*** + +If you have questions please email the [[edk2-devel]] mail list. + +See also [[Getting Started with EDK II]] + diff --git a/Unix-like-systems.mediawiki b/Unix-like-systems.mediawiki index 36fd1a2b1299..1d037b51513a 100644 --- a/Unix-like-systems.mediawiki +++ b/Unix-like-systems.mediawiki @@ -1,210 +1,215 @@ -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.=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.

-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=20 - -=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 .domain.com:
-    $ git config --global http.proxy .domain.com:
-
- - -=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.
-* [[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 =20 - -Continue to [[Windows-systems#compile-tools |Compile Tools]]=20 - -=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=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.

+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 .domain.com:
+    $ git config --global http.proxy .domain.com:
+
+ + +=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.
+* [[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 +
+ + +=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: + +
+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 (#97097): https://edk2.groups.io/g/devel/message/97097 Mute This Topic: https://groups.io/mt/95518594/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-