From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) by mx.groups.io with SMTP id smtpd.web12.450.1624468822068214865 for ; Wed, 23 Jun 2021 10:20:22 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TxzzmWWq; spf=pass (domain: gmail.com, ip: 209.85.208.51, mailfrom: harlydavidsen@gmail.com) Received: by mail-ed1-f51.google.com with SMTP id t3so4517624edc.7 for ; Wed, 23 Jun 2021 10:20:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=hmFrS+RQbjjtwmM7nlrGE1/5R/hEh5+e1UPUVI4Li+U=; b=TxzzmWWqTq0MiGgaqA5pzjq7+5WV/sibUw22FQp/LvocKkabxDgaYHMUYWgyXtbn5u tcIu+c9r9CFceQC0CDtcbpZUBGivCjUAIKXP2r6v3TNGbH7H/jJQu7a44ZOTo6wRFmv8 TIdWaxvphm+eMWkAgHOVzrI40tGjhC8lvvhgaoYEEJSRuApAZCVL0m3KSbpO9brtJ/HB W854IjQdy4WvDDDDoB5H7Ef3Jpvso8KpkwGsqE52D+y6u72T56xjKm35n8YYLpOeKqWn 2ItximRuKG5024WYl7s5OIJwQ29w+f4ELFlg87Ef8Q2vxSNUyVM5bkEcOK6it9lmPJ6j /Aow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=hmFrS+RQbjjtwmM7nlrGE1/5R/hEh5+e1UPUVI4Li+U=; b=MZeFiNVf69aeRSL/TiVzRScAYt737+aAv8kDi4x+RNVBDYESBamBvtzTDgTTiV8GkF iA6QnGuO0kZxTqpvQsCJTy5rq+0rulf9Ezb253e0NacajiH1POH3jg/YPd2bVYIGlQS6 nVRBKQBPszAchOnm0KGuW1nUUr51Okr0prAn+JImOdVsZWL+3PxVKRRcZ4fhMh4/5sof kNO0SyD+N0L93UVUk30516TAvFoPaa44m9yJqrXUNOZJx9doRdtOCrd21NzZa7FMcV+v 4xNHLGIY+fVV5iwweayrcLO+XMD9FUxcLGETmclZYqtre3uxT7t3UeE8h4DN4s+EPTF1 5iZg== X-Gm-Message-State: AOAM5313sAdFBbSjrjFrOr7QGc1ty83xFgx9VfjFtezVFCaT4LjmLxJY /F72dmEsvI2mksdvQKLtWkxYiqC3YKLHBaF29Rs= X-Google-Smtp-Source: ABdhPJyUfxE9bDGIV6Yc1LmAyY9UzsghUUYUbD1lH1+U0tEh+wrzuWsdZua+hmJk1QeWVN0DXdYwjyOWQs4xhuwf4lk= X-Received: by 2002:a05:6402:188:: with SMTP id r8mr1131838edv.75.1624468820677; Wed, 23 Jun 2021 10:20:20 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a05:6400:5baa:0:0:0:0 with HTTP; Wed, 23 Jun 2021 10:20:20 -0700 (PDT) In-Reply-To: References: From: "Ethin Probst" Date: Wed, 23 Jun 2021 12:20:20 -0500 Message-ID: Subject: Re: [edk2-devel] Help with debugging To: Laszlo Ersek Cc: devel@edk2.groups.io Content-Type: text/plain; charset="UTF-8" Thanks for that tip! Unfortunately, the EFI shell (or, more accurately, the way that the EFI console handles input) makes the way I use it a bit difficult. Since I use a screen reader, I use -nographic with qemu, and the EFI console doesn't seem to work well with my terminal; if I for example type "help" things get to be jumbled up when scrolling. I don't know if that's a deficiency with my terminal or EFI though. But that does seem like a QOL improvement. On 6/23/21, Laszlo Ersek wrote: > 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 > > -- Signed, Ethin D. Probst