Re: [EDK DEV] Using a compressed option rom driver image.

Subject: Re: [EDK DEV] Using a compressed option rom driver image.

From: Ken Aaker <kaaker@brocade.com>

To: dev@edk.tianocore.org

Date: 2008-06-21 15:40:28

Hello,

Thank you both. I suspected I was making it too complicated.

Ken



Tian, Hot wrote:

If you want to add EFI driver with compression to add-in card ROM, you can just use -ec option of efirom tool to make .efi file to option rom bin. Please get the latest tool from EDK1.04. And there is doc describing this tool in:

https://edk.tianocore.org/files/documents/16/347/file_347.dat/EDK%20Build_0_2.pdf

 

If you want to add EFI driver with compression to BIOS ROM, you can specify the compression in package description file to make .efi file to FV FFS file with compress section. File section are FFS concept for FV files (Not for EFI option rom). Usually BS or RT Driver using default package will have compressed pe32 section. E.g.: Sample\Bus\Pci\Undi\RuntimeDxe\Undi.inf in Edk\Sample\Platform\IPF\Build\IPF.dsc. The component type is "COMPONENT_TYPE       = RT_DRIVER" described in the undi.inf file. It uses "DEFINE PACKAGE=Default" described in IPF.dsc. So the package definition for this driver is [Package.RT_DRIVER.Default] defined in Edk\Sample\Platform\CommonIpf.dsc:

PACKAGE.INF

\[.]

BASE_NAME                   = $(BASE_NAME)

FFS_FILEGUID                = $(FILE_GUID)

FFS_FILETYPE                = EFI_FV_FILETYPE_DRIVER

FFS_ATTRIB_CHECKSUM         = TRUE

 

IMAGE_SCRIPT =

{

  Compress ($(COMPRESS_METHOD)) {

    Tool (

      $(OEMTOOLPATH)\GenCRC32Section

      ARGS= -i $(DEST_DIR)\$(BASE_NAME).dpx

               $(DEST_DIR)\$(BASE_NAME).pe32

               $(DEST_DIR)\$(BASE_NAME).ui

               $(DEST_DIR)\$(BASE_NAME).ver

            -o $(DEST_DIR)\$(BASE_NAME).crc32

      OUTPUT = $(DEST_DIR)\$(BASE_NAME).crc32

    )

  }

}

The package definition has compress section.

 

List two file generation processes for your info:

.efi(efi executable image)--[efirom tool, specify compress or not by different tool options]-->.bin(efi option image to burn into add-in card ROM)

 

.efi(efi executable image)--[gensection tool]-->.pe32(pe32 section file)--[genffsfile tool, use package definition file as input]-->.dxe, .pei or .ffs etc(ffs file)--[genfvimage tool, use fv inf file as input]-->.fv(FV file including this driver)--[some script or 3rd party tool to generate final BIOS flash image]-->.fd (BIOS image to burn into BIOS flash)

 

Thanks,

Hot

 

The content of this message is my personal opinion only and although I am an employee of Intel, the statements I make here in no way represent Intel's position on the issue, nor am I authorized to speak on behalf of Intel on this matter.

 

-----Original Message-----
From: Ken Aaker [mailto:kaaker@brocade.com]
Sent: 2008
621 5:56
To: dev@edk.tianocore.org
Subject: Re: [EDK DEV] Using a compressed option rom driver image.

 

I'm still digging around, I thought I should add some explanation of

what I'm trying to do.

 

I need to generate a EFI code image that will be burned into the flash

ROM of a fibre channel HBA device. I have used EfiRom to generate an

IA32 image with my driver, the scsi bus driver, and the scsi disk

driver. I have written that image to the flash and everything functions.

 

Now, I need to generate an IPF image of my driver, the scsi bus driver,

and the scsi disk driver. Everything builds Ok, but the IPF driver image

is too large to fit in the ROM space I have. So, I need to create a

compressed image of the 3 efi files that can be processed by the PCI bus

driver. I've found the information about the fdf file and genfds, but it

really doesn't seem to be very applicable to what I'm trying to do.

 

Thank you for any guidance,

Ken Aaker

 

 

Ken Aaker wrote:

> I've read the sections in the UEFI 2.1 spec that discuss the

> decompression protocol for driver images.

> 

> I didn't find an example of how to set up a compressed driver image. I

> tried EfiCompress and it compressed the IPF version quite nicely, but

> I don't see how to tell gensection to compress my driver .efi image.

> 

> 

> Thanks,

> 

> Ken Aaker

> 

> ---------------------------------------------------------------------

> To unsubscribe, e-mail: dev-unsubscribe@edk.tianocore.org

> For additional commands, e-mail: dev-help@edk.tianocore.org

> 

 

 

---------------------------------------------------------------------

To unsubscribe, e-mail: dev-unsubscribe@edk.tianocore.org

For additional commands, e-mail: dev-help@edk.tianocore.org