Unfortunately I still cannot add Chinese Simplified Keyboard Support to my Ubuntu. Since the article is never attractive, nor do I expect any other subscribers except for myself living in the future, English is a choice.
(1) Overview
Here we want to test the TPM support of UEFI in QEMU environment.
Steps to complete include:
- Setup a fat formated blk IO devices and mount it to host machine.
- Modify the existent OVMF Pkg Description file to add TPM support testing file / Or just include the testing file in formated blk IO device, the evaluation process will be conducted in UEFL Shell.
- Use QEMU to load OVMF and virtual hardware created
(2) Formating the virtual image and map it to /dev/
create the image first
qemu-img create -f qcow2 ./test.img 30G
// alternative: dd if=/dev/zero of=test.img bs=1M count=128
// format the file system of the image
mkfs.ext3 -q test.img
// alternative: mkfs -t vfat test.img
// Map the image to loop device && mount the formated image to /mnt/
sudo mount -o loop test.img /mnt/
// Display all file systems. The image should have been mounted
df -h
// To unmount and remove the device. You can also use fdisk to partition
umount /mnt/
kpartx -dv /dev/loop0
For some more details please see
(3) Build the TPM testing Application in EDKII
Here we use the open-source Pkg of UEFI utility for testing purpose
git clone https://github.com/fpmurphy/UEFI-Utilities-2016.git
Copy the MyApps Pkg to EDKII root path. Then biuld MyApps
build -t GCC5 -p MyApps/MyApps.dsc -b RELEASE -a IA32 -a X64
sudo cp Build/MyApps/RELEASE_GCC5/X64/ShowPCIx.efi /mnt/
(4) Run the OVFM in QEMU with virtual hardware
// enter the UEFI Shell without iPXE Stage
sudo qemu-system-x86_64 -bios Build/Ovmf3264/RELEASE_GCC5/FV/OVMF.fd -hda /dev/loop1 -net none
Call TPM's Random Number Generator
It seems that something goes wrong. Even the simplest HelloWord.efi cannot be executed in the UEFI Shell.
We will try to build OVFM with secure mode on to enable the instace of EFI_TCG_PROTOCOL.
网友评论