[edk2] porting of .inf file for Driver from EDK to EDK2.

Subject: [edk2] porting of .inf file for Driver from EDK to EDK2.

From: "Sivakumar Subramani" <Sivakumar.Subramani@exar.com>

To: <edk2-devel@lists.sourceforge.net>

Date: 2010-07-21 21:27:00

Hi,

 

I have my driver compiled on EDK. Now I am trying to compile it with EDK2. Is it possible to directly use .inf file of the driver. I am getting following unresolved symbols. Then I try to add following section in my inf file similar to other inf file in EDK2. Is any thing missing. Is there any document that talks about adding a new module to EDK2 source and build it.

 

INF file:

 

[defines]

BASE_NAME                = VxgeUndi

FILE_GUID                    = 72521EA4-DE00-11DE-A605-2AC455D89593

COMPONENT_TYPE                 = RT_DRIVER

 

[Sources]

            vxge_reg.h

            vxge_api.h

            vxge_api.c

            decode.c

            INIT.c

            INIT.h

 

[Packages]

            MdePkg/MdePkg.dec

           

[Protocols]

            gEfiDriverBindingProtocolGuid

            gEfiLoadedImageProtocolGuid

            gEfiPciIoProtocolGuid

            gEfiDevicePathProtocolGuid

            gEfiDriverDiagnosticsProtocolGuid

            EfiLibInstallAllDriverProtocols

            gEfiNetworkInterfaceIdentifierProtocolGuid_31

           

[LibraryClasses]

            MemoryAllocationLib

            DevicePathLib

            UefiLib

            UefiBootServicesTableLib

            UefiDriverEntryPoint

            BaseMemoryLib

            DebugLib

            EfiDriverLib

            PrintLib

            UefiEfiIfrSupportLib

 

[nmake.common]

            ENTRY_POINT=InitializeVxgeUNDIDriver

            MODULE_CFLAGS = /DLAN_DOWN

 

Compilation error:

        "C:\Program Files (x86)\Microsoft Visual Studio 8\Vc\bin\x86_amd64\lib.e

xe" /NOLOGO /LTCG /OUT:c:\edk2\Build\DuetPkgX64\DEBUG_VS2005x86\X64\MdeModulePkg

\Bus\Pci\VxgeUndi\vxge_edk1\OUTPUT\VxgeUndi.lib @c:\edk2\Build\DuetPkgX64\DEBUG_

VS2005x86\X64\MdeModulePkg\Bus\Pci\VxgeUndi\vxge_edk1\OUTPUT\object_files.lst

        "C:\Program Files (x86)\Microsoft Visual Studio 8\Vc\bin\x86_amd64\link.

exe" /OUT:c:\edk2\Build\DuetPkgX64\DEBUG_VS2005x86\X64\MdeModulePkg\Bus\Pci\Vxge

Undi\vxge_edk1\DEBUG\VxgeUndi.dll /NOLOGO /NODEFAULTLIB /IGNORE:4086 /OPT:REF /O

PT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:AMD64 /LTC

G /DLL /ENTRY:InitializeVxgeUNDIDriver /SUBSYSTEM:CONSOLE /SAFESEH:NO /BASE:0 /D

RIVER /DEBUG  @c:\edk2\Build\DuetPkgX64\DEBUG_VS2005x86\X64\MdeModulePkg\Bus\Pci

\VxgeUndi\vxge_edk1\OUTPUT\static_library_files.lst

LINK : warning LNK4001: no object files specified; libraries used

VxgeUndi.lib(INIT.obj) : error LNK2001: unresolved external symbol gBS

VxgeUndi.lib(INIT.obj) : error LNK2001: unresolved external symbol gEfiDriverBin

dingProtocolGuid

VxgeUndi.lib(INIT.obj) : error LNK2001: unresolved external symbol gEfiLoadedIma

geProtocolGuid

VxgeUndi.lib(INIT.obj) : error LNK2001: unresolved external symbol gEfiPciIoProt

ocolGuid

VxgeUndi.lib(INIT.obj) : error LNK2001: unresolved external symbol gEfiDevicePat

hProtocolGuid

VxgeUndi.lib(INIT.obj) : error LNK2001: unresolved external symbol EfiLibFreeUni

codeStringTable

VxgeUndi.lib(INIT.obj) : error LNK2001: unresolved external symbol gEfiDriverDia

gnosticsProtocolGuid

VxgeUndi.lib(INIT.obj) : error LNK2001: unresolved external symbol EfiLibInstall

AllDriverProtocols

VxgeUndi.lib(INIT.obj) : error LNK2001: unresolved external symbol gEfiNetworkIn

terfaceIdentifierProtocolGuid_31

VxgeUndi.lib(INIT.obj) : error LNK2001: unresolved external symbol EfiLibLookupU

nicodeString

VxgeUndi.lib(INIT.obj) : error LNK2001: unresolved external symbol Aprint

VxgeUndi.lib(decode.obj) : error LNK2001: unresolved external symbol EfiCompareM

em

VxgeUndi.lib(vxge_api.obj) : error LNK2001: unresolved external symbol gST

c:\edk2\Build\DuetPkgX64\DEBUG_VS2005x86\X64\MdeModulePkg\Bus\Pci\VxgeUndi\vxge_

edk1\DEBUG\VxgeUndi.dll : fatal error LNK1120: 13 unresolved externals

NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 8\Vc

\bin\x86_amd64\link.exe"' : return code '0x460'

Stop.

 

 

build...

 : error 7000: Failed to execute command

        C:\Program Files (x86)\Microsoft Visual Studio 8\Vc\bin\nmake.exe /nolog

o tbuild [c:\edk2\Build\DuetPkgX64\DEBUG_VS2005x86\X64\MdeModulePkg\Bus\Pci\Vxge

Undi\vxge_edk1]

 

 

build...

 : error F002: Failed to build module

        c:\edk2\MdeModulePkg\Bus\Pci\VxgeUndi\vxge_edk1.inf [X64, VS2005x86, DEB

UG]

 

Thanks,

~Siva