About MinnowBoard Max

MinnowBoard Max is a board with the processor Intel Atom. At power-up time you will see the command line uefi on the screen connected via hdmi if the default uefi is upgraded.

You can download the building instruction for UEFI from the following location http://firmware.intel.com/projects/minnowboard-max in the section Release Notes.

For example for building of the version 0.78 you open the nessesary Release Notes and perform the following operations.

1. Checkout the revision 16867 for UDK2014.SP1

svn checkout -r 16867  https://svn.code.sf.net/p/edk2/code/branches/UDK2014.SP1

2. Checkout the revision 17039 to another directory

svn checkout -r 17039  https://svn.code.sf.net/p/edk2/code/branches/UDK2014.SP1

and take only 2 folders from this directory Vlv2DeviceRefCodePkg and Vlv2TbltDevicePkg and put them on the place of the same folders but in the revision 16867

3. Checkout FatPkg of the revision 92 and then place them into the root directory of the revision 16867

svn checkout -r 92  https://svn.code.sf.net/p/edk2-fatdriver2/code/trunk/FatPkg

4. Get zip-file MinnowBoard_MAX-0.78-Binary.Objects.zip. Unzip it and copy 3 directories (IA32FamilyCpuPkg, Vlv2BinaryPkg, Vlv2MiscBinariesPkg) into the root directory of the revision 16867.

5. The default directory should be the folder with the revision 16867, therefore the other files can be deleted. Further discription concerns the folder with the revision 16867.

Run the following commands.

$ make -C ./BaseTools
$ export EDK_TOOLS_PATH=/home/user1/MyWork/Minnow/UDK2014.SP1/BaseTools
$ . edksetup.sh BaseTools

6. Doing what is written in the file CryptoPkg\Library\OpensslLib\Patch-HOWTO.txt, namely - download tar.gz-file named openssl-0.9.8ze.tar.gz, unpack it into CryptoPkg\Library\OpensslLib, and then apply the patch

$ patch -p0 -i ../EDKII_openssl-0.9.8ze.patch

and run script:

$ ./Install.sh

7. Go to the directory Vlv2TbltDevicePkg and let the building run:

$ cd ./Vlv2TbltDevicePkg
$ . Build_IFWI.sh MNW2 Release

My first building had an error by ending. I don't know why. Do it again:

$ cd ./Vlv2TbltDevicePkg
$ . Build_IFWI.sh MNW2 Release

Error again. Try again:

$ cd ./Vlv2TbltDevicePkg
$ . Build_IFWI.sh MNW2 Release

It has been build. Why I got the error, I don't know.

It's important that the compiler versions have to be the same and the building has to be on the plattform x64, if this configuration is chosen. For example, if the output gcc -v shows us that this is the version 4.8, then the variable has to have the proper value Toolchain = GCC48 while building. (The variable can be set in the file bld_vlv.sh)

Building of buildroot for minnowboard max.
1. let's download the buildroot distribution from the official website using any of methods avialible.
2. configure the distribution under the minnowboard max:

$ make minnowboard_max_defconfig

3. add the support of the file system of efi to the kernel to be able to obtain access to efi variables via /sys/firmware/efi/vars:

$ make linux-menuconfig

marke with an asterisk the options:
CONFIG_EFI_VARS
CONFIG_EFIVAR_FS

Adding the utility efibootmgr to buildroot.
1. Creating a folder named buildroot/package/efibootmgr
2. Creating a file named Config.in with the following content in the folder:

config BR2_PACKAGE_EFIBOOTMGR 
        bool "efibootmgr" 
        select BR2_PACKAGE_PCIUTILS 
        help 
          efibootmgr 

3. In this folder we create a file named efibootmgr.mk

EFIBOOTMGR_VERSION = 0.6.0 
EFIBOOTMGR_SOURCE = efibootmgr-$(EFIBOOTMGR_VERSION).tar.gz 
EFIBOOTMGR_SITE = http://linux.dell.com/efibootmgr/efibootmgr-0.6.0/ 
EFIBOOTMGR_INSTALL_STAGING = YES 


$(BUILD_DIR)/efibootmgr-$(EFIBOOTMGR_VERSION): $(BUILD_DIR)/efibootmgr-$(EFIBOOTMGR_VERSION)/.unpacked 
        cd $(BUILD_DIR)/efibootmgr-$(EFIBOOTMGR_VERSION); make 

define EFIBOOTMGR_INSTALL_STAGING_CMDS 
        cd $(BUILD_DIR)/efibootmgr-$(EFIBOOTMGR_VERSION); make 
        $(INSTALL) -D -m 0755 $(@D)/src/efibootmgr/efibootmgr $(STAGING_DIR)/usr/sbin/efibootmgr 
endef 

define EFIBOOTMGR_INSTALL_TARGET_CMDS 
        $(INSTALL) -D -m 0755 $(@D)/src/efibootmgr/efibootmgr $(TARGET_DIR)/usr/sbin/efibootmgr 
endef 

$(eval $(generic-package)) 

4. To the file named buildroot/package/Config.in we add a line:

source "package/efibootmgr/Config.in"

The utility efibootmgr makes possible to modify uefi variables while the kernel is downloaded from user space.

If the building is performed in the standard way via running make from the root of efibootmgr (i.e. outside the distribution buildroot or yocto), the following error can occured:

src/lib/efi.c:38:21: фатальная ошибка: pci/pci.h: Нет такого файла или каталога

The easiest way to fix the error is to use the compiler from yocto or buildroot (in the buildroot the compiler should be build with support of the respective options). To use a third-party compiler we should modify the Makefile as follows:

 RELEASE_DATE := "03-Jan-2008" 
  RELEASE_MAJOR := 0 
  RELEASE_MINOR := 5 
  RELEASE_SUBLEVEL := 4 
  RELEASE_EXTRALEVEL := 
  RELEASE_NAME := efibootmgr 
  RELEASE_STRING := $(RELEASE_NAME)-$(RELEASE_MAJOR).$(RELEASE_MINOR).$(RELEASE_SUBLEVEL)$(RELEASE_EXTRALEVEL) 

  CFLAGS = $(EXTRA_CFLAGS) -DEFIBOOTMGR_VERSION=\"$(RELEASE_MAJOR).$(RELEASE_MINOR).$(RELEASE_SUBLEVEL)$(RELEASE_EXTRAL 
EVEL)\" \ 
            -Wall -g -D_FILE_OFFSET_BITS=64 

  LDFLAGS += -lz 

  CC = /home/user1/MyWork/MB/poky/build/tmp/sysroots/x86_64-linux/usr/bin/x86_64-poky-linux/x86_64-poky-linux-gcc 

  MODULES := src 

Yocto building for Minnowboard Max.

1. Downloading the distribution yocto:

$ git clone -b dizzy git://git.yoctoproject.org/poky

2. Downloading intel recipes

$ cd poky
$ git clone -b dizzy git://git.yoctoproject.org/meta-intel

3. Configuring the environmental variables and create the directory where the project will be build using the command:

$ source oe-init-build-env

4. Adding the path to the directory meta-intel into the file conf/bblayers.conf

$ echo "BBLAYERS += \"/home/user1/MyWork/MB/poky/meta-intel\"" >> conf/bblayers.conf 

5. Wrining of building target:

echo "MACHINE = \"intel-corei7-64\"" >> conf/local.conf

6. Run the building.
It can be done using the utility hob:

$ hob

or using bitbake:

$ bitbake core-image-minimal

Starting of uefi in Qemu

For uefi debugging we use qemu. What shell we do to run uefi in qemu:
1. go to the folder OvmfPkg and run build.sh
2. after succesfull building we can see a folder with the files:
Build/OvmfX64/DEBUG_GCC48/FV
The most inportant for us is the file OVMF.fd - this is the file of bios for qemu.
3. For starting we should do the following:

$ qemu-system-x86_64 -bios ./OVMF.fd 
Could not open option rom 'vapic.bin': No such file or directory 
qemu-system-x86_64: pci_add_option_rom: failed to find romfile "vgabios-cirrus.bin" 
qemu-system-x86_64: pci_add_option_rom: failed to find romfile "pxe-rtl8139.rom"

Then a window appears where uefi will start. After starting we can work using shell uefi.

4. For Linux kernel starting using qemu we can use the file system and the kernel image got after yocto building.

The command to start the kernel using uefi in qemu looks like this:

qemu-system-x86_64 -bios ./OVMF.fd -cdrom ./fs.iso

where fs.iso is iso image resulting from target building of core-image-minimal in yocto.

If we want while starting qemu to save the log to a file then the starting of qemu will look like this:

 qemu-system-x86_64 -bios ./OVMF.fd -cdrom ./fs.iso -serial stdio

In this case, we use the following command to get this iso image:

#!/bin/sh

./mkisofs -A boot -V boot \
 -o /home/user1/MyWork/MB/tmp/qemu/fs.iso \
 -b isolinux/isolinux.bin \
 -c isolinux/boot.cat \
 -r -no-emul-boot -boot-load-size 4 -boot-info-table \
 -eltorito-alt-boot -eltorito-platform efi -b efi.img -no-emul-boot \
 -no-emul-boot /home/user1/MyWork/MB/tmp/qemu/iso/iso_dir

Although mkisofs utility is standard and is present in Ubuntu, but in this case, mkisofs is also taken from the yocto distribution (it can be found while searching in the poky/build/tmp/work). Starting of the standard utilitiy has somehow such an error at the end:

Invalid node — 'efi'.