public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: spam collector <spamcollector@cableone.net>
Cc: edk2-devel@ml01.01.org
Subject: Re: OVMF.fd and placement of EfiBootServicesData
Date: Wed, 5 Oct 2016 17:28:46 +0200	[thread overview]
Message-ID: <280e3403-1821-396e-5243-54b770dcb01a@redhat.com> (raw)
In-Reply-To: <1410853764.96270806.1475635626572.JavaMail.zimbra@cableone.net>

On 10/05/16 04:47, spam collector wrote:
> 
> ----- Original Message -----
>> From: "Laszlo Ersek" <lersek@redhat.com>
>> To: "spam collector" <spamcollector@cableone.net>
>> Cc: edk2-devel@ml01.01.org
>> Sent: Tuesday, October 4, 2016 10:22:34 AM
>> Subject: Re: [edk2] OVMF.fd and placement of EfiBootServicesData

>> * The first stage improvement is the following command line:
>>
>>   qemu-system-x86_64 -pflash OVMF.fd
> 
> This did not work either with or without the NvVars file present.

I think I'll need a more complete issue riport then -- what is your
exact QEMU command line, and what OVMF binary are you using?

>> * The second stage improvement is the following command line:
>>
>>   # create the virtual machine's private variable store from the
>>   # pristine variable store template, if the former doesn't exist yet,
>>   # or has been lost for some reason
>>   if ! [ -e GUEST_1_VARS.fd ]; then
>>     cp OVMF_VARS.fd GUEST_1_VARS.fd
>>   fi
>>
>>   qemu-system-x86_64 \
>>     -drive if=pflash,format=raw,unit=0,readonly,file=OVMF_CODE.fd \
>>     -drive if=pflash,format=raw,unit=1,file=GUEST_1_VARS.fd \
>>     ...
>>
>> In this case, the OVMF_CODE.fd and OVMF_VARS.fd are used separately.
>> (You can find both files under the Build directory; plus Gerd Hoffmann's
>> RPM files <https://www.kraxel.org/repos/> also package them.)
> 
> For the life of me I could not find any directory called "Build".

The Build directory exists in the source edk2 tree, if you build the
firmware yourself.

>  I did find a few RPM files and one of them contained:
>   OVMF_CODE-pure-efi.fd
>  and
>   OVMF_VARS-pure-efi.fd

Yes, they are from Gerd's "edk2.git-ovmf-ia32" package (since you
mention IA32), from <http://www.kraxel.org/repos/>, and they are
recommended to use.

> However, no matter the emulation (32- or 64-bit), neither worked and
> would get as far as printing the '.' just before the 
>   .FLOPPY failed
>   .CD-ROM failed
>   etc.
> lines and go no further.

These messages mean the following: you are running QEMU in a default
configuration, with a default NIC, a default floppy, a default CD-ROM,
and so on. OVMF automatically generates boot options for these (in some
unspecified order), and then tries to boot those options. Specifically
the dots with the long delay mean that OVMF is trying to PXE boot from
your virtual NIC.

There are two ways around this:

- First, if you have a dedicated device you want to boot off of, use
  the "bootindex" property I mentioned earlier.
  - Specifically, if you want to boot the UEFI shell like this, then
    use "/usr/share/edk2.git/ovmf-ia32/UefiShell.iso" with an ide-cd or
    scsi-cd device.

- Second, you can pass "-nodefaults" to QEMU. This option will prevent
  the automatic creation of the NIC, the floppy, the CD-ROM -- and a
  lot more actually, such as keyboard, mouse, VGA too --; in turn OVMF
  should not create boot options for these devices either, and should
  drop you directly to the shell.

  Assuming of course that your firmware binary includes the shell in
  the first place. If it doesn't, then you can only use "UefiShell.iso".

I recommend trying the following (32-bit command line), with Gerd's package:

  FW_BIN=/usr/share/edk2.git/ovmf-ia32/OVMF_CODE-pure-efi.fd
  VARS_TMPL=/usr/share/edk2.git/ovmf-ia32/OVMF_VARS-pure-efi.fd
  VARS=myvars.fd
  SHELL_ISO=/usr/share/edk2.git/ovmf-ia32/UefiShell.iso
  if ! [ -e "$VARS" ]; then
    cp -v -- "$VARS_TMPL" "$VARS"
  fi

  qemu-system-i386 \
    -m 2048 \
    -machine accel=kvm \
    \
    -drive if=pflash,format=raw,unit=0,readonly,file="$FW_BIN" \
    -drive if=pflash,format=raw,unit=1,file="$VARS" \
    \
    -device virtio-scsi-pci,id=scsi0 \
    -drive if=none,format=raw,readonly,file="$SHELL_ISO",id=shell \
    -device scsi-cd,bus=scsi0.0,drive=shell,bootindex=1 \
    \
    -chardev file,id=debugfile,path=ovmf.log \
    -device isa-debugcon,iobase=0x402,chardev=debugfile

This will boot the shell for you, and even save the OVMF debug log in
the file "ovmf.log".

> would you please specify a specific URL that contains the two files
> you speak of, whether it be a listing of those files, a .gz file, or
> even a .rpm file.

If you GNU/Linux distro of choice is RPM-based, simply follow the
instrutions at <https://www.kraxel.org/repos/>.

Otherwise, download the "edk2.git-ovmf-ia32" or "edk2.git-ovmf-x64" RPM
file (as needed) from <https://www.kraxel.org/repos/jenkins/edk2/>, and
extract it with:

  rpm2cpio FILENAME | pax -r -v

The extracted files you want are:

  usr/share/edk2.git/ovmf-*/OVMF_CODE-pure-efi.fd
  usr/share/edk2.git/ovmf-*/OVMF_VARS-pure-efi.fd
  usr/share/edk2.git/ovmf-*/UefiShell.iso

Thanks
Laszlo



  reply	other threads:[~2016-10-05 15:28 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1063482308.87469389.1475464272414.JavaMail.zimbra@cableone.net>
2016-10-03  3:16 ` OVMF.fd and placement of EfiBootServicesData spam collector
2016-10-03  9:42   ` Laszlo Ersek
2016-10-04  2:45     ` spam collector
2016-10-04  7:52       ` Laszlo Ersek
2016-10-04 16:39         ` spam collector
2016-10-04 17:22           ` Laszlo Ersek
2016-10-05  2:47             ` spam collector
2016-10-05 15:28               ` Laszlo Ersek [this message]
2016-10-06  3:05                 ` spam collector
2016-10-06  7:39                   ` Laszlo Ersek
2016-10-07  3:11                     ` spam collector
2016-10-07 15:08                       ` Laszlo Ersek
2016-10-06  5:45                 ` spam collector
2016-10-06  7:47                   ` Laszlo Ersek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=280e3403-1821-396e-5243-54b770dcb01a@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox