public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: devel@edk2.groups.io, pintu.ping@gmail.com,
	edk2-devel <edk2-devel@lists.01.org>
Subject: Re: [edk2-devel] Booting UEFI with QEMU arm
Date: Tue, 4 May 2021 21:12:58 +0200	[thread overview]
Message-ID: <9ef009c3-7df7-3032-474a-f09437165809@redhat.com> (raw)
In-Reply-To: <CAOuPNLjOpUdWLe5uetna-fS9Oa2LTKRHcGve07krvQq+1Cc0Ww@mail.gmail.com>

On 05/04/21 13:32, Pintu Agarwal wrote:
> Hi,
> Is it possible to boot UEFI on a qemu arm based emulator?
> Since I am working from home and my uefi related work leads to device crash
> many times, which becomes painful for me.
> 
> So I wanted to do all my experiments on a qemu environment before I verify
> the final changes on a real hardware.
> So, I am just wondering is this possible?
> 
> According to my search I see its possible but still I could not find a
> proper way to do it.
> Please help me if someone has already tried it.
> 
> I already have the qemu-arm setup on my Linux/Ubuntu PC.

>From "qemu-system-arm", it seems like you really mean 32-bit ARM.

Yes, there is support for that in edk2.

Build:

$ git submodule update --init --force
$ . edksetup.sh
$ nice make -C "$EDK_TOOLS_PATH" -j $(getconf _NPROCESSORS_ONLN)
$ build -a ARM -b DEBUG -p ArmVirtPkg/ArmVirtQemu.dsc -t GCC5
$ for FD in QEMU_EFI.fd QEMU_VARS.fd; do
    cat -- \
        "$WORKSPACE/Build/ArmVirtQemu-ARM/DEBUG_GCC5/FV/$FD" \
        /dev/zero \
    | head -c 64m >| /tmp/"$FD.padded"
  done

Run:

$ if ! [ -e vars.fd ]; then
    cp /tmp/QEMU_VARS.fd.padded vars.fd
  fi
$ qemu-system-arm \
      -M virt \
      -cpu cortex-a15 \
      -m 1024 \
      -serial stdio \
      -drive if=pflash,unit=0,format=raw,readonly=on,file=/tmp/QEMU_EFI.fd.padded \
      -drive if=pflash,unit=1,format=raw,file=vars.fd \
      -device virtio-gpu-pci \
      -device id=xhci0,driver=qemu-xhci \
      -device usb-kbd,bus=xhci0.0 \
      -boot menu=on,splash-time=5000 \
      [...]

HTH
Laszlo

> 
> 
> Thanks,
> Pintu
> 
> 
> 
> 
> 
> 


      reply	other threads:[~2021-05-04 19:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-04 11:32 Booting UEFI with QEMU arm Pintu Agarwal
2021-05-04 19:12 ` Laszlo Ersek [this message]

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=9ef009c3-7df7-3032-474a-f09437165809@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