EFI Debugging using ITPWord文档下载推荐.docx
- 文档编号:21339470
- 上传时间:2023-01-29
- 格式:DOCX
- 页数:26
- 大小:38.18KB
EFI Debugging using ITPWord文档下载推荐.docx
《EFI Debugging using ITPWord文档下载推荐.docx》由会员分享,可在线阅读,更多相关《EFI Debugging using ITPWord文档下载推荐.docx(26页珍藏版)》请在冰豆网上搜索。
IntelCorporation,2006.
Contents
1Introduction7
1.1Overview7
1.2RelatedInformation7
1.3DocumentOrganization7
1.4Terms8
2FrameworkDebuggingUsingITP9
2.1ITPSoftwareSetupandITPScripts9
2.2ITPDebugSetup9
2.2.1ITPCommands10
2.3DebuggingusingITPScripts10
2.3.1SECPhase10
2.3.2PEIPhase10
2.3.3DXEPhase12
2.3.4BDSPhase13
2.3.5SMMDebugging13
2.4KnownIssues13
3FrameworkITPScript15
3.1LoadImageAt(Addr)15
3.2loadthis()15
3.3LoadImage()16
3.4UnloadAllImages16
3.5LoadAllImages16
3.6ShowDrivers17
3.7LoadDriver(Index)17
3.8LoadPeims19
3.9ShowPeims19
3.10LoadPeim(Index)20
3.11Dgo21
3.12SetShadowPeiBreak(PeimName)21
3.13SetPeiBreak(PeimName)22
3.14SetDxeBreakIA32(DriverName)22
3.15SetDxeBreakX64(DriverName)22
3.16DumpAllEfiTables23
3.17DumpConfigTable23
3.18DumpEfiTable(Addr)23
3.19DumpHobs(Addr)24
3.20DumpDxeHobs24
3.21DumpVariable24
3.22DumpAcpiTable25
3.23ShowEfiDevicePath(Addr)25
3.24DumpS3Script25
3.25DumpCallStack26
3.26DumpExceptionContext26
RevisionHistory
Revision
Number
Description
Date
<
0.2>
Createfirstrelease.Addedmainsection
May2005
0.3>
AdddescriptionforstandardsetofFrameworkITPscript,reformattingandediting.
Dec2006
§
Introduction
Overview
ThisdocumentdescribessomeoftheITP(InTargetProbe)functionalityanditsdebugusageinanEFIenvironment.ThisisthefirstdocumentwhichdescribescommonlyusedEFIdebugtechniquesusingITP.Thisdocumentdoesnotclaimtocontainallofthedebugmethodologiesthatareavailable.
RelatedInformation
Thefollowingpublicationsandsourcesofinformationmaybeusefulorarereferredtobythisspecification:
ExtensibleFirmwareInterfaceSpecification,Version1.10,Intel,2001,
UnifiedExtensibleFirmwareInterfaceSpecification,Version2.0,UnifiedEFI,Inc,2006,http:
//www.uefi.org.
Intel®
PlatformInnovationFrameworkforEFISpecifications,Intel,2006,
DocumentOrganization
Thisdocumentisorganizedasfollows:
Chapter1:
Introduction
TheIntroductionchapterincludesalistofacronymsandtermsusedinthisdocument,andalistofreferencedocuments.
Chapter2:
FrameworkDebuggingUsingITP
ThesechaptertalksofITPandsomeofthecommonlyusedtipandtricksusedtodebugvariousphasesofFramework.
Chapter3:
FrameworkITPScript
ThischapterliststhemajorITPscriptcommandusedforframeworkdebug.
Terms
Thefollowingtermsusedthroughoutthisdocumenttodescribevaryingaspectsofinputlocalization:
BDS
FrameworkBootDeviceSelectionphase.
CSM
FrameworkCompatibilitySupportModule.
DXE
FrameworkDriverExecutionEnvironmentphase.
DXESMM
AspecialclassofDXEmodulethatisloadedintotheSystemManagementModememory.
DXERuntime
SpecialclassofDXEmodulethatprovidesRuntimeServices.
EFI
ExtensibleFirmwareInterface.GenerictermthatreferstooneoftheversionsoftheEFIspecification:
EFI1.02,EFI1.10,orUEFI2.0.
Framework
PlatformInnovationFrameworkforEFIconsistsoftheFoundation,plusothermodularcomponentsthatcharacterizetheportabilitysurfaceformodularcomponentsdesignedtoworkonanyimplementationoftheEFIarchitecture.
ITP
InTargetProbe
PEI
Pre-EFIInitializationPhase
RuntimeServices
Interfacesthatprovideaccesstounderlyingplatform-specifichardwarethatmightbeusefulduringOSruntime,suchastimeanddateservices.TheseservicesbecomeactiveduringthebootprocessbutalsopersistaftertheOSloaderterminatesbootservices.
SEC
SecurityPhaseisthecodeintheFrameworkthatcontainstheprocessorresetvectorandlaunchesPEI.ThisphaseisseparatefromPEIbecausesomesecurityschemesrequireownershipoftheresetvector.
FrameworkDebugging
UsingITP
EFIFrameworkareimplementedinhighlevellanguagecalled‘C’.Animportantfeatureofthisimplementationallowssourceleveldebugging.ITPcanbeusedtodebugEFIonvariousphasesduringBootflow.ITPdebuggingincludesourceleveldebugging,tracingthecode,placinghardwarebreakpointswithinadriver,placingbothhardwareandsoftwarebreakpointsatanyfunctioninaCfile.Toenabledebugging,thesourcecodeshouldbebuilt(compiled)withdebuginformationandwithoptimizationdisabled.
ThevariousphasesofFrameworkareSEC,PEI,DXE,BDSandOShandoff.ApartfromthatareCSM(CompatibilitySupportModule)forlegacyOSsupportandtheSMMmode.AlloftheabovephasesexceptSECandCSMareimplementedinC.AllthesephasesoftheFrameworkbootflowcanbedebuggedusingITP.
ITPSoftwareSetupandITPScripts
First,theITPSoftwaredistributedalongwithIntel®
XDPITPmustbeinstalledonthehostmachine.MakecertaintouseappropriateversionoftheITP.ITPXDPmustbeconnectedtoaUSB2.0portonthehostmachineandontotheDebugport(XDPconnector)onthetargetmachine.OncetheITPsoftwareisinstalled,theselftestshouldbeconductedbyconnectingtheITPusingaloopbackconnectorprovidedonthebufferboard.
ITPDebugSetup
AnITPscriptpackageiscreatedtoeaseFrameworkdebugging.ThispackagecontainsasetofITPmacrofiles,anITPconfigurationfilesample,andsomeusefulshortcutsforusingITPcommands.
Oncethesefilesareinplace,theitp.cfgfile(fromtheITPinstallationfolder)shouldbereplacedbythesampleitp.cfgsamplefileprovided.ThisfileenablesloadingallofthenecessarymacrofileswhentheITPstarts.Thesetupisthenreadytostartdebugging.
Top-levelfunctionsandtheusageofallthesemacrosaredescribedinsubsequentsections.
ITPCommands
PleaserefertotheITPhelpsectionforacomprehensivelistofitpcommandswhichcanbeused.
Someofthemostcommonlyuseditpcommandsare:
halt/go,resettarget,resetbreak=break/continue,scope,smmentry=break/continue,viewpoint,log/nolog.
Theusageofsomeofthesecommandsaredescribedinsubsequentsections.
DebuggingusingITPScripts
BIOSdebuggingingeneralisnotwithinthescopeofthisdocument.ThissectionfocusesondebuggingofFrameworkusingITP.ThisincludesdebuggingofvariousphasesofFrameworkandthedifferencesbetweenthetechniquesused,ifany.
SECPhase
TheSECphaseispredominantlyimplementedinassemblyandexecutedinplacefromflash.Commondebuggingdoneherearehaltingtheprocessor,checkingifresetvectorisaccessible,andsteppingthoughtheinstructionssingly.ThisensuresthattheCPUisabletofetchtheinstructionsfromtheflashandvalidatesthattheaddressisbeingdecoded.SomeoftheotherteststhatareconductedduringtheSECphaseare:
checkforsettingupofCAR,switchtoprotectedmode,andexecutionofmicrocodepatch,etc.
PEIPhase
ThemaingoalofthePEIphaseistoensuredetectionandinitializationofmemory.Thebasicchipsetinitializationandthedecodingofthecompleteflashrangearealsodoneinthisphase.ThisphaseiscompletelyimplementedinC.Sourceleveldebuggingisthereforepossiblehere.Thesourceshouldbebuiltonthehostmachineoratalocationwhichismappedtothehostmachine.Thedebugsymbolfiles(pdbfiles)mustbepresentinthelocationwhereitwasbuilt.TheBIOSbuiltwiththedebugoptionscontainsthelocationsofthedebugsymbolsinthem.WhenITPtriestoloadthesymbolfilesontomemory,thepdbfilelocationisfetchedfromtheBIOSimageandloadsthesymbolsintomemory,whenfoundonthehostmachine.
Someofthedebuggingdoneatthisphaseare:
CheckforproperexecutionofallthePEIdriversinPEIphase
CheckforproperorderofexecutionofPEIdrivers
ExecutionofbasicchipsetinitializationwhichincludesbasicMCH,ICH,SIOdeviceinitialization
Executionofmemoryinitinstruction
Availabilityofmemory,andcompleteflashaccessibility
Executionofrecoverydriveriftherecoveryjumperisselected,andexecutionofrecoverypathifrecoveryisdetected(notimplementedinWTC)
DetectionofDXEIPLPEIMwhichinturndetectsandlaunchestheDXEcore
ThefollowingaresomeofthedebugmethodsusedinthePEIphase.
TheentrypointofPEIphaseisthePeiMain()functioninPeiMainfile.TheentrypointaddressofPeiMainisstoredat0xFFFFFFE0(adoublewordvalue).Also,onecouldusethelpeicommandtolisttheentrypointaddressofPeiMain.
ThebestwaytodetectthestartingpointistolettheBIOSrunforacoupleofsecondsandhalttheprocessor.Alternatively,onecouldsetahardwarebreakpointattheentrypointaddressofPeiMain.
LoadallthePEIMspr
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- EFI Debugging using ITP