当前位置:网站首页>UEFI development learning 2 - running ovmf in QEMU

UEFI development learning 2 - running ovmf in QEMU

2022-07-05 07:51:00 Yang_ Winston

stay qemu Run in OVMF

install qemu

The first thing you need to do is Ubuntu Install in qemu, Use the following command to install .

sudo apt-get install qemu

Choose the right processor architecture

Be sure to align the processor architecture for OVMF with the proper processor archtecture of QEMU.

For the IA32 build of OVMF, there is a little more choice, since the X64 processor is also compatible with IA32. Therefore, with the IA32 build of OVMF, you can use the following commands: qemu, qemu-system-i386 or qemu-system-x86_64.

For the X64 build of OVMF, however, you can only use the qemu-system-x86_64 command.

by OVMF QEMU establish BIOS Catalog

  1. Create a directory , also cd Go to the directory .
bash$ mkdir ~/run-ovmf
bash$ cd ~/run-ovmf
  1. take OVMF.fd Copy files to this directory , And rename to bios.bin:
bash$ cp /path/to/ovmf/OVMF.fd bios.bin
  1. Create a directory as QEMU Hard disk image of
    (QEMU can turn the contents of a directory into a disk image ‘on-the-fly’):
bash$ mkdir hda-contents

Use OVMF function QEMU

The following three commands are similar , But the parameters are different .

bash$ qemu-system-x86_64 -L . -hda fat:hda-contents

Add -net none You can disable PXE start-up .

qemu-system-x86_64 -L . --bios ~/src/edk2/Build/OvmfX64/DEBUG_GCC5/FV/OVMF.fd -net none

I use the following command .

qemu-system-x86_64 -pflash bios.bin -hda fat:hda-contents -net none

 Insert picture description here

 Insert picture description here
Input exit You can quit
 Insert picture description here
Reference resources :How-to-build-OVMF
Last one :UEFI Developing learning 1 - Ubuntu18.04 build edk2 Environmental Science

原网站

版权声明
本文为[Yang_ Winston]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202140549119409.html