public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: devel@edk2.groups.io, harlydavidsen@gmail.com
Subject: Re: [edk2-devel] Help with debugging
Date: Wed, 23 Jun 2021 13:39:42 +0200	[thread overview]
Message-ID: <fc22133c-2691-e88d-05d5-520c95a176a2@redhat.com> (raw)
In-Reply-To: <CAJQtwF2aoF8qO2LB7pa76L2Pz8OTfMPVzuj8y_iA9afM1J2ySA@mail.gmail.com>

On 06/11/21 19:06, Ethin Probst wrote:
> Hey all,
> 
> So Leif and I have discussed this at length but I thought I'd reach
> out to all of you for more help.
> 
> I'm having a lot of trouble debugging my UEFI app. Here's how I do things:
> 
> - I load the app using uefi-run
> (https://github.com/Richard-W/uefi-run) like this (from the main EDK
> II directory): uefi-run -b Build/OvmfX64/DEBUG_GCC5/FV/OVMF.fd
> Build/OvmfX64/DEBUG_GCC5/X64/Shell.efi -- -M q35 -m 24G -usb -device
> qemu-xhci -device usb-audio,audiodev=audio -audiodev alsa,id=audio -s
> -debugcon file:../debug.log -global isa-debugcon.iobase=0x402
> -nographic
> Or:
> uefi-run -b Build/OvmfX64/DEBUG_GCC5/FV/OVMF.fd
> Build/OvmfX64/DEBUG_GCC5/X64/Shell.efi -- -M q35 -m 24G -usb -device
> qemu-xhci -device usb-audio,audiodev=audio -audiodev alsa,id=audio -s
> -debugcon stdio -global isa-debugcon.iobase=0x402

Side comment:

OVMF supports virtio-fs, and using virtio-fs could speed up your
develop/build/test cycle.

Assuming your UEFI application does not crash or hang (i.e., assuming it
exits cleanly and you can continue using the same UEFI shell session),
virtio-fs could be a small productivity boost for you, as you wouldn't
have to re-launch QEMU every time.

The idea is to build your application through some platform DSC file as
follows -- note that it need not be an OVMF DSC file, but it may be one,
if you prefer that:

  build -a X64 -b NOOPT -p MyAppPkg/MyApp.dsc -t GCC5 \
    -m MyAppPkg/MyApp/MyApp.inf

You don't need an FDF file for this, just grab the resultant "MyApp.efi"
binary from the Build directory.

Then copy "MyApp.efi" (on the host side) under the virtio-fs root
directory somewhere. When the copy operation completes (on the host
side), just switch your focus to the guest UEFI shell window, and you
can immediately execute the just-built application.

I find using virtio-fs by far the easiest with libvirt, but you can use
it from the bare QEMU command line, too.

https://libvirt.org/kbase/virtiofs.html
https://virtio-fs.gitlab.io/howto-qemu.html

This assumes that your development environment is Linux-based, as the
virtio-fs daemon (which runs in tandem with QEMU on the host) is Linux-only.

Thanks,
Laszlo


  parent reply	other threads:[~2021-06-23 11:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-11 17:06 Help with debugging Ethin Probst
2021-06-11 18:23 ` [edk2-devel] " Andrew Fish
2021-06-11 18:39   ` Ethin Probst
2021-06-11 19:42     ` Andrew Fish
2021-06-11 20:48       ` Ethin Probst
2021-06-11 20:58         ` Andrew Fish
2021-06-11 21:29           ` Ethin Probst
2021-06-11 23:09             ` Andrew Fish
2021-06-11 23:29               ` Ethin Probst
2021-06-11 23:48                 ` Andrew Fish
2021-06-12  4:47                   ` Ethin Probst
2021-06-12 19:03                     ` Andrew Fish
2021-06-23 11:39 ` Laszlo Ersek [this message]
2021-06-23 17:20   ` Ethin Probst

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=fc22133c-2691-e88d-05d5-520c95a176a2@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