Re: [edk2] [PATCH] OvmfPkg: Add RAM disk support

2016-03-30 Thread Paulo Alcantara
Hi Laszlo,

On Wed, Mar 30, 2016 at 6:33 AM, Laszlo Ersek  wrote:
> On 03/22/16 01:13, Paulo Alcantara wrote:
>> Hi Jordan,
>>
>> On Mon, Mar 21, 2016 at 8:24 PM, Jordan Justen
>>  wrote:
>>> On 2016-03-21 01:02:53, Laszlo Ersek wrote:
 On 03/20/16 17:58, Paulo Alcantara wrote:
> This patch adds RamDiskDxe driver to OVMF through a new introduced flag
> "RAMDISK_SUPPORT_ENABLE" which is disabled by default and may be enabled
> with -DRAMDISK_SUPPORT_ENABLE=TRUE at build time.
>
> Cc: Jordan Justen 
> Cc: Laszlo Ersek 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Paulo Alcantara 
> ---
>  OvmfPkg/OvmfPkgIa32.dsc| 6 +-
>  OvmfPkg/OvmfPkgIa32.fdf| 3 +++
>  OvmfPkg/OvmfPkgIa32X64.dsc | 4 
>  OvmfPkg/OvmfPkgIa32X64.fdf | 3 +++
>  OvmfPkg/OvmfPkgX64.dsc | 6 +-
>  OvmfPkg/OvmfPkgX64.fdf | 3 +++
>  6 files changed, 23 insertions(+), 2 deletions(-)

 I think it should be fine to enable this unconditionally. Jordan, what
 do you think?

>>>
>>> So, this driver won't really take much action until the setup browser
>>> is used to configure a ram disk?
>>>
>>> If so, it seems reasonable to include it by default.
>>>
>>> Does the setup browser actually have support for EFI_RAM_DISK_PROTOCOL
>>> yet? (git grep EFI_RAM_DISK_PROTOCOL is a bit sparse)
>>
>> I actually don't know whether the setup browser supports it or not,
>> but the RAM disk support is useful in many contexts -- either it's
>> being used by an application or driver. I added a flag to it because
>> it seems like an optional feature to me rather than something required
>> to boot a platform. Yet, it's working perfectly fine and solving my
>> problems :-)
>
> I think that Ray's info in
> 
> also supports the idea that the RAM disk driver should be included in
> OVMF unconditionally. So v2 should be submitted like that.

OK.

>
> However, since booting off of a RAM disk is not supported by
> IntelFrameworkModulePkg BDS, I assume your problems that this patch
> solves do not include booting off of a RAM disk. In that case, can you
> please elaborate on your use case in the v2 commit message? I prefer to
> see concrete justification when a feature is enabled.

OK.

>
> Also, can you post the patch from your HP email (the one in the S-o-b)?

OK. I'll send a v2 shortly.

Thanks,

Paulo
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] OvmfPkg: Add RAM disk support

2016-03-30 Thread Laszlo Ersek
On 03/22/16 01:13, Paulo Alcantara wrote:
> Hi Jordan,
> 
> On Mon, Mar 21, 2016 at 8:24 PM, Jordan Justen
>  wrote:
>> On 2016-03-21 01:02:53, Laszlo Ersek wrote:
>>> On 03/20/16 17:58, Paulo Alcantara wrote:
 This patch adds RamDiskDxe driver to OVMF through a new introduced flag
 "RAMDISK_SUPPORT_ENABLE" which is disabled by default and may be enabled
 with -DRAMDISK_SUPPORT_ENABLE=TRUE at build time.

 Cc: Jordan Justen 
 Cc: Laszlo Ersek 
 Contributed-under: TianoCore Contribution Agreement 1.0
 Signed-off-by: Paulo Alcantara 
 ---
  OvmfPkg/OvmfPkgIa32.dsc| 6 +-
  OvmfPkg/OvmfPkgIa32.fdf| 3 +++
  OvmfPkg/OvmfPkgIa32X64.dsc | 4 
  OvmfPkg/OvmfPkgIa32X64.fdf | 3 +++
  OvmfPkg/OvmfPkgX64.dsc | 6 +-
  OvmfPkg/OvmfPkgX64.fdf | 3 +++
  6 files changed, 23 insertions(+), 2 deletions(-)
>>>
>>> I think it should be fine to enable this unconditionally. Jordan, what
>>> do you think?
>>>
>>
>> So, this driver won't really take much action until the setup browser
>> is used to configure a ram disk?
>>
>> If so, it seems reasonable to include it by default.
>>
>> Does the setup browser actually have support for EFI_RAM_DISK_PROTOCOL
>> yet? (git grep EFI_RAM_DISK_PROTOCOL is a bit sparse)
> 
> I actually don't know whether the setup browser supports it or not,
> but the RAM disk support is useful in many contexts -- either it's
> being used by an application or driver. I added a flag to it because
> it seems like an optional feature to me rather than something required
> to boot a platform. Yet, it's working perfectly fine and solving my
> problems :-)

I think that Ray's info in

also supports the idea that the RAM disk driver should be included in
OVMF unconditionally. So v2 should be submitted like that.

However, since booting off of a RAM disk is not supported by
IntelFrameworkModulePkg BDS, I assume your problems that this patch
solves do not include booting off of a RAM disk. In that case, can you
please elaborate on your use case in the v2 commit message? I prefer to
see concrete justification when a feature is enabled.

Also, can you post the patch from your HP email (the one in the S-o-b)?

Thanks
Laszlo
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] OvmfPkg: Add RAM disk support

2016-03-21 Thread Dong, Eric
If the driver provides menus in setup, it only need to install the HII packages 
through HiiAddPackages and provide Config Access Protocol to let setup browser 
extract/route data from/to the driver. setup browser don't care any other 
information in the driver.  RAM disk driver already provide them, so I think it 
can be supported by setup browser.

Thanks,
Eric
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Paulo 
> Alcantara
> Sent: Tuesday, March 22, 2016 8:14 AM
> To: Justen, Jordan L
> Cc: edk2-devel@lists.01.org; Laszlo Ersek
> Subject: Re: [edk2] [PATCH] OvmfPkg: Add RAM disk support
> 
> Hi Jordan,
> 
> On Mon, Mar 21, 2016 at 8:24 PM, Jordan Justen
> <jordan.l.jus...@intel.com> wrote:
> > On 2016-03-21 01:02:53, Laszlo Ersek wrote:
> >> On 03/20/16 17:58, Paulo Alcantara wrote:
> >> > This patch adds RamDiskDxe driver to OVMF through a new introduced flag
> >> > "RAMDISK_SUPPORT_ENABLE" which is disabled by default and may be enabled
> >> > with -DRAMDISK_SUPPORT_ENABLE=TRUE at build time.
> >> >
> >> > Cc: Jordan Justen <jordan.l.jus...@intel.com>
> >> > Cc: Laszlo Ersek <ler...@redhat.com>
> >> > Contributed-under: TianoCore Contribution Agreement 1.0
> >> > Signed-off-by: Paulo Alcantara <paulo.alc.cavalca...@hp.com>
> >> > ---
> >> >  OvmfPkg/OvmfPkgIa32.dsc| 6 +-
> >> >  OvmfPkg/OvmfPkgIa32.fdf| 3 +++
> >> >  OvmfPkg/OvmfPkgIa32X64.dsc | 4 
> >> >  OvmfPkg/OvmfPkgIa32X64.fdf | 3 +++
> >> >  OvmfPkg/OvmfPkgX64.dsc | 6 +-
> >> >  OvmfPkg/OvmfPkgX64.fdf | 3 +++
> >> >  6 files changed, 23 insertions(+), 2 deletions(-)
> >>
> >> I think it should be fine to enable this unconditionally. Jordan, what
> >> do you think?
> >>
> >
> > So, this driver won't really take much action until the setup browser
> > is used to configure a ram disk?
> >
> > If so, it seems reasonable to include it by default.
> >
> > Does the setup browser actually have support for EFI_RAM_DISK_PROTOCOL
> > yet? (git grep EFI_RAM_DISK_PROTOCOL is a bit sparse)
> 
> I actually don't know whether the setup browser supports it or not,
> but the RAM disk support is useful in many contexts -- either it's
> being used by an application or driver. I added a flag to it because
> it seems like an optional feature to me rather than something required
> to boot a platform. Yet, it's working perfectly fine and solving my
> problems :-)
> 
> Paulo
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] OvmfPkg: Add RAM disk support

2016-03-21 Thread Paulo Alcantara
Hi Jordan,

On Mon, Mar 21, 2016 at 8:24 PM, Jordan Justen
 wrote:
> On 2016-03-21 01:02:53, Laszlo Ersek wrote:
>> On 03/20/16 17:58, Paulo Alcantara wrote:
>> > This patch adds RamDiskDxe driver to OVMF through a new introduced flag
>> > "RAMDISK_SUPPORT_ENABLE" which is disabled by default and may be enabled
>> > with -DRAMDISK_SUPPORT_ENABLE=TRUE at build time.
>> >
>> > Cc: Jordan Justen 
>> > Cc: Laszlo Ersek 
>> > Contributed-under: TianoCore Contribution Agreement 1.0
>> > Signed-off-by: Paulo Alcantara 
>> > ---
>> >  OvmfPkg/OvmfPkgIa32.dsc| 6 +-
>> >  OvmfPkg/OvmfPkgIa32.fdf| 3 +++
>> >  OvmfPkg/OvmfPkgIa32X64.dsc | 4 
>> >  OvmfPkg/OvmfPkgIa32X64.fdf | 3 +++
>> >  OvmfPkg/OvmfPkgX64.dsc | 6 +-
>> >  OvmfPkg/OvmfPkgX64.fdf | 3 +++
>> >  6 files changed, 23 insertions(+), 2 deletions(-)
>>
>> I think it should be fine to enable this unconditionally. Jordan, what
>> do you think?
>>
>
> So, this driver won't really take much action until the setup browser
> is used to configure a ram disk?
>
> If so, it seems reasonable to include it by default.
>
> Does the setup browser actually have support for EFI_RAM_DISK_PROTOCOL
> yet? (git grep EFI_RAM_DISK_PROTOCOL is a bit sparse)

I actually don't know whether the setup browser supports it or not,
but the RAM disk support is useful in many contexts -- either it's
being used by an application or driver. I added a flag to it because
it seems like an optional feature to me rather than something required
to boot a platform. Yet, it's working perfectly fine and solving my
problems :-)

Paulo
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] OvmfPkg: Add RAM disk support

2016-03-21 Thread Laszlo Ersek
On 03/22/16 00:24, Jordan Justen wrote:
> On 2016-03-21 01:02:53, Laszlo Ersek wrote:
>> On 03/20/16 17:58, Paulo Alcantara wrote:
>>> This patch adds RamDiskDxe driver to OVMF through a new introduced flag
>>> "RAMDISK_SUPPORT_ENABLE" which is disabled by default and may be enabled
>>> with -DRAMDISK_SUPPORT_ENABLE=TRUE at build time.
>>>
>>> Cc: Jordan Justen 
>>> Cc: Laszlo Ersek 
>>> Contributed-under: TianoCore Contribution Agreement 1.0
>>> Signed-off-by: Paulo Alcantara 
>>> ---
>>>  OvmfPkg/OvmfPkgIa32.dsc| 6 +-
>>>  OvmfPkg/OvmfPkgIa32.fdf| 3 +++
>>>  OvmfPkg/OvmfPkgIa32X64.dsc | 4 
>>>  OvmfPkg/OvmfPkgIa32X64.fdf | 3 +++
>>>  OvmfPkg/OvmfPkgX64.dsc | 6 +-
>>>  OvmfPkg/OvmfPkgX64.fdf | 3 +++
>>>  6 files changed, 23 insertions(+), 2 deletions(-)
>>
>> I think it should be fine to enable this unconditionally. Jordan, what
>> do you think?
>>
> 
> So, this driver won't really take much action until the setup browser
> is used to configure a ram disk?
> 
> If so, it seems reasonable to include it by default.
> 
> Does the setup browser actually have support for EFI_RAM_DISK_PROTOCOL
> yet? (git grep EFI_RAM_DISK_PROTOCOL is a bit sparse)

As far as I understand, the setup browser doesn't need to be
specifically aware. The RAM disk driver installs an HII form that lets
the user configure stuff, and the callback function in the RAM disk
driver creates the RAM disks. See RamDiskCallback() -->
HiiCreateRamDisk() --> RamDiskRegister().

Thanks
Laszlo
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] OvmfPkg: Add RAM disk support

2016-03-21 Thread Jordan Justen
On 2016-03-21 01:02:53, Laszlo Ersek wrote:
> On 03/20/16 17:58, Paulo Alcantara wrote:
> > This patch adds RamDiskDxe driver to OVMF through a new introduced flag
> > "RAMDISK_SUPPORT_ENABLE" which is disabled by default and may be enabled
> > with -DRAMDISK_SUPPORT_ENABLE=TRUE at build time.
> > 
> > Cc: Jordan Justen 
> > Cc: Laszlo Ersek 
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Paulo Alcantara 
> > ---
> >  OvmfPkg/OvmfPkgIa32.dsc| 6 +-
> >  OvmfPkg/OvmfPkgIa32.fdf| 3 +++
> >  OvmfPkg/OvmfPkgIa32X64.dsc | 4 
> >  OvmfPkg/OvmfPkgIa32X64.fdf | 3 +++
> >  OvmfPkg/OvmfPkgX64.dsc | 6 +-
> >  OvmfPkg/OvmfPkgX64.fdf | 3 +++
> >  6 files changed, 23 insertions(+), 2 deletions(-)
> 
> I think it should be fine to enable this unconditionally. Jordan, what
> do you think?
> 

So, this driver won't really take much action until the setup browser
is used to configure a ram disk?

If so, it seems reasonable to include it by default.

Does the setup browser actually have support for EFI_RAM_DISK_PROTOCOL
yet? (git grep EFI_RAM_DISK_PROTOCOL is a bit sparse)

-Jordan
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] OvmfPkg: Add RAM disk support

2016-03-21 Thread Laszlo Ersek
On 03/20/16 17:58, Paulo Alcantara wrote:
> This patch adds RamDiskDxe driver to OVMF through a new introduced flag
> "RAMDISK_SUPPORT_ENABLE" which is disabled by default and may be enabled
> with -DRAMDISK_SUPPORT_ENABLE=TRUE at build time.
> 
> Cc: Jordan Justen 
> Cc: Laszlo Ersek 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Paulo Alcantara 
> ---
>  OvmfPkg/OvmfPkgIa32.dsc| 6 +-
>  OvmfPkg/OvmfPkgIa32.fdf| 3 +++
>  OvmfPkg/OvmfPkgIa32X64.dsc | 4 
>  OvmfPkg/OvmfPkgIa32X64.fdf | 3 +++
>  OvmfPkg/OvmfPkgX64.dsc | 6 +-
>  OvmfPkg/OvmfPkgX64.fdf | 3 +++
>  6 files changed, 23 insertions(+), 2 deletions(-)

I think it should be fine to enable this unconditionally. Jordan, what
do you think?

Laszlo

> diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
> index 2635992..25b3722 100644
> --- a/OvmfPkg/OvmfPkgIa32.dsc
> +++ b/OvmfPkg/OvmfPkgIa32.dsc
> @@ -38,6 +38,7 @@
>DEFINE HTTP_BOOT_ENABLE= FALSE
>DEFINE SMM_REQUIRE = FALSE
>DEFINE USE_OLD_PCI_HOST= FALSE
> +  DEFINE RAMDISK_SUPPORT_ENABLE  = FALSE
>  
>  [BuildOptions]
>GCC:*_UNIXGCC_*_CC_FLAGS = -DMDEPKG_NDEBUG
> @@ -293,7 +294,7 @@
>DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf
>  !endif
>QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf
> -!if $(SECURE_BOOT_ENABLE) == TRUE
> +!if $(SECURE_BOOT_ENABLE) == TRUE OR $(RAMDISK_SUPPORT_ENABLE) == TRUE
>FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
>  !endif
>  !if $(USE_OLD_PCI_HOST) == FALSE
> @@ -603,6 +604,9 @@
>MdeModulePkg/Universal/PrintDxe/PrintDxe.inf
>MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
>MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
> +!if $(RAMDISK_SUPPORT_ENABLE) == TRUE
> +  MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf
> +!endif
>MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
>MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf
>MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
> diff --git a/OvmfPkg/OvmfPkgIa32.fdf b/OvmfPkg/OvmfPkgIa32.fdf
> index 2ef6206..ef493c7 100644
> --- a/OvmfPkg/OvmfPkgIa32.fdf
> +++ b/OvmfPkg/OvmfPkgIa32.fdf
> @@ -242,6 +242,9 @@ INF  
> MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf
>  INF  MdeModulePkg/Universal/PrintDxe/PrintDxe.inf
>  INF  MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
>  INF  MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
> +!if $(RAMDISK_SUPPORT_ENABLE) == TRUE
> +  INF  MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf
> +!endif
>  INF  MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
>  INF  MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf
>  INF  MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
> diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
> index e9ffcb4..e2f2ec4 100644
> --- a/OvmfPkg/OvmfPkgIa32X64.dsc
> +++ b/OvmfPkg/OvmfPkgIa32X64.dsc
> @@ -38,6 +38,7 @@
>DEFINE HTTP_BOOT_ENABLE= FALSE
>DEFINE SMM_REQUIRE = FALSE
>DEFINE USE_OLD_PCI_HOST= FALSE
> +  DEFINE RAMDISK_SUPPORT_ENABLE  = FALSE
>  
>  [BuildOptions]
>GCC:*_UNIXGCC_*_CC_FLAGS = -DMDEPKG_NDEBUG
> @@ -610,6 +611,9 @@
>MdeModulePkg/Universal/PrintDxe/PrintDxe.inf
>MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
>MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
> +!if $(RAMDISK_SUPPORT_ENABLE) == TRUE
> +  MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf
> +!endif
>MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
>MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf
>MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
> diff --git a/OvmfPkg/OvmfPkgIa32X64.fdf b/OvmfPkg/OvmfPkgIa32X64.fdf
> index 98464ca..85c91d3 100644
> --- a/OvmfPkg/OvmfPkgIa32X64.fdf
> +++ b/OvmfPkg/OvmfPkgIa32X64.fdf
> @@ -242,6 +242,9 @@ INF  
> MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf
>  INF  MdeModulePkg/Universal/PrintDxe/PrintDxe.inf
>  INF  MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
>  INF  MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
> +!if $(RAMDISK_SUPPORT_ENABLE) == TRUE
> +  INF  MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf
> +!endif
>  INF  MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
>  INF  MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf
>  INF  MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
> diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
> index c983a54..a364580 100644
> --- a/OvmfPkg/OvmfPkgX64.dsc
> +++ b/OvmfPkg/OvmfPkgX64.dsc
> @@ -38,6 +38,7 @@
>DEFINE HTTP_BOOT_ENABLE= FALSE
>DEFINE SMM_REQUIRE = FALSE
>DEFINE USE_OLD_PCI_HOST= FALSE
> +  DEFINE RAMDISK_SUPPORT_ENABLE  = FALSE
>  
>  [BuildOptions]
>

[edk2] [PATCH] OvmfPkg: Add RAM disk support

2016-03-20 Thread Paulo Alcantara
This patch adds RamDiskDxe driver to OVMF through a new introduced flag
"RAMDISK_SUPPORT_ENABLE" which is disabled by default and may be enabled
with -DRAMDISK_SUPPORT_ENABLE=TRUE at build time.

Cc: Jordan Justen 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Paulo Alcantara 
---
 OvmfPkg/OvmfPkgIa32.dsc| 6 +-
 OvmfPkg/OvmfPkgIa32.fdf| 3 +++
 OvmfPkg/OvmfPkgIa32X64.dsc | 4 
 OvmfPkg/OvmfPkgIa32X64.fdf | 3 +++
 OvmfPkg/OvmfPkgX64.dsc | 6 +-
 OvmfPkg/OvmfPkgX64.fdf | 3 +++
 6 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
index 2635992..25b3722 100644
--- a/OvmfPkg/OvmfPkgIa32.dsc
+++ b/OvmfPkg/OvmfPkgIa32.dsc
@@ -38,6 +38,7 @@
   DEFINE HTTP_BOOT_ENABLE= FALSE
   DEFINE SMM_REQUIRE = FALSE
   DEFINE USE_OLD_PCI_HOST= FALSE
+  DEFINE RAMDISK_SUPPORT_ENABLE  = FALSE
 
 [BuildOptions]
   GCC:*_UNIXGCC_*_CC_FLAGS = -DMDEPKG_NDEBUG
@@ -293,7 +294,7 @@
   DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf
 !endif
   QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf
-!if $(SECURE_BOOT_ENABLE) == TRUE
+!if $(SECURE_BOOT_ENABLE) == TRUE OR $(RAMDISK_SUPPORT_ENABLE) == TRUE
   FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
 !endif
 !if $(USE_OLD_PCI_HOST) == FALSE
@@ -603,6 +604,9 @@
   MdeModulePkg/Universal/PrintDxe/PrintDxe.inf
   MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
   MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
+!if $(RAMDISK_SUPPORT_ENABLE) == TRUE
+  MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf
+!endif
   MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
   MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf
   MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
diff --git a/OvmfPkg/OvmfPkgIa32.fdf b/OvmfPkg/OvmfPkgIa32.fdf
index 2ef6206..ef493c7 100644
--- a/OvmfPkg/OvmfPkgIa32.fdf
+++ b/OvmfPkg/OvmfPkgIa32.fdf
@@ -242,6 +242,9 @@ INF  MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf
 INF  MdeModulePkg/Universal/PrintDxe/PrintDxe.inf
 INF  MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
 INF  MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
+!if $(RAMDISK_SUPPORT_ENABLE) == TRUE
+  INF  MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf
+!endif
 INF  MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
 INF  MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf
 INF  MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
index e9ffcb4..e2f2ec4 100644
--- a/OvmfPkg/OvmfPkgIa32X64.dsc
+++ b/OvmfPkg/OvmfPkgIa32X64.dsc
@@ -38,6 +38,7 @@
   DEFINE HTTP_BOOT_ENABLE= FALSE
   DEFINE SMM_REQUIRE = FALSE
   DEFINE USE_OLD_PCI_HOST= FALSE
+  DEFINE RAMDISK_SUPPORT_ENABLE  = FALSE
 
 [BuildOptions]
   GCC:*_UNIXGCC_*_CC_FLAGS = -DMDEPKG_NDEBUG
@@ -610,6 +611,9 @@
   MdeModulePkg/Universal/PrintDxe/PrintDxe.inf
   MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
   MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
+!if $(RAMDISK_SUPPORT_ENABLE) == TRUE
+  MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf
+!endif
   MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
   MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf
   MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
diff --git a/OvmfPkg/OvmfPkgIa32X64.fdf b/OvmfPkg/OvmfPkgIa32X64.fdf
index 98464ca..85c91d3 100644
--- a/OvmfPkg/OvmfPkgIa32X64.fdf
+++ b/OvmfPkg/OvmfPkgIa32X64.fdf
@@ -242,6 +242,9 @@ INF  MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf
 INF  MdeModulePkg/Universal/PrintDxe/PrintDxe.inf
 INF  MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
 INF  MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
+!if $(RAMDISK_SUPPORT_ENABLE) == TRUE
+  INF  MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf
+!endif
 INF  MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
 INF  MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf
 INF  MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
index c983a54..a364580 100644
--- a/OvmfPkg/OvmfPkgX64.dsc
+++ b/OvmfPkg/OvmfPkgX64.dsc
@@ -38,6 +38,7 @@
   DEFINE HTTP_BOOT_ENABLE= FALSE
   DEFINE SMM_REQUIRE = FALSE
   DEFINE USE_OLD_PCI_HOST= FALSE
+  DEFINE RAMDISK_SUPPORT_ENABLE  = FALSE
 
 [BuildOptions]
   GCC:*_UNIXGCC_*_CC_FLAGS = -DMDEPKG_NDEBUG
@@ -298,7 +299,7 @@
   DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf
 !endif
   QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf
-!if $(SECURE_BOOT_ENABLE) == TRUE
+!if $(SECURE_BOOT_ENABLE) == TRUE OR $(RAMDISK_SUPPORT_ENABLE) == TRUE