From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.126; helo=mga18.intel.com; envelope-from=hao.a.wu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3905C21CF1D04 for ; Mon, 12 Feb 2018 18:59:17 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Feb 2018 19:05:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,505,1511856000"; d="scan'208";a="34211144" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga002.jf.intel.com with ESMTP; 12 Feb 2018 19:05:07 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 12 Feb 2018 19:05:07 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.125]) by shsmsx102.ccr.corp.intel.com ([169.254.2.124]) with mapi id 14.03.0319.002; Tue, 13 Feb 2018 11:05:05 +0800 From: "Wu, Hao A" To: Andrew Fish , Rick Warner CC: "edk2-devel@lists.01.org" Thread-Topic: [edk2] how do I use RamDiskDxe? Thread-Index: AQHTpEWIQjuwAcejgECz+UaZsBNi/6Og97QAgACphJA= Date: Tue, 13 Feb 2018 03:05:04 +0000 Message-ID: References: In-Reply-To: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: how do I use RamDiskDxe? X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 02:59:18 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Andrew Fish > Sent: Tuesday, February 13, 2018 8:40 AM > To: Rick Warner > Cc: edk2-devel@lists.01.org > Subject: Re: [edk2] how do I use RamDiskDxe? >=20 >=20 >=20 > > On Feb 12, 2018, at 1:07 PM, Rick Warner wrote: > > > > Hi All, > > > > I'm trying to develop a tool for automated BIOS flashing from the EFI s= hell > using IPMI serial over lan to drive it. To accomplish this, my plan is t= o use a > network booted EFI shell with a tftp client and a ramdisk to download the= flash > tools and ROM into as a workspace and then run the flash commands from th= at > ram disk. > > > > I've been able to successfully build and boot an efi shell from the edk= 2 > sources including the tftp client. I've also been able to separately bui= ld the > RamDiskDxe driver from the MdeModulePkg. Loading the RamDiskDxe.efi > driver file results in a successful message, but I do not get any usable = ram disk > made available to me? > > > > How do I get a usable drive letter/name (ie blk0: or any other name) fr= om the > RamDiskDxe driver? > > >=20 > Looks like when you load the RamDiskDxe it registers gEfiRamDiskProtocolG= uid > https://github.com/tianocore/edk2/blob/master/MdePkg/Include/Protocol/Ra > mDisk.h > mDisk.h> which notes this API was added in UEFI 2.6 so you can read up on= it in > that version of the EFI Spec. >=20 > From a quick site read of the code it looks like the driver just produces= a > Protocol that lets you create a RAM disk and VRF (Setup Pages) that let y= ou > configure one. Seems like you still need to call it and give the raw disk= image. >=20 > > Once I've done that, will it be possible to include the RamDiskDxe driv= er as > part of the network bootable efi shell image? I assume I'll need to modi= fy > the .dsc file for the ShellPkg to include the MdeModulePkg pieces. > > > > If anyone has any other suggestions for this, I'm open to ideas. The on= ly way > I've been successful in network booting EFI shell is using just that file= directly. I > tried creating a dos filesystem image with the efi shell file in it just = like would > work with a USB key, but that would not boot over the network stack. If t= here is > some way of creating a network bootable EFI shell filesystem image (simil= ar to > how Linux can network boot a separate vmlinuz kernel and initrd image)? > > > > Are there any docs that I've missed (I've tried looking in the user doc= s and on > the wiki) regarding setting up RamDiskDxe? > > >=20 > Traditionally network booting has involved loading a single file over the > network (like an OS Loader) and that file uses the UEFI networking stack = to > download (TFTP read) more images (like the Kernel) from a location implie= d by > the location used to download the single file (OS Loader). >=20 Hi, For the RamDiskDxe part: Just as the previous reply, the RamDiskDxe driver provides: a). A protocol to (un)register a range of memory to a Ram disk b). A setup page for user to create: a raw Ram disk (no data on the created one) or, from a selected file (the file will be the content in the Ram disk, no file system though) If you want to place the flash tools in the Ram disk and use it, I think you also need to format the Ram disk and create file system on it first (e.g. FAT). Best Regards, Hao Wu > Thanks, >=20 > Andrew Fish >=20 > > Thanks! > > Rick Warner > > _______________________________________________ > > 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