From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from rn-mailsvcp-ppex-lapp35.apple.com (rn-mailsvcp-ppex-lapp35.apple.com [17.179.253.44]) by mx.groups.io with SMTP id smtpd.web09.4164.1667511292961540762 for ; Thu, 03 Nov 2022 14:34:53 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@apple.com header.s=20180706 header.b=cw9cMasq; spf=pass (domain: apple.com, ip: 17.179.253.44, mailfrom: afish@apple.com) Received: from pps.filterd (rn-mailsvcp-ppex-lapp35.rno.apple.com [127.0.0.1]) by rn-mailsvcp-ppex-lapp35.rno.apple.com (8.16.1.2/8.16.1.2) with SMTP id 2A3LXfwo031459; Thu, 3 Nov 2022 14:34:52 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apple.com; h=from : message-id : content-type : mime-version : subject : date : in-reply-to : cc : to : references; s=20180706; bh=kt8iFry0Pc/f4+WZvcxlke6L5aGnK0xc11gfpWs7zCU=; b=cw9cMasqYXYkjVaELxT+yVTlR7p5JhB2itEN/MO62gANYc4M1V0m3Bdi7KDNaxxiDLl/ E/xI2NkdQj9+uFQ2Cu7ylaz3P7VsFuROgQBByOLN9Rcd+E9j4xu9o5IDxADBYjfJdTof jBLvozYwx8FTiDqyGkTDH+KLZzw6lQPBmhhKgTfTW+dIYLJPnK3JXI/vPifX8H/sCeKI dga01EQEFgk0sDbaTPwY2vP9Ade2g/PklA3dnLgzUZUJSJ7Nb/r5cvmwoCpPIFNcdZHd guCoMVre4RuPpH4gJyl05WCrs9q70T+L5yJ8jiT34uMYLrMdRRZr+Za7BBK2nVOp/KGb cw== Received: from rn-mailsvcp-mta-lapp01.rno.apple.com (rn-mailsvcp-mta-lapp01.rno.apple.com [10.225.203.149]) by rn-mailsvcp-ppex-lapp35.rno.apple.com with ESMTP id 3kgyq72dyv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Thu, 03 Nov 2022 14:34:52 -0700 Received: from rn-mailsvcp-mmp-lapp03.rno.apple.com (rn-mailsvcp-mmp-lapp03.rno.apple.com [17.179.253.16]) by rn-mailsvcp-mta-lapp01.rno.apple.com (Oracle Communications Messaging Server 8.1.0.20.20220923 64bit (built Sep 23 2022)) with ESMTPS id <0RKS00XRBJY40260@rn-mailsvcp-mta-lapp01.rno.apple.com>; Thu, 03 Nov 2022 14:34:52 -0700 (PDT) Received: from process_milters-daemon.rn-mailsvcp-mmp-lapp03.rno.apple.com by rn-mailsvcp-mmp-lapp03.rno.apple.com (Oracle Communications Messaging Server 8.1.0.19.20220711 64bit (built Jul 11 2022)) id <0RKS01000JXAVY00@rn-mailsvcp-mmp-lapp03.rno.apple.com>; Thu, 03 Nov 2022 14:34:52 -0700 (PDT) X-Va-A: X-Va-T-CD: cd4b4dc33b90801c889e28fd18bb2167 X-Va-E-CD: ec9cc94c51167e28e069118bb1fce29d X-Va-R-CD: ce3ffbac7fc5b1e5f0bf2f56a281a21d X-Va-CD: 0 X-Va-ID: 695b5040-68f5-4a4a-a3c7-cd6d704423fb X-V-A: X-V-T-CD: cd4b4dc33b90801c889e28fd18bb2167 X-V-E-CD: ec9cc94c51167e28e069118bb1fce29d X-V-R-CD: ce3ffbac7fc5b1e5f0bf2f56a281a21d X-V-CD: 0 X-V-ID: 85ec9ba7-caa4-4ac6-a52d-a0a931c5cd34 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.545,18.0.895 definitions=2022-11-03_04:2022-11-03,2022-11-03 signatures=0 Received: from smtpclient.apple (unknown [17.11.22.82]) by rn-mailsvcp-mmp-lapp03.rno.apple.com (Oracle Communications Messaging Server 8.1.0.19.20220711 64bit (built Jul 11 2022)) with ESMTPSA id <0RKS00106JY35P00@rn-mailsvcp-mmp-lapp03.rno.apple.com>; Thu, 03 Nov 2022 14:34:51 -0700 (PDT) From: "Andrew Fish" Message-id: MIME-version: 1.0 (Mac OS X Mail 16.0 \(3731.200.22\)) Subject: Re: [edk2-devel] How to add a DXE driver to an OVMF image? Date: Thu, 03 Nov 2022 14:34:40 -0700 In-reply-to: <4722.1667502663480435497@groups.io> Cc: Pedro Falcato To: edk2-devel-groups-io , d.meneses@softi9.pt References: <4722.1667502663480435497@groups.io> X-Mailer: Apple Mail (2.3731.200.22) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.545,18.0.895 definitions=2022-11-03_04:2022-11-03,2022-11-03 signatures=0 Content-type: multipart/alternative; boundary="Apple-Mail=_F5062605-4B6F-4A5B-BA88-CEE79351C61C" --Apple-Mail=_F5062605-4B6F-4A5B-BA88-CEE79351C61C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Nov 3, 2022, at 12:11 PM, d.meneses via groups.io wrote: >=20 > Yes I also believe I'm threading a XY problem.=20 >=20 > Let's simplify my learning and set the goal to: add an UEFI application t= o OVMF so that it runs natively on startup. >=20 > Does this make more sense? >=20 > I followed the same process and I can use UEFITool to confirm there's an = UefiApplication inside the OVMF image. >=20 > How can I make it run? Do you need to run it from FLASH? Or do you just want to run it?=20 What I usually do with QEMU is pass -hda fat:rw:Build/OvmfX64/DEBUG_XCODE5/= X64 to mount a directory on my system in QEMU. This should show up in the U= EFI Shell as FS0: if you don=E2=80=99t have any other disks. The path is th= e build output, so you need to match what you built. So DEBUG_GCC??? Vs DEB= UG_XCODE, as this path encodes the build target, compiler, etc. Then when you boot to the UEFI Shell you just need to mount the disk and ru= n your app.=20 Fs0: MyApp.efi You can also redirect the text output of your app to a file, and since fs0:= is just your build directory you can get the output out of the VM.=20 >>From the UEFI Shell you can `reset -s` to shut down the VM. If you place a startup.nsh the UEFI Shell command should run those commands= when launched.=20 It is also possible to make a FAT32 disk image and boot your app directly, = just like an OS loader[1]. Just copy your app to /EFI/BOOT/BOOTx64.EFI in t= he disk image and mount the disk image from the QEMU command line. [1] https://uefi.org/specs/UEFI/2.10/03_Boot_Manager.html#removable-media-b= oot-behavior Thanks, Andrew Fish >=20 --Apple-Mail=_F5062605-4B6F-4A5B-BA88-CEE79351C61C Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On Nov 3, 2022, at 12:11 PM, d.meneses via groups.io <d.menes= es=3Dsofti9.pt@groups.io> wrote:

Yes I also believe I'm threading a XY problem. 

Let'= s simplify my learning and set the goal to: add an UEFI application to OVMF= so that it runs natively on startup.

Does this make more sense?
=
I followed the same process and I can use UEFITool to confirm there's a= n UefiApplication inside the OVMF image.

How can I make it run?

Do you need to run it from FLASH? O= r do you just want to run it? 

What I usually= do with QEMU is pass = -hda fat:rw:Build/OvmfX64/DEBUG_XCODE5/X64 to mount a directory= on my system in QEMU. This should show up in the UEFI Shell as FS0: if you= don=E2=80=99t have any other disks. The path is the build output, so you n= eed to match what you built. So DEBUG_GCC??? Vs DEBUG_XCODE, as this path e= ncodes the build target, compiler, etc.

Then when = you boot to the UEFI Shell you just need to mount the disk and run your app= . 

Fs0:
MyApp.efi

You can also redirect the text output of your app to a file, and si= nce fs0: is just your build directory you can get the output out of the VM.=  

From the UEFI Shell you can `reset -s` to s= hut down the VM.

If you place a startup.nsh the UE= FI Shell command should run those commands when launched. 
<= br>
It is also possible to make a FAT32 disk image and boot your = app directly, just like an OS loader[1]. Just copy your app to /EFI/BOOT/BO= OTx64.EFI in the disk image and mount the disk image from the QEMU command = line.


=20

--Apple-Mail=_F5062605-4B6F-4A5B-BA88-CEE79351C61C--