Skip to content

Latest commit

 

History

History
1413 lines (1116 loc) · 51 KB

PITCHME.md

File metadata and controls

1413 lines (1116 loc) · 51 KB

---?image=assets/images/gitpitch-audience.jpg @title[Platform Build Lab]

This slide deck has moved to: https://gitpitch.com/tianocore-training/Platform_Build_Lab/master#/


UEFI & EDK II Training

Platform Build Lab


tianocore.org Note: PITCHME.md for UEFI / EDK II Training Platform Build Lab

Copyright (c) 2018, Intel Corporation. All rights reserved.

Redistribution and use in source (original document form) and 'compiled' forms (converted to PDF, epub, HTML and other formats) with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code (original document form) must retain the above copyright notice, this list of conditions and the following disclaimer as the first lines of this file unmodified.

  2. Redistributions in compiled form (transformed to other DTDs, converted to PDF, epub, HTML and other formats) must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS DOCUMENTATION IS PROVIDED BY TIANOCORE PROJECT "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL TIANOCORE PROJECT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


@title[Lesson Objective]

<p align="center"Platform Build Labs

Lab Setup and Build for OVMF or Minnowboard Max/Turbot

@fa[certificate gp-bullet-green]  Lab 1: Build a EDK II Platform using OVMF package

@fa[certificate gp-bullet-cyan]  Lab 2: Hardware Setup for Minnowboard Max/Turbot

@fa[certificate gp-bullet-yellow]  Lab 3: Build a EDK II Platform using Minnowboard
        Max/Turbot


---?image=assets/images/binary-strings-black2.jpg @title[Lab 1 -Build OVMF Section]




     Lab 1: Build OvmfPkg

         Setup OvmfPkg to build and run w/ QEMU and Ubuntu


@title[Ubuntu 16.04 Pre-requisites]

Pre-requisites Ubuntu 16.04

Instructions from: tianocore wiki Ubuntu_1610

  • Example Ubuntu 16.04
  • The following need to be accessible for building Edk II Platforms, From the terminal prompt (Cnt-Alt-T) :
bash$ sudo apt-get install build-essential uuid-dev iasl git gcc-5 nasm python3-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 - dist-utils module from the Python standard library
bash$ sudo apt-get install qemu
; Qemu – Emulation with Intel architecture with UEFI Shell 

Note:

---?image=/assets/images/slidesx/Slide5.JPG @title[Create QEMU run script]

Create Qemu Run Script

1. Create a run-ovmf directory under the home directory

bash$ cd ~
bash$ mkdir ~run-ovmf
bash$ cd run-ovmf

2. Create a directory to use as a hard disk image

bash$ mkdir hda-contents

3. Create a Linux shell script to run the QEMU from the run-ovmf directory

bash$ gedit RunQemu.sh

Note: Create a run-ovmf directory under the home directory

bash$ cd ~
bash$ mkdir ~run-ovmf
bash$ cd run-ovmf

  • Create a directory to use as a hard disk image

'bash$ mkdir hda-contents'

  • Create a Linux shell script to run the QEMU from the run-ovmf directory

bash$ gedit RunQemu.sh
qemu-system-x86_64 -pflash bios.bin -hda fat:rw:hda-contents -net none -debugcon file:debug.log -global isa-debugcon.iobase=0x402
Save and Exit

+++ @title[Create QEMU run script 02]

Create Qemu Run Script
- Copy and paste

1.Create a run-ovmf directory under the home directory ```bash bash$ cd ~ bash$ mkdir ~run-ovmf bash$ cd run-ovmf ``` 2.Create a directory to use as a hard disk image ```bash bash$ mkdir hda-contents ``` 3.Create a Linux shell script to run the QEMU from the run-ovmf directory ```bash bash$ gedit RunQemu.sh // In gedit: qemu-system-x86_64 -pflash bios.bin -hda fat:rw:hda-contents -net none -debugcon file:debug.log -global isa-debugcon.iobase=0x402 ``` Save and Exit

Note:


@title[Optional - Downloading the Edk II Source]

Download the Edk II Source  - Optional

OPTIONAL - Open a “git” command prompt and create a source working directory

  bash$ mkdir WS
  bash$ cd WS

OPTIONAL - Internet Proxies – (company Firewall used for example)

 bash$ git config --global https.proxy <proxyname>.domain.com:<port>
 bash$ git config --global http.proxy <proxyname>.domain.com:<port>

OPTIONAL - Download edk2 source tree using Git command prompt

  bash$ git clone https://github.com/tianocore/edk2.git
  
  bash$  make -C edk2/BaseTools

@coloryellow Lab Material will have a different “edk2”

Note:

  • OPTIONAL - Open a terminal prompt and create a source working directory

bash$ mkdir ~/src
bash$ cd ~/src

  • OPTIONAL - Internet Proxies – (company Firewall used for example)

bash$ export http_proxy=http://proxy-us.company.com:911
bash$ export ftp_proxy=$http_proxy

  • OPTIONAL - Download edk2 source tree using Git

bash$ git clone https://github.com/tianocore/edk2

  • OPTIONAL - Build the tools

bash$ make -C edk2/BaseTools

  • NOTE: Lab Material will have a different “edk2”

---?image=assets/images/binary-strings-black2.jpg @title[Setup Lab Material sub Section]




     Setup Lab Material

         Lab_Material_FW.zip


@title[Download Lab_Material_FW -getting the Source ]

Download Lab Material

Download the Lab_Material_FW.zip from : @fa[github gp-bullet-white] github.com Lab_Matrial_FW.zip

OR
Use git clone to download the Lab_Material_FW

bash$ cd $HOME
bash$ git clone https://github.com/tianocore-training/Lab_Material_FW.git

Directory Lab_Material_FW will be created

   FW 
    - Documentation 
	- DriverWizard 
	- edk2      
	- edk2Linux 
	- LabSampleCode 

---?image=/assets/images/slidesx/Slide10.JPG @title[Build Ovmf Edk2 -getting the Source ]

Build EDK II Ovmf

@snap[north-east span-50 ]

–Extract the Source

@snapend

@snap[north-west span-100 ]

1. Extract the Downloaded `Lab_Material_FW-master.zip` to `Home` ( this will create a directory `FW`)


@snapend

Note: Extract the Downloaded Lab_Material_FW.zip to Home (this will create a directory FW )

---?image=/assets/images/slidesx/Slide11.JPG @title[Build Ovmf Edk2 -getting the Source 02]

Build EDK II Ovmf

@snap[north-east span-50 ]

– Copy the Source

@snapend

@snap[north-west span-100 ]

2. Open a terminal prompt (Alt-Cnt-T)
3. Create a working space directory "src" under the home directory
     bash$ mkdir ~src  
4. From the downloaded "`Lab_Material_FW`" folder, copy and  paste folder  "`.../FW/edk2`"  to  `~src`


@snapend

Note:

  • Open a terminal prompt (Alt-Cnt-T)

  • Create a working space source directory under the home directory

bash$ mkdir ~src

  • From the FW folder, copy and paste folder “~FW/edk2” to ~src

---?image=/assets/images/slidesx/Slide12.JPG @title[Build Ovmf Edk2 -getting the Source 03]

Build EDK II Ovmf

@snap[north-east span-50 ]

– Getting BaseTools

@snapend

@snap[north-west span-100 ]

5. Rename or `mv` the direcotry "`~src/edk2/BaseTools`"
  bash$ cd ~src/edk2  
  bash$ mv BaseTools BaseToolsX  

6. Extract the file `~FW/edk2Linux/BaseTools.tar.gz` to `~src/edk2`


@snapend

Note:

  • Rename or mv the directory “~src/edk2/BaseTools” bash$ cd ~src/edk2 bash$ mv BaseTools BaseToolsX
  • Extract the file ~FW/edk2Linux/BaseTools.tar.gz to ~src/edk2

---?image=/assets/images/slidesx/Slide13.JPG @title[Build Ovmf Edk2 -getting the Source 04]

Build EDK II Ovmf

@snap[north-east span-50 ]

– Building `BaseTools`

@snapend

@snap[north-west span-100 ]


7. Run Make from the Terminal prompt
  bash$ cd ~src/edk2      
  bash$ make -C BaseTools  











8. Run edksetup (note This will need to be done for every new Terminal prompt)


@snapend

@snap[south-west span-100 ]

  bash$ . edksetup.sh   



@snapend

Note:

  • Run Make from the Terminal prompt bash$ cd ~src/edk2 bash$ make –C BaseTools
  • Run edksetup (note This will need to be done for every new Terminal prompt)

bash$ . edksetup.sh

---?image=assets/images/binary-strings-black2.jpg @title[Build Ovmf sub Section]




     Build Ovmf Platform

         

---?image=/assets/images/slidesx/Slide15.JPG @title[Build Ovmf Edk2 -update target.txt]

Build EDK II Ovmf

@snap[north-east span-60 ]

– Update Target.txt & Build

@snapend

@snap[north-west span-100 ]

@size[1.1em](What is OVMF?)
Open Virtual Machine Firmware - Build with edk2
  bash$ gedit Conf/target.txt  









          Save and Exit

  bash$ cd ~src/edk2   
  bash$ build     


@snapend

@snap[south-east span-100 ]

More info: tianocore - wiki/OVMF

@snapend

Note:

bash$ gedit Conf/target.txt
  1. ACTIVE_PLATFORM = OvmfPkg/OvmfPkgX64.dsc
  2. TARGET_ARCH = X64
  3. TOOL_CHAIN_TAG = GCC5
  • Save and Exit
bash$ cd ~src/edk2
bash$ build

+++ @title[Build Ovmf Edk2 -update target.txt]

Build EDK II Ovmf

@snap[north-east span-65 ]

– Update Target.txt - COPY and PASTE

@snapend
Edit the Conf/target.txt file - Copy and Paste ```bash bash$ gedit Conf/target.txt ``` In the gedit update: ```xml ACTIVE_PLATFORM = OvmfPkg/OvmfPkgX64.dsc #. . . TARGET_ARCH = X64 #. . . TOOL_CHAIN_TAG = GCC5 ``` Then Build ```bash bash$ cd ~src/edk2 bash$ build ```

Note:

---?image=/assets/images/slidesx/Slide17.JPG @title[Build Ovmf Edk2 -build inside Terminal]

Build EDK II Ovmf

@snap[north-east span-50 ]

– Inside Terminal

@snapend

Note:

  • Inside Terminal

---?image=/assets/images/slidesx/Slide18.JPG @title[Build Ovmf Edk2 -Verify]

Build EDK II Ovmf

@snap[north-east span-50 ]

– Verify Build Succeeded

@snapend

@snap[north-west span-100 ]

OVMF.fd should be in the Build directory
   - For GCC5 with X64, it should be located at:
   ~/src/edk2/Build/OvmfX64/DEBUG_GCC5/FV/OVMF.fd   


@snapend

Note:

---?image=/assets/images/slidesx/Slide19.JPG @title[Build Ovmf Edk2 -invoke QEMU]

Invoke QEMU

Change to run-ovmf directory under the home directory

```
 bash$ cd $HOME/run-ovmf
```
Copy the OVMF.fd BIOS image to the run-ovmf directory naming it bios.bin
```
 bash$ cp ~/src/edk2/Build/OvmfX64/DEBUG_GCC5/FV/OVMF.fd bios.bin
```
Run the RunQemu.sh Linux shell script
```
bash$ . RunQemu.sh
```
QEMU will start and boot to the shell
 

Note:

---?image=assets/images/gitpitch-audience.jpg @title[End of Section]




     End of Lab

         Return to the beginning

---?image=assets/images/binary-strings-black2.jpg @title[Lab 2 -Setup MAX HW Section]




     Lab 2: Platform HW Setup

         Setup hardware for MinnowBoard Max/Turbot

---?image=/assets/images/slidesx/Slide22.JPG @title[MAX/Turbot HW]

EDK II Platform (MinnowBoard MAX/Turbot)

@snap[south-west span-45 ]

Intel® Atom processor E3800 Series
(Formerly Bay Trail-I)


@snapend

Note:

This lab shows the build process for an actual platform – Minnowboard.org

  • Using Tianocore source
  • Open source EDK II plus open source binary obj. packages

---?image=/assets/images/slidesx/Slide23.JPG @title[Workshop Lab Hardware]

MinnowBoard MAX Workshop Lab Hardware

@snap[south span-100 ]

 **Warning do not use any other power supply than 5V or the board will Fry  


@snapend Note:

**Warning do not use any other power supply than 5V or the board will Fry

---?image=/assets/images/slidesx/Slide24.JPG @title[Install Ubuntu “Screen”]

Install Ubuntu “Screen”

@snap[north-west span-100 ]

Terminal prompt (Cnt-Alt-T)
Install "Screen"

   bash$ sudo apt-get install screen   
   bash$ cd $Home   
   bash$ gedit ~.screenrc   


Inside the editor, type
@size[.8em]("`shell /bin/bash`")   then save


@snapend

@snap[north-east span-45 ]

While in screen
Cnt-A then D goes back to Terminal

@size[.9em](`bash$ screen -r`)
(Returns to screen)


@snapend

@snap[south-east span-80 ]

There may be other serial terminal applications that are supported.

@snapend

Note:

  • Terminal prompt (Cnt-Alt-T)
    bash$ sudo apt-get install screen
    bash$ cd $Home
    bash$ gedit ~.screenrc

shell /bin/bash

Click Save

---?image=/assets/images/slidesx/Slide25.JPG @title[Max Test System]

Setup MinnowBoard Max Test System

@snap[north-west span-60 ]


Hardware:

  • - System Under Test (SUT) - MinnowBoard Max/Turbot
  • - USB to 3.3V TTL Cable (6 pin to USB Type A)
  • - 5V power supply

Connect the USB w/ 6 pin header to SUT (MAX)
   - black wire (pin 1) is closest to the SATA connector

Connect the USB Type A connector to Host (Laptop)


@snapend

@snap[south span-100 ]

 **Warning do not use any other power supply than 5V or the board will Fry  

@snapend

Note:

  • Hardware:
  • System Under Test (SUT) – MinnowBoard Max or Turbot
  • 5V- ** power supply
  • USB to 3.3V TTL Cable (6 pin to USB Type A)
    • Connect the USB w/ 6 pin header to SUT
      • black wire(pin 1) is closest to the SATA connector
    • Connect the USB Type A connector to Host

---?image=/assets/images/slidesx/Slide26.JPG @title[Max Test System 02]

Setup MinnowBoard Max Test System

@snap[north-west span-100 ]

Open Terminal prompt (Cnt-Alt-T)

   bash$ dmesg   
   bash$ sudo chmod 666 /dev/ttyUSB@color[cyan](n)   


@snapend

@snap[north-east span-55 ]



(to check which USB port is assigned)
(where @color[cyan](n) is the FTDI number )   


@snapend

Note:

  • Open Terminal Prompt (Cnt-Alt-T)
bash$ dmesg                     	#(to check which USB port is assigned)
bash$ sudo chmod 666 /dev/ttyUSBn	#(where n is the FTDI number)
  • dmesg command shows which - ttyUSBn

---?image=/assets/images/slidesx/Slide27.JPG @title[Power on MinnowBoard MAX]

Power on MinnowBoard MAX

@snap[north-west span-100 ]

Connect the Power supply cable to the MinnowBoard MAX
   bash$ screen /dev/ttyUSB@color[cyan](n) 115200   
MinnowBoard MAX should boot to the UEFI Shell in the Terminal – Screen


@snapend

@snap[north-east span-25 ]







@color[yellow](While in Screen
Cnt-A then D goes back to terminal.)

   bash$ screen-r   
(returns to Screen)   


@snapend

Note:

  • Connect the Power supply cable to the MinnowBoard MAX
bash$ screen /dev/ttyUSBn 115200
  • MinnowBoard MAX should boot to the UEFI Shell in the Terminal – Screen .

  • While in screen Cnt-A then D goes back to terminal

 bash$ screen –r #(returns to screen)
  • Note: Cnt-H for Backspace

**Warning do not use any other power supply than 5V or the board will Fry

---?image=assets/images/gitpitch-audience.jpg @title[End of Section]




     End of Lab

         Return to the begining   or   @fa[chevron-right gp-bullet-cyan]   to continue

---?image=assets/images/binary-strings-black2.jpg @title[Lab 3 -Build Max/Turbot Section]




     Lab 3: Build MinnowBoard Turbot

         

---?image=/assets/images/slidesx/Slide30.JPG @title[MinnowBoard MAX/ Turbot Platform]

EDK II Platform (MinnowBoard MAX/Turbot)

@snap[south-west span-45 ]

Intel® Atom processor E3800 Series
(Formerly Bay Trail-I)


@snapend Note: - Intel® Atom processor E3800 Series (Formerly Bay Trail-I)

---?image=/assets/images/slidesx/Slide31.JPG @title[MinnowBoard MAX/ Turbot Platform]

Where to get Open Source
MinnowBoard Max


- Open Source Max Wiki - V 1.00 - Github Link - Binary Object Modules:
firmware.intel.com
- How to Build Release Notes

Note:

  • Step by step if NOT downloading Lab release of Minnowboard MAX/Turbot

---?image=/assets/images/slidesx/Slide32.JPG @title[MinnowBoard MAX/ Turbot Platform]

Where to get Open Source
MinnowBoard Max


- Open Source Max Wiki - V 1.00 - Github Link - Binary Object Modules:
firmware.intel.com
- How to Build Release Notes

Note:

  • Step by step if NOT downloading Lab release of Minnowboard MAX/Turbot

@title[Download MinnowBoard MAX Lab Source]

Download MAX Lab Source

Download the PlatformBuildLab_FW.zip from : @fa[github gp-bullet-white] github.com PlatformBuildLab_FW.zip

OR
Use git clone to download the PlatformBuildLab_FW

bash$ cd $HOME
bash$ git clone https://github.com/tianocore-training/PlatformBuildLab_FW.git

Directory PlatformBuildLab_FW will be created

   FW 
    - PlatformBuildLab
	   - Max                    - Minnowboard Max Source for the Labs
	   - BaseToolsMax.tar.gz    - BaseTools for Linux GCC5 build
	   - MinnowBoard.MAX.FirmwareUpdateX64.efi  - UEFI App to flash Firmware .BIN to Target
	   . . .

---?image=/assets/images/slidesx/Slide34.JPG @title[MinnowBoard MAX Lab Setup]

MinnowBoard MAX Lab Setup

@snap[north-west span-100 ]


@color[#87E2A9](Previous Lab Setup Requirements)
  bash$ sudo apt-get install build-essential uuid-dev iasl git gcc-5 nasm  
@color[#87E2A9](Additional Lab Setup -)
    @color[#87E2A9]( `PlatformLab_FW/FW/PlatformBuildLab`)

@snapend

@snap[south-west span-100 ]

Directories:
   •Max
   •BuildToolsMax.tar.gz

   At the Terminal prompt - install Screen utility for Serial Console to run UEFI Shell
      bash$ sudo apt-get screen            


@snapend

@snap[south-east span-70 ]


   ‐  MinnowBoard Max Project source code
   ‐  Build tools for GCC compiler

     
       


@snapend

Note:

  • Previous Lab Setup Requirements
bash$ sudo apt-get install build-essential uuid-dev iasl git gcc-5 nasm 

Additional Lab Setup – ~src/FW/PlatformBuildLab

  • Max – MinnowBoard Max Project source code
  • BuildToolsMax.tar.gz – build tools for GCC compiler
  • At Terminal prompt - Install Screen utility for Serial Console to run UEFI Shell
bash$ sudo apt-get install screen

---?image=/assets/images/slidesx/Slide35.JPG @title[Get the Minnowboard Max Source]

Copy Minnowboard Max Source

@snap[north-west span-100 ]


Open a terminal prompt(Alt-Cnt-T)
Create a working space source directory under the home directory
   bash$ mkdir ~src     
From the `FW/PlatformBuildLab` folder, copy and paste folder "`~FW/Max`" to `~src`

@snapend Note:

  • Open a terminal prompt (Alt-Cnt-T)
  • Create a working space source directory under the home directory
    • bash$ mkdir ~src
  • From the FW/PlatformBuildLab folder, copy and paste folder “~FW/Max” to ~src

---?image=/assets/images/slidesx/Slide36.JPG @title[Get the BaseTools]

Get the BaseTools for Max

@snap[north-west span-100 ]

Rename or mv the directory @size[.8em]("`~src/Max/edk2/BaseTools`")
   bash$ cd ~src/Max/edk2     
   bash$ mv BaseTools BaseToolsX   
   bash$ tar -xf BaseToolsMax.tar.xz   

Extract the file @size[.8em](`~FW/PlatformBuildLab/BaseToolsMax.tar.gz`) to @size[.8em](`~src/Max/edk2`)

@snapend

Note:

  • Extract the Rename or mv the directory “~src/Max/edk2/BaseTools”
 bash$ cd ~src/Max/edk2<Br>
 bash$ mv BaseTools BaseTools
  • Extract the file ~FW/PlatformBuildLab/BaseToolsMax.tar.gz to ~src/Max/edk2
    • bash$ tar -xf BaseToolsMax.tar.xz

---?image=/assets/images/slidesx/Slide37.JPG @title[Platform Source Directory Structure]

Platform Source Directory Structure

Note:

  • Platform Source Directory Structure
    • Build from /Vlv2TbltDevicePkg directory

@title[Steps to Build & Install Firmware]

Steps to Build & Install Firmware

  • @size[1.125em]( ❶)  Open Terminal prompt & Cd to
           @size[.7em]( `$HOME/src/Max/edk2-platforms/Vlv2TbltDevicePkg`)
  • @size[1.125em]( ❷)  Fix-up "chmod" script files
  • @size[1.125em]( ❸)  Invoke the build process
  • @size[1.125em]( ❹)  Locate build output (.BIN file for BIOS image)
  • @size[1.125em]( ❺)  Flash binary image onto the platform
  • @size[1.125em]( ❻)  Reset and verify the new firmware


Next slides will follow the above steps

Note:

Slide says it all


@title[fix-up shell properties ]

@size[1.1](Fix-up Script Properties to Execute)

@size[1.25em]( ❶)  Open Terminal prompt (Cnt-Alt-T) &
        Cd to work space directory
@size[1.25em]( ❷)  Fix script files to "execute" with `chmod +x`


 
 bash$ cd ~src/Max/edk2
 
 bash$ chmod +x edksetup.sh
 
 bash$ cd ~src/Max/edk2-platforms/
 
 bash$ chmod +x Vlv2TbltDevicePkg/bld_vlv.sh 
 bash$ chmod +x Vlv2TbltDevicePkg/Build_IFWI.sh
 bash$ chmod +x Vlv2TbltDevicePkg/GenBiosId

Note: Slide says it all


@title[Platform Build Scripts]

@size[1.1em](Platform Build Scripts)

@box[bg-purple-pp text-white rounded my-box-pad2 ](

Platform Build Scripts
 

)

Many Platform have a bash or bat script file to pre or post process the EDK II build process

For MinnowBoard MAX : `Build_IFWI.bat or Build_IFWI.sh`
 Build_IFWI
  – pre build processing
  – calls `vlv_bld` - a platform script to preform the EDK II `build`
  – determines date
  – board ID
  – post build stitching

Note:

For the platform edk II builds usually a script is called that will do pre and post build processing.
There is also this capability that is part of the .dsc but many developers have not taken advantage of this feature

---?image=/assets/images/slidesx/Slide41.JPG @title[Build Process for DEBUG]

Build Process for DEBUG

@snap[north-west span-20 ]



@size[1.125em]( ❸) @snapend

@snap[north-east span-95 ]

From Terminal Prompt enter:   Note: the Build will Pause

```
bash$ cd Vlv2TbltDevicePkg 
bash$ . Build_IFWI.sh MNW2 Debug
```
@snapend

Note: Slide says it all


@title[Examine Command Line & Build Parameters]

@size[1.1em](Examine Build Parameters)

@snap[north-west span-100 ]

@box[bg-black text-yellow rounded my-box-pad2 ](

  build


  

) @snapend

@snap[north-east span-85 fragment]

-D SYMBOLIC_DEBUG=TRUE   -D LOGGING=TRUE
. . . -D Option (n)

@snapend

@snap[north-east span-30 fragment]


@box[bg-white text-black rounded my-box-pad2 ](

  MACROS
  Logging
  Symbolic Debug
  

) @snapend

@snap[north-west span-100 fragment ]





Properties from `Conf\Target.txt`

TARGET

= @color[yellow](DEBUG)

Build Mode

TARGET_ARCH

= @color[yellow](IA32 X64)

CPU Architecture

TOOL_CHAIN_TAG

= @color[yellow](GCC5)

VS Tool Chain

ACTIVE_PLATFORM

= @color[yellow](Vlv2TbltDevicePkg /PlatformPkgX64)

Platform DSC file

MAX_CONCURRENT_ THREAD_NUMBER

= @color[yellow](1)

Thread Count

@snapend


@title[Examine Platform Parameters]

@size[1.1em](Platform Build and PCD Parameters)

@box[bg-purple-pp text-white rounded my-box-pad2 ](

Platform Parameters
 

)

Many Platform Parameters are defined in a top .DSC file that controls PCD and build switches

For MinnowBoard MAX : `PlatformPkgConfig.dsc`
Example:

 #
 # TRUE is ENABLE. FASLE is DISABLE.
 #
  //  . . .
 DEFINE SECURE_BOOT_ENABLE = TRUE
 DEFINE USER_IDENTIFICATION_ENABLE = FALSE
 DEFINE VARIABLE_INFO_ENABLE = FALSE
 DEFINE S3_ENABLE = TRUE
 DEFINE CAPSULE_ENABLE = TRUE
 DEFINE CAPSULE_RESET_ENABLE = TRUE
  // . . .

Note:

many will have "ifdef" statements in the major .dsc file in order to enable a feature or not

---?image=/assets/images/slidesx/Slide44.JPG @title[Build Process for Release]

Build Process for Release

@snap[north-west span-20 ]


@size[1.125em]( ❸) @snapend

@snap[north-east span-95 ]

From Terminal Prompt enter:   Note: the Build will Pause

```
bash$ cd Vlv2TbltDevicePkg 
bash$ . Build_IFWI.sh MNW2 Release
```
@snapend

@snap[north-east span-30 fragment]




@box[bg-white text-black rounded my-box-pad2 ](

  Note MACROS
  Logging
  Symbolic Debug
  Set to FALSE
  

) @snapend

Note:

From Terminal Prompt enter:

bash$ cd Vlv2TbltDevicePkg 
bash$ . Build_IFWI.sh MNW2 Release
 Slide says it all

@title[DEBUG & RELEASE Differences]

DEBUG & RELEASE Differences

@box[bg-purple-pp text-white rounded my-box-pad2 fragment](

Slower boot because the time it takes to display debug info
 

) @box[bg-green-pp text-white rounded my-box-pad2 fragment](

Larger image because of debug code & embedded info
 

) @box[bg-gold2 text-white rounded my-box-pad2 fragment](

Uses the serial port for debug string output
 

) @box[bg-royal text-white rounded my-box-pad2 fragment](

Contains detailed debug strings that show the
boot progress and various ASSERT / TRACE errors
 

)

Note:

DEBUG build …

  • Contains detailed debug strings that show the boot process, along with various ASSERT/TRACE errors
  • Uses the serial port for debug string output
  • Larger image than RELEASE, due to the embedded debug info
  • Slower boot than RELEASE, due to the time it takes to display the debug info

RELEASE build …

  • Does not contain the debug strings
  • Does not use the serial port for debug output
  • Smaller image than DEBUG
  • Faster boot than DEBUG

---?image=/assets/images/slidesx/Slide46.JPG @title[Build Process Completed]

Build Process Completed

@snap[north-west span-100 ]

@size[1.25em]( ❹)  Locate the build .BIN image @snapend

@snap[south-west span-100 ]

The platform build script post build process will stitch the multiple firmware volumes generated by the EDK II build process into the final .BIN image.

@snapend

Note:

Build Process Completed

  • The EDK II build generates multiple firmware volumes, which are combined in the .BIN image
  • typically the platform script will call a stitching process to combine all the images together in post processing after the EDK II build

The EDK II build generates multiple firmware volumes, which are combined in the .BIN image

---?image=/assets/images/slidesx/Slide47.JPG @title[Flash onto the MinnowBoard MAX]

Flashing the New BIOS

@snap[north-west span-100 ]

@size[1.25em]( ❺)  Flash the binary image
1.  Access Max Binary image file from build folder
     - ~src/Max/Vlv2TbltDevicePkg/Stitch
     - DEBUG MNW2MAX1.X64.D_0099_01_GCC.bin
     - RELEASE MNW2MAX1.X64.R_0099_01_GCC.bin
2.   Copy BIN files to a USB Thumb drive
3.   Copy MinnowBoard.MAX.FirmwareUpdateX64.efi to a USB thumb
       drive from ~/FW/PlatformBuildLab

4.   Boot to UEFI Shell on Max and type "FS0:" @snapend

Note:

  1. Access Max Binary image file from build folder
  • ~src/Max/Vlv2TbltDevicePkg/Stitch
  • DEBUG MNW2MAX1_X64_D_0097_01_GCC.bin
  • RELEASE MNW2MAX1_X64_R_0097_01_GCC.bin
  1. Copy BIN files to a USB Thumb drive
  2. Copy MinnowBoard.MAX.FirmwareUpdateX64.efi to a USB thumb drive from $HOME/FW/PlatformBuildLab
  3. bash$ screen /dev/ttyUSBn 115200

---?image=/assets/images/slidesx/Slide48.JPG @title[Flash onto the MinnowBoard MAX 02]

Flashing the New BIOS

5.   Run update `.efi` utility with either BIN file (Note the “TAB” Key
        will fill out the command line for you )

FS0:\> MinnowBoard.MAX.FirmwareUpdateX64.efi MNW2MAX1_X64_D_0099_01_GCC.bin

Wait for the new firmware update to finish






  Reset and boot new firmware

Note: 5. Run update .efi utility with either BIN file (Note the “TAB” Key will fill out the command line for you

FS0:\> MinnowBoard.MAX.FirmwareUpdateX64.efi MNW2MAX1_X64_D_0099_01_GCC.bin

Reset and boot new firmware

---?image=/assets/images/slidesx/Slide49.JPG @title[Verify after Firmware Update]

Verify after Firmware Update

@snap[north-west span-100 ]

@size[1.25em]( ❻)  Reboot and Verify

  • Verify that the Firmware was updated by checking the Date
  • At the shell prompt type “exit”
  • The EDK II front page will show the BIOS ID with Date/time stamp
    @snapend

Note:

Verify that the Firmware was updated by checking the Date At the shell prompt type “exit” The EDK II front page will show the BIOS ID with Date/time stamp


@title[Summary]

<p align="center"Summary


@fa[certificate gp-bullet-green]  Lab 1: Build a EDK II Platform using OVMF package

@fa[certificate gp-bullet-cyan]  Lab 2: Hardware Setup for Minnowboard Max/Turbot

@fa[certificate gp-bullet-yellow]  Lab 3: Build a EDK II Platform using Minnowboard
        Max/Turbot


---?image=assets/images/gitpitch-audience.jpg @title[Questions]
![Questions](/assets/images/questions.JPG =10x)


@title[return to main]

@size[1.2em](Return to Main Training Page)






Return to Training Table of contents for next presentation link

@snap[north span-30 ]


trainingLogo @snapend

---?image=assets/images/gitpitch-audience.jpg @title[Logo Slide]


![Logo Slide](/assets/images/TianocoreLogo.png =10x)


@title[Acknowledgements]

Acknowledgements

/**
Redistribution and use in source (original document form) and 'compiled' forms (converted
to PDF, epub, HTML and other formats) with or without modification, are permitted provided
that the following conditions are met:

Redistributions of source code (original document form) must retain the above copyright 
notice, this list of conditions and the following disclaimer as the first lines of this 
file unmodified.

Redistributions in compiled form (transformed to other DTDs, converted to PDF, epub, HTML
and other formats) must reproduce the above copyright notice, this list of conditions and 
the following disclaimer in the documentation and/or other materials provided with the 
distribution.

THIS DOCUMENTATION IS PROVIDED BY TIANOCORE PROJECT "AS IS" AND ANY EXPRESS OR IMPLIED 
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL TIANOCORE PROJECT BE 
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
ARISING IN ANY WAY OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY 
OF SUCH DAMAGE.

Copyright (c) 2019, Intel Corporation. All rights reserved.
**/