Hi Olivier/Steve/Leif/whoever is interested,
I have a problem I'm trying to solve and I don't think there is a proper
solution using the current ARM BDS.
Basically, some of Linaro's releases are failing to boot "out of the box"
due to incorrect default BDS config. The default assumes that the image
has an initrd.
Android (the main focus of our releases) and Ubuntu images use an initrd.
OpenEmbedded images do not.
I'd like a single UEFI binary that can work on all three without
reconfiguration.
The obvious solutions are:
1) there is no default config that always works and the user should
configure the board
themselves each time they want to boot a different image type.
Our LAVA automated test environment and people like myself who boot test
many images
daily don't favour this option.
2) change OpenEmbedded to use an initrd
It's not my image to change and the owners don't want to do that because
it's also wrong.
3) Have different UEFI binaries for each image type
This isn't ideal because I (and LAVA) would be forever reflashing UEFI.
4) Make BDS continue if it can't load the initrd
This isn't ideal because if there is no initrd, it could be for a bad
reason. By continuing, we
aren't giving the user the change to immediately correct the config.
However, the likelihood of the initrd being completely missing, whilst a
valid kernel and FDT
is provided seems slim. If it is missing, it's most likely on purpose.
Of the options above, I prefer #4 and have provided a patch below for
discussion. I suspect that if it's not going to cause other problems, it
could be like my other BDS hacks, fixes and improvements and only live in
the Linaro tree, which would be fine with me too.
Opinions on a way forward and/or this patch?
Regards,
Ryan.
note: the patch looks a little larger than it should because I had to
indent the section beginning with the comment "// Check if the initrd is a
uInitrd", although that section is unmodified otherwise.
>From aaec8cb3f386a9a128f57a2d0fcbb4396a101ec4 Mon Sep 17 00:00:00 2001
From: Ryan Harkin <ryan.harkin(a)linaro.org>
Date: Tue, 19 Nov 2013 08:10:00 +0000
Subject: [PATCH] ARM/BDS: skip initrd if not found
When loading a Linux image, if the initrd is not found, we will display
an error, but attempt to load the kernel anyway.
Previous behaviour dropped the user back to the menu, thus allowing them
to update the config. However, this does not suit booting in automated
environments where test images may or may not have an initrd. Example,
Ubuntu and Android images require an initrd; OpenEmbedded images do not.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ryan Harkin <ryan.harkin(a)linaro.org>
---
ArmPkg/Library/BdsLib/Arm/BdsLinuxLoader.c | 26
+++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/ArmPkg/Library/BdsLib/Arm/BdsLinuxLoader.c
b/ArmPkg/Library/BdsLib/Arm/BdsLinuxLoader.c
index d0eb075..d2a161a 100644
--- a/ArmPkg/Library/BdsLib/Arm/BdsLinuxLoader.c
+++ b/ArmPkg/Library/BdsLib/Arm/BdsLinuxLoader.c
@@ -258,19 +258,20 @@ BdsBootLinuxFdt (
Status = BdsLoadImage (InitrdDevicePath, AllocateAnyPages,
&InitrdImageBase, &InitrdImageBaseSize);
}
if (EFI_ERROR(Status)) {
- Print (L"ERROR: Did not find initrd image.\n");
- goto EXIT_FREE_LINUX;
- }
-
- // Check if the initrd is a uInitrd
- if (*(UINT32*)((UINTN)InitrdImageBase) == LINUX_UIMAGE_SIGNATURE) {
- // Skip the 64-byte image header
- InitrdImage = (EFI_PHYSICAL_ADDRESS)((UINTN)InitrdImageBase + 64);
- InitrdImageSize = InitrdImageBaseSize - 64;
- } else {
- InitrdImage = InitrdImageBase;
- InitrdImageSize = InitrdImageBaseSize;
+ Print (L"ERROR: Did not find initrd image, you may need to update
your config. Attempting to continue without it.\n");
+ InitrdImageBase = 0;
}
+ else {
+ // Check if the initrd is a uInitrd
+ if (*(UINT32*)((UINTN)InitrdImageBase) == LINUX_UIMAGE_SIGNATURE) {
+ // Skip the 64-byte image header
+ InitrdImage = (EFI_PHYSICAL_ADDRESS)((UINTN)InitrdImageBase + 64);
+ InitrdImageSize = InitrdImageBaseSize - 64;
+ } else {
+ InitrdImage = InitrdImageBase;
+ InitrdImageSize = InitrdImageBaseSize;
+ }
+ }
}
// Load the FDT binary from a device path. The FDT will be reloaded
later to a more appropriate location for the Linux kernel.
@@ -299,7 +300,6 @@ EXIT_FREE_INITRD:
gBS->FreePages (InitrdImageBase, EFI_SIZE_TO_PAGES
(InitrdImageBaseSize));
}
-EXIT_FREE_LINUX:
gBS->FreePages (LinuxImage, EFI_SIZE_TO_PAGES (LinuxImageSize));
return Status;
--
1.7.9.5
Hi List,
I am experiencing a Data Abort inside function 'GetSectionFromAnyFv' in file 'DxeServicesLib.c'
on my ARMv7 UEFI platform.
To debug the same I added some print messages like:
/* Added for debugging */
CHAR8 Buffer1[100];
UINTN CharCount;
CharCount = AsciiSPrint (Buffer1,sizeof (Buffer1),"Inside Func\n\r");
SerialPortWrite ((UINT8 *) Buffer1, CharCount);
And also something like:
SerialPrint ("Inside Func\n\r");
I have included:
#include <Library/PrintLib.h>
#include <Library/SerialPortLib.h>
and defined:
#define SerialPrint(txt) SerialPortWrite ((UINT8*)(txt), AsciiStrLen(txt)+1);
I still cannot see any debug prints on the UART (placed right after the entry point of 'GetSectionFromAnyFv' function).
Debugger (DS-5) suggests that the crash is inside 'GetSectionFromAnyFv' itself.
I get the UEFI firmware <version xx built at xx on xx) and Data Abort Exception PC at xx prints on the console, but
no prints from 'DxeServicesLib.c'
Any pointers to what I may be missing here.
Regards,
Bhupesh
Hi List,
I am new to UEFI and exploring about SCT. I have very basic question
regarding SCT.
1) In order to use SCT in an organization, do we require any special
license?
2) Looks like SCT compliance testing is only internal to an
organization. We don't require to publish its details outside of the
organization?
3) If anyone want to contribute to SCT test cases. Which forum/list
he/she can be used?
Please guide me.
Regards,
Prabhakar
Hi Oliver,
at very early stage UEFI firmware is present in DRAM.
with DDR mapped from 0x90000000 size 512MB.
while running source Z:\....\cmd_load_symbols.py -f
(0x90001000,0x20000000) -a -v, I am getting following error
Add symbols of
/home/<...>/edk2/MyBuild/Board/DEBUG_ARMGCC/ARM/ArmPlatformPkg/PrePi/PeiUniCore/DEBUG/ArmPlatformPrePiUniCore.dll
at 0x90001180
Warning: not possible to load symbols from
/home/..../edk2/Build/MyBoard/DEBUG_ARMGCC/ARM/ArmPlatformPkg/PrePi/PeiUniCore/DEBUG/ArmPlatformPrePiUniCore.dll
at 0x90001180
Note: no symbols have been found in System Memory (possible cause: the
UEFI permanent memory has been installed yet)
Also FDF file has following entries
[FD.MyBoard_EFI]
BaseAddress = 0x90001000|gArmTokenSpaceGuid.PcdFdBaseAddress #The base
address of the DDR Device.
Size = 0x20000000|gArmTokenSpaceGuid.PcdFdSize #The size in
bytes of the DDR Device
ErasePolarity = 1
BlockSize = 0x00001000
NumBlocks = 0x20000
Regards,
Prabhakar
On 10/23/2013 03:22 PM, Olivier Martin wrote:
> To parse your FV file (embedded in your FD file), you can use
> './BaseTools/BinWrappers/PosixLike/VolInfo <location of your FV file>'
>
> If you want to debug the early stage of your UEFI boot process, you can only
> use (you do not need -m (...,...)):
> source edk2/ArmPlatformPkg/Scripts/Ds5/cmd_load_symbols.py -f (..,...) -a -v
>
> At the early stage of the boot, the UEFI firmware has not loaded its
> binaries into DRAM yet.
> The UEFI System Table will not be found in System Memory.
>
> Where your UEFI firmware lives when started? In DRAM or in Flash/ROM memory?
>
>> -----Original Message-----
>> From: Sharma Bhupesh-B45370 [mailto:B45370@freescale.com]
>> Sent: 23 October 2013 06:33
>> To: Olivier Martin; edk2-devel(a)lists.sourceforge.net; 'Andrew Fish'
>> Cc: 'Kim Phillips'; boot-architecture(a)lists.linaro.org; Kushwaha
>> Prabhakar-B32579
>> Subject: RE: [edk2] Debugging Sec and PI phases {Source symbols}
>>
>> Hi Olivier,
>>
>> I tried to use the DS-5 scripts, but landed in some issues, like:
>> "System table not found in System Memory".
>>
>> It seems there is some issue with the .FD gets generated for my
>> BoardPkg.
>>
>> I am also now trying to understand if there is some documentation/tool
>> available that
>> can parse my .FD and .FV files and can tell me about the sections in
>> this particular output
>> file. For e.g. something like 'readelf -a XXX.ELF' produces as an
>> output.
>>
>> Also I am using the following method to build the .FD to allow
>> debugging of the source
>> using the DS5 scripts:
>> - export EDK2_DSC, EDK2_TOOLCHAIN, EDK2_ARCH, EDK2_BUILD.
>>
>> - Run 'make -f ArmPlatformPkg/Scripts/Makefile'
>>
>> - This will generate a .FD specific to my Board Pkg in
>> 'Build/Board_Pkg_Name/DEBUG_ARMGCC/..'
>>
>> - Load this .FD using the DS5 and then try to load source symbols
>> using:
>> source edk2/ArmPlatformPkg/Scripts/Ds5/cmd_load_symbols.py -f (..,...)
>> -m (..,...) -a
>>
>> - This gives me an error:
>> "System table not found in System Memory".
>>
>> Any pointers on the above two points..
>>
>> Regards,
>> Bhupesh
>>
>>> -----Original Message-----
>>> From: boot-architecture-bounces(a)lists.linaro.org [mailto:boot-
>>> architecture-bounces(a)lists.linaro.org] On Behalf Of Olivier Martin
>>> Sent: Tuesday, October 22, 2013 2:27 PM
>>> To: edk2-devel(a)lists.sourceforge.net; 'Andrew Fish'
>>> Cc: 'Kim Phillips'; boot-architecture(a)lists.linaro.org; Kushwaha
>>> Prabhakar-B32579
>>> Subject: RE: [edk2] Debugging Sec and PI phases {Source symbols}
>>>
>>> Hi Bhupesh,
>>> Yes, if you are using ARM DS-5, this is the wikipage to look at to
>> setup
>>> your environment to debug UEFI. Let me know if you have issue.
>>> Regards,
>>> Olivier
>>>
>>>> -----Original Message-----
>>>> From: Sharma Bhupesh-B45370 [mailto:B45370@freescale.com]
>>>> Sent: 22 October 2013 07:56
>>>> To: 'Andrew Fish'; 'edk2-devel(a)lists.sourceforge.net'
>>>> Cc: 'Kim Phillips'; 'boot-architecture(a)lists.linaro.org'; Kushwaha
>>>> Prabhakar-B32579
>>>> Subject: Re: [edk2] Debugging Sec and PI phases {Source symbols}
>>>>
>>>>
>>>>> -----Original Message-----
>>>>> From: boot-architecture-bounces(a)lists.linaro.org [mailto:boot-
>>>>> architecture-bounces(a)lists.linaro.org] On Behalf Of Andrew Fish
>>>>> Sent: Tuesday, October 22, 2013 2:07 AM
>>>>> To: edk2-devel(a)lists.sourceforge.net
>>>>> Cc: 'Kim Phillips'; 'boot-architecture(a)lists.linaro.org';
>> Kushwaha
>>>>> Prabhakar-B32579
>>>>> Subject: Re: [edk2] Debugging Sec and PI phases {Source symbols}
>>>>>
>>>>>
>>>>>
>>>>> On Oct 21, 2013, at 11:38 AM, Sharma Bhupesh-B45370
>>>>> <B45370(a)freescale.com> wrote:
>>>>>
>>>>>> [Resending as I got a 'You must be subscribed to post messages
>> to
>>>> this
>>>>>> mailing list' message from edk2 list]
>>>>>>
>>>>>> Hi List,
>>>>>>
>>>>>> I am new to UEFI and am trying to debug my UEFI ported code
>> (from
>>>> u-
>>>>> boot) on a ARMv7 based SoC.
>>>>>> I am able to do some basic debugging of the ARM CPU init code
>>>>>> using
>>>> a
>>>>> DS-5 debugger attached to the board.
>>>>>> I see that the ported code crashes somewhere while making a
>>>> transition
>>>>> from Sec to PI phase.
>>>>>> However, I can only verify this by seeing instruction level
>>>>>> disassembly. I cannot figure out a way to load the source code
>>>> using
>>>>> the DS-5 debugger.
>>>>>> I am used to seeing ELF files which have the debug information
>> and
>>>>> which can be loaded via the debugger.
>>>>>> Using the 'file' command I cannot find any ELF file in the
>> output
>>>>>> directory 'Build/..'. The FV and FD files don't seem to be ELF
>>>> files as
>>>>> well.
>>>>> FD is short for Flash Device. So it is usually the layout of the
>> ROM.
>>>> You
>>>>> could have multiple ROMs, but the most common thing is to just
>> have
>>>>> a single FD.
>>>>> FV is a Firmware Volume. Basically a simple Flash Filesystem that
>>>> allows
>>>>> files, named by GUIDs to be discovered.
>>>>>
>>>>> EFI is a collection of relocatable PE/COFF images, and in general
>> an
>>>> INF
>>>>> file (no for a library) in your project maps to a PE/COFF file
>>>> getting
>>>>> generated.
>>>>>
>>>>> It can vary by compiler, but it is common for the *.dll file to
>> be
>>>> the
>>>>> native image with the debug info. So that is the file you want to
>>>> load
>>>>> symbols for.
>>>>>
>>>>> There are various schemes on how to do this. Some platforms print
>>>>> out debug messages that map into the commands you need to load
>>> symbols.
>>>> Some
>>>>> platforms have scripts that can load symbols.
>>>>>
>>>>> Sorry I don't remember the latest recommendation on which scheme
>> to
>>>> use
>>>>> for your platform? Try looking at the *.Fv.map file as I think it
>>>>> has info about how to load symbols. You would need a script to
>>>>> convert
>>>> this
>>>>> into some format the DS-5 understands.
>>>>>
>>>>> Maybe the scripts in
>>>>>
>> https://svn.code.sf.net/p/edk2/code/trunk/edk2/ArmPlatformPkg/Scripts/
>>>> D
>>>> s5
>>>>> / are what you are looking for?
>>>> Many thanks Andrew. It seems the DS5 scripts will work for me. I
>> found
>>>> the wiki for the same here:
>>>>
>> http://sourceforge.net/apps/mediawiki/tianocore/index.php?title=ArmPkg
>>>> /
>>>> Ds5
>>>>
>>>> I will try to debug the target using these scripts and get back
>> with
>>>> my results.
>>>>
>>>> Regards,
>>>> Bhupesh
>>>>
>>>>> Thanks,
>>>>>
>>>>> Andrew Fish
>>>>>
>>>>>> Any pointers to which ELF file is generated while compiling a
>> UEFI
>>>>>> BoardPkg and how it can be loaded via the debugger.
>>>>>>
>>>>>> Thanks for your help.
>>>>>> Regards,
>>>>>> Bhupesh
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------
>> ---
>>>>>> -
>>>> ---
>>>>>> -------- October Webinars: Code for Performance Free Intel
>>>>>> webinars can help you accelerate application performance.
>>>>>> Explore tips for MPI, OpenMP, advanced profiling, and more. Get
>>>>>> the most from the latest Intel processors and coprocessors. See
>>>> abstracts
>>>>>> and register >
>>>>>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.c
>>>>>> lktrk _______________________________________________
>>>>>> edk2-devel mailing list
>>>>>> edk2-devel(a)lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/edk2-devel
>>>>>
>>>>> _______________________________________________
>>>>> boot-architecture mailing list
>>>>> boot-architecture(a)lists.linaro.org
>>>>> http://lists.linaro.org/mailman/listinfo/boot-architecture
>>>>
>>>>
>>>> -------------------------------------------------------------------
>> ---
>>>> -
>>>> -------
>>>> October Webinars: Code for Performance Free Intel webinars can help
>>>> you accelerate application performance.
>>>> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the
>>>> most from the latest Intel processors and coprocessors. See
>> abstracts
>>>> and register >
>>>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.c
>>>> l
>>>> ktrk
>>>> _______________________________________________
>>>> edk2-devel mailing list
>>>> edk2-devel(a)lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/edk2-devel
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> boot-architecture mailing list
>>> boot-architecture(a)lists.linaro.org
>>> http://lists.linaro.org/mailman/listinfo/boot-architecture
>>
>
>
>
>
To parse your FV file (embedded in your FD file), you can use
'./BaseTools/BinWrappers/PosixLike/VolInfo <location of your FV file>'
If you want to debug the early stage of your UEFI boot process, you can only
use (you do not need -m (...,...)):
source edk2/ArmPlatformPkg/Scripts/Ds5/cmd_load_symbols.py -f (..,...) -a -v
At the early stage of the boot, the UEFI firmware has not loaded its
binaries into DRAM yet.
The UEFI System Table will not be found in System Memory.
Where your UEFI firmware lives when started? In DRAM or in Flash/ROM memory?
> -----Original Message-----
> From: Sharma Bhupesh-B45370 [mailto:B45370@freescale.com]
> Sent: 23 October 2013 06:33
> To: Olivier Martin; edk2-devel(a)lists.sourceforge.net; 'Andrew Fish'
> Cc: 'Kim Phillips'; boot-architecture(a)lists.linaro.org; Kushwaha
> Prabhakar-B32579
> Subject: RE: [edk2] Debugging Sec and PI phases {Source symbols}
>
> Hi Olivier,
>
> I tried to use the DS-5 scripts, but landed in some issues, like:
> "System table not found in System Memory".
>
> It seems there is some issue with the .FD gets generated for my
> BoardPkg.
>
> I am also now trying to understand if there is some documentation/tool
> available that
> can parse my .FD and .FV files and can tell me about the sections in
> this particular output
> file. For e.g. something like 'readelf -a XXX.ELF' produces as an
> output.
>
> Also I am using the following method to build the .FD to allow
> debugging of the source
> using the DS5 scripts:
> - export EDK2_DSC, EDK2_TOOLCHAIN, EDK2_ARCH, EDK2_BUILD.
>
> - Run 'make -f ArmPlatformPkg/Scripts/Makefile'
>
> - This will generate a .FD specific to my Board Pkg in
> 'Build/Board_Pkg_Name/DEBUG_ARMGCC/..'
>
> - Load this .FD using the DS5 and then try to load source symbols
> using:
> source edk2/ArmPlatformPkg/Scripts/Ds5/cmd_load_symbols.py -f (..,...)
> -m (..,...) -a
>
> - This gives me an error:
> "System table not found in System Memory".
>
> Any pointers on the above two points..
>
> Regards,
> Bhupesh
>
> > -----Original Message-----
> > From: boot-architecture-bounces(a)lists.linaro.org [mailto:boot-
> > architecture-bounces(a)lists.linaro.org] On Behalf Of Olivier Martin
> > Sent: Tuesday, October 22, 2013 2:27 PM
> > To: edk2-devel(a)lists.sourceforge.net; 'Andrew Fish'
> > Cc: 'Kim Phillips'; boot-architecture(a)lists.linaro.org; Kushwaha
> > Prabhakar-B32579
> > Subject: RE: [edk2] Debugging Sec and PI phases {Source symbols}
> >
> > Hi Bhupesh,
> > Yes, if you are using ARM DS-5, this is the wikipage to look at to
> setup
> > your environment to debug UEFI. Let me know if you have issue.
> > Regards,
> > Olivier
> >
> > > -----Original Message-----
> > > From: Sharma Bhupesh-B45370 [mailto:B45370@freescale.com]
> > > Sent: 22 October 2013 07:56
> > > To: 'Andrew Fish'; 'edk2-devel(a)lists.sourceforge.net'
> > > Cc: 'Kim Phillips'; 'boot-architecture(a)lists.linaro.org'; Kushwaha
> > > Prabhakar-B32579
> > > Subject: Re: [edk2] Debugging Sec and PI phases {Source symbols}
> > >
> > >
> > > > -----Original Message-----
> > > > From: boot-architecture-bounces(a)lists.linaro.org [mailto:boot-
> > > > architecture-bounces(a)lists.linaro.org] On Behalf Of Andrew Fish
> > > > Sent: Tuesday, October 22, 2013 2:07 AM
> > > > To: edk2-devel(a)lists.sourceforge.net
> > > > Cc: 'Kim Phillips'; 'boot-architecture(a)lists.linaro.org';
> Kushwaha
> > > > Prabhakar-B32579
> > > > Subject: Re: [edk2] Debugging Sec and PI phases {Source symbols}
> > > >
> > > >
> > > >
> > > > On Oct 21, 2013, at 11:38 AM, Sharma Bhupesh-B45370
> > > > <B45370(a)freescale.com> wrote:
> > > >
> > > > > [Resending as I got a 'You must be subscribed to post messages
> to
> > > this
> > > > > mailing list' message from edk2 list]
> > > > >
> > > > > Hi List,
> > > > >
> > > > > I am new to UEFI and am trying to debug my UEFI ported code
> (from
> > > u-
> > > > boot) on a ARMv7 based SoC.
> > > > > I am able to do some basic debugging of the ARM CPU init code
> > > > > using
> > > a
> > > > DS-5 debugger attached to the board.
> > > > >
> > > > > I see that the ported code crashes somewhere while making a
> > > transition
> > > > from Sec to PI phase.
> > > > > However, I can only verify this by seeing instruction level
> > > > > disassembly. I cannot figure out a way to load the source code
> > > using
> > > > the DS-5 debugger.
> > > > >
> > > > > I am used to seeing ELF files which have the debug information
> and
> > > > which can be loaded via the debugger.
> > > > > Using the 'file' command I cannot find any ELF file in the
> output
> > > > > directory 'Build/..'. The FV and FD files don't seem to be ELF
> > > files as
> > > > well.
> > > > >
> > > >
> > > > FD is short for Flash Device. So it is usually the layout of the
> ROM.
> > > You
> > > > could have multiple ROMs, but the most common thing is to just
> have
> > > > a single FD.
> > > > FV is a Firmware Volume. Basically a simple Flash Filesystem that
> > > allows
> > > > files, named by GUIDs to be discovered.
> > > >
> > > > EFI is a collection of relocatable PE/COFF images, and in general
> an
> > > INF
> > > > file (no for a library) in your project maps to a PE/COFF file
> > > getting
> > > > generated.
> > > >
> > > > It can vary by compiler, but it is common for the *.dll file to
> be
> > > the
> > > > native image with the debug info. So that is the file you want to
> > > load
> > > > symbols for.
> > > >
> > > > There are various schemes on how to do this. Some platforms print
> > > > out debug messages that map into the commands you need to load
> > symbols.
> > > Some
> > > > platforms have scripts that can load symbols.
> > > >
> > > > Sorry I don't remember the latest recommendation on which scheme
> to
> > > use
> > > > for your platform? Try looking at the *.Fv.map file as I think it
> > > > has info about how to load symbols. You would need a script to
> > > > convert
> > > this
> > > > into some format the DS-5 understands.
> > > >
> > > > Maybe the scripts in
> > > >
> > >
> https://svn.code.sf.net/p/edk2/code/trunk/edk2/ArmPlatformPkg/Scripts/
> > > D
> > > s5
> > > > / are what you are looking for?
> > >
> > > Many thanks Andrew. It seems the DS5 scripts will work for me. I
> found
> > > the wiki for the same here:
> > >
> http://sourceforge.net/apps/mediawiki/tianocore/index.php?title=ArmPkg
> > > /
> > > Ds5
> > >
> > > I will try to debug the target using these scripts and get back
> with
> > > my results.
> > >
> > > Regards,
> > > Bhupesh
> > >
> > > > Thanks,
> > > >
> > > > Andrew Fish
> > > >
> > > > > Any pointers to which ELF file is generated while compiling a
> UEFI
> > > > > BoardPkg and how it can be loaded via the debugger.
> > > > >
> > > > > Thanks for your help.
> > > > > Regards,
> > > > > Bhupesh
> > > > >
> > > > >
> > > > > ---------------------------------------------------------------
> ---
> > > > > -
> > > ---
> > > > > -------- October Webinars: Code for Performance Free Intel
> > > > > webinars can help you accelerate application performance.
> > > > > Explore tips for MPI, OpenMP, advanced profiling, and more. Get
> > > > > the most from the latest Intel processors and coprocessors. See
> > > abstracts
> > > > > and register >
> > > > >
> > >
> http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.c
> > > > > lktrk _______________________________________________
> > > > > edk2-devel mailing list
> > > > > edk2-devel(a)lists.sourceforge.net
> > > > > https://lists.sourceforge.net/lists/listinfo/edk2-devel
> > > >
> > > >
> > > > _______________________________________________
> > > > boot-architecture mailing list
> > > > boot-architecture(a)lists.linaro.org
> > > > http://lists.linaro.org/mailman/listinfo/boot-architecture
> > >
> > >
> > >
> > > -------------------------------------------------------------------
> ---
> > > -
> > > -------
> > > October Webinars: Code for Performance Free Intel webinars can help
> > > you accelerate application performance.
> > > Explore tips for MPI, OpenMP, advanced profiling, and more. Get the
> > > most from the latest Intel processors and coprocessors. See
> abstracts
> > > and register >
> > >
> http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.c
> > > l
> > > ktrk
> > > _______________________________________________
> > > edk2-devel mailing list
> > > edk2-devel(a)lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/edk2-devel
> >
> >
> >
> >
> >
> > _______________________________________________
> > boot-architecture mailing list
> > boot-architecture(a)lists.linaro.org
> > http://lists.linaro.org/mailman/listinfo/boot-architecture
>
>
Hi Bhupesh,
Yes, if you are using ARM DS-5, this is the wikipage to look at to setup
your environment to debug UEFI. Let me know if you have issue.
Regards,
Olivier
> -----Original Message-----
> From: Sharma Bhupesh-B45370 [mailto:B45370@freescale.com]
> Sent: 22 October 2013 07:56
> To: 'Andrew Fish'; 'edk2-devel(a)lists.sourceforge.net'
> Cc: 'Kim Phillips'; 'boot-architecture(a)lists.linaro.org'; Kushwaha
> Prabhakar-B32579
> Subject: Re: [edk2] Debugging Sec and PI phases {Source symbols}
>
>
> > -----Original Message-----
> > From: boot-architecture-bounces(a)lists.linaro.org [mailto:boot-
> > architecture-bounces(a)lists.linaro.org] On Behalf Of Andrew Fish
> > Sent: Tuesday, October 22, 2013 2:07 AM
> > To: edk2-devel(a)lists.sourceforge.net
> > Cc: 'Kim Phillips'; 'boot-architecture(a)lists.linaro.org'; Kushwaha
> > Prabhakar-B32579
> > Subject: Re: [edk2] Debugging Sec and PI phases {Source symbols}
> >
> >
> >
> > On Oct 21, 2013, at 11:38 AM, Sharma Bhupesh-B45370
> > <B45370(a)freescale.com> wrote:
> >
> > > [Resending as I got a 'You must be subscribed to post messages to
> this
> > > mailing list' message from edk2 list]
> > >
> > > Hi List,
> > >
> > > I am new to UEFI and am trying to debug my UEFI ported code (from
> u-
> > boot) on a ARMv7 based SoC.
> > > I am able to do some basic debugging of the ARM CPU init code using
> a
> > DS-5 debugger attached to the board.
> > >
> > > I see that the ported code crashes somewhere while making a
> transition
> > from Sec to PI phase.
> > > However, I can only verify this by seeing instruction level
> > > disassembly. I cannot figure out a way to load the source code
> using
> > the DS-5 debugger.
> > >
> > > I am used to seeing ELF files which have the debug information and
> > which can be loaded via the debugger.
> > > Using the 'file' command I cannot find any ELF file in the output
> > > directory 'Build/..'. The FV and FD files don't seem to be ELF
> files as
> > well.
> > >
> >
> > FD is short for Flash Device. So it is usually the layout of the ROM.
> You
> > could have multiple ROMs, but the most common thing is to just have a
> > single FD.
> > FV is a Firmware Volume. Basically a simple Flash Filesystem that
> allows
> > files, named by GUIDs to be discovered.
> >
> > EFI is a collection of relocatable PE/COFF images, and in general an
> INF
> > file (no for a library) in your project maps to a PE/COFF file
> getting
> > generated.
> >
> > It can vary by compiler, but it is common for the *.dll file to be
> the
> > native image with the debug info. So that is the file you want to
> load
> > symbols for.
> >
> > There are various schemes on how to do this. Some platforms print out
> > debug messages that map into the commands you need to load symbols.
> Some
> > platforms have scripts that can load symbols.
> >
> > Sorry I don't remember the latest recommendation on which scheme to
> use
> > for your platform? Try looking at the *.Fv.map file as I think it has
> > info about how to load symbols. You would need a script to convert
> this
> > into some format the DS-5 understands.
> >
> > Maybe the scripts in
> >
> https://svn.code.sf.net/p/edk2/code/trunk/edk2/ArmPlatformPkg/Scripts/D
> s5
> > / are what you are looking for?
>
> Many thanks Andrew. It seems the DS5 scripts will work for me. I found
> the wiki
> for the same here:
> http://sourceforge.net/apps/mediawiki/tianocore/index.php?title=ArmPkg/
> Ds5
>
> I will try to debug the target using these scripts and get back with my
> results.
>
> Regards,
> Bhupesh
>
> > Thanks,
> >
> > Andrew Fish
> >
> > > Any pointers to which ELF file is generated while compiling a UEFI
> > > BoardPkg and how it can be loaded via the debugger.
> > >
> > > Thanks for your help.
> > > Regards,
> > > Bhupesh
> > >
> > >
> > > -------------------------------------------------------------------
> ---
> > > -------- October Webinars: Code for Performance Free Intel webinars
> > > can help you accelerate application performance.
> > > Explore tips for MPI, OpenMP, advanced profiling, and more. Get the
> > > most from the latest Intel processors and coprocessors. See
> abstracts
> > > and register >
> > >
> http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.c
> > > lktrk _______________________________________________
> > > edk2-devel mailing list
> > > edk2-devel(a)lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/edk2-devel
> >
> >
> > _______________________________________________
> > boot-architecture mailing list
> > boot-architecture(a)lists.linaro.org
> > http://lists.linaro.org/mailman/listinfo/boot-architecture
>
>
>
> -----------------------------------------------------------------------
> -------
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the
> most from
> the latest Intel processors and coprocessors. See abstracts and
> register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.cl
> ktrk
> _______________________________________________
> edk2-devel mailing list
> edk2-devel(a)lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/edk2-devel
On Oct 21, 2013, at 11:38 AM, Sharma Bhupesh-B45370 <B45370(a)freescale.com> wrote:
> [Resending as I got a 'You must be subscribed to post messages to this mailing list' message from edk2 list]
>
> Hi List,
>
> I am new to UEFI and am trying to debug my UEFI ported code (from u-boot) on a ARMv7 based SoC.
> I am able to do some basic debugging of the ARM CPU init code using a DS-5 debugger attached to the board.
>
> I see that the ported code crashes somewhere while making a transition from Sec to PI phase.
> However, I can only verify this by seeing instruction level disassembly. I cannot figure out a way to load
> the source code using the DS-5 debugger.
>
> I am used to seeing ELF files which have the debug information and which can be loaded via the debugger.
> Using the 'file' command I cannot find any ELF file in the output directory 'Build/..'. The FV and FD
> files don't seem to be ELF files as well.
>
FD is short for Flash Device. So it is usually the layout of the ROM. You could have multiple ROMs, but the most common thing is to just have a single FD.
FV is a Firmware Volume. Basically a simple Flash Filesystem that allows files, named by GUIDs to be discovered.
EFI is a collection of relocatable PE/COFF images, and in general an INF file (no for a library) in your project maps to a PE/COFF file getting generated.
It can vary by compiler, but it is common for the *.dll file to be the native image with the debug info. So that is the file you want to load symbols for.
There are various schemes on how to do this. Some platforms print out debug messages that map into the commands you need to load symbols. Some platforms have scripts that can load symbols.
Sorry I don't remember the latest recommendation on which scheme to use for your platform? Try looking at the *.Fv.map file as I think it has info about how to load symbols. You would need a script to convert this into some format the DS-5 understands.
Maybe the scripts in https://svn.code.sf.net/p/edk2/code/trunk/edk2/ArmPlatformPkg/Scripts/Ds5/ are what you are looking for?
Thanks,
Andrew Fish
> Any pointers to which ELF file is generated while compiling a UEFI BoardPkg and how it can be loaded
> via the debugger.
>
> Thanks for your help.
> Regards,
> Bhupesh
>
>
> ------------------------------------------------------------------------------
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
> _______________________________________________
> edk2-devel mailing list
> edk2-devel(a)lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/edk2-devel
Hi Steven,
Please find attached two patches used for aarch64 work. Each patch goes
into a different topic branch in the end, not in the linaro-topic-fvp
branch as we discussed earlier. Still, they are quite simple, so shouldn't
cause much of a problem.
0001-tools_def-AARCH64-use-CROSS_COMPILE-variable.patch
The above patch goes into linaro-topic-misc.
0002-FVP-Add-support-for-EDK2_USE_ANDROID_CONFIG-build-pa.patch
The above patch goes into linaro-topic-fvp.
Please let me know if these cause you any problems, but it would be good to
get them into uefi.git for the -rc4 and the -03 release respin.
You can also pull both patches/branches from my tree:
https://git.linaro.org/gitweb?p=people/ryanharkin/uefi-next.git;a=summary
Thanks,
Ryan.
On Mon, Sep 30, 2013 at 10:28:49PM +0100, Grant Likely wrote:
> > > load image protocol. In that case the sub should override the setting in
> the
> > > FDT if the initrd argument is present.
> >
> > Hmm, well, it's slightly worse than that - it will have one; only it
> > will be GRUB's command line.
> >
> > The way that can be resolved is:
> > - FDT present?
> > - Commandline present in FDT chosen node?
> > - Yes
> > - Use that.
> > - No
> > - EFI_LOADED_IMAGE command line present?
> > - Yes
> > - Use that.
> > - No
> > - Fail miserably.
> That doesn't handle the case where firmware provides the fdt, but the kernel is
> loaded via the UEFI shell or gummiboot. In that case the stub must process both
> the loaded image arguments.
Well, unless the firmware-provided device tree contains a kernel
command line, that should work fine?
If you mean that there are two command lines to parse for the
EFI_LOADED_IMAGE (one for shell/gummiboot), surely there is a handle
in there to identify the "current" one.
/
Leif
On Mon, Sep 30, 2013 at 09:05:04PM +0100, Grant Likely wrote:
> > Handling the 2 cases is not a problem. I just don't want to handle
> > 'mixed' cases where
> > a command line and an FDT are passed to the stub, and information from
> > both is used.
> >
> > As I understand it, the two cases are:
> >
> > FDT_GUID present == GRUB case
> > * GRUB loads initrd if present
> > * GRUB provides complete FDT to stub (includes command line, hardware
> > description, initrd entry, etc.)
> > * EFI stub loads FDT using FDT_GUID, adds memory map and system table
> > pointer to FDT, starts kernel.
> > * (any command line present in EFI_LOADED_IMAGE is ignored.)
> >
> > FDT_GUID absent == current case
> > * stub loads FDT and initrd from system partition
> > * stub adds command line from EFI_LOADED_IMAGE to FDT
> > * stub adds initrd entry to FDT
> > * stub adds memory map and system table pointer to FDT, starts kernel.
> >
> > In the case of UEFI owning the FDT, and providing it to the stub,
> > where does the initrd come from? I think this adds
> > another case to handle...
> The stub will still need to process a command line if it is given one via the
> load image protocol. In that case the sub should override the setting in the
> FDT if the initrd argument is present.
Hmm, well, it's slightly worse than that - it will have one; only it
will be GRUB's command line.
The way that can be resolved is:
- FDT present?
- Commandline present in FDT chosen node?
- Yes
- Use that.
- No
- EFI_LOADED_IMAGE command line present?
- Yes
- Use that.
- No
- Fail miserably.
/
Leif