Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Debugging efiboot



Hi Brook --

printf is implemented on top of UEFI boot services and can't be used after the call to ExitBootServices() in efi_cleanup().

Take care,
Jared


On Fri, 24 Jun 2022, Brook Milligan wrote:

I am trying to debug the BeagleBone Black port, which will not boot for me.  I would like help.

First, if anyone has a known working configuration, please let me know.  I would appreciate knowing the kernel version (ideally cvs checkout date) and the u-boot firmware version.  Ideally, you would be able to share the relevant files for me to test on hardware.  Feel free to email me off-list to avoid clutter.

Second, I would appreciate suggestions on how to debug this.  I am building systems with a cvs checkout date of 2022.06.23.00.00.00.  I have gotten these to run in qemu.  In contrast, on real hardware, I get a ?data abort? error, presumably from within efiboot.  See the original report [1], which was from a BeagleBone Enhanced (similar to the Black); however, the same occurs on the BBB.

I tried adding printf() to efiboot to see where the error occurs; one minimal example I tried is (with XXX_DEBUG_EFI_BOOT=1)

Index: bootarm/efibootarm.c
===================================================================
RCS file: /cvsroot/src/sys/stand/efiboot/bootarm/efibootarm.c,v
retrieving revision 1.3
diff -u -r1.3 efibootarm.c
--- bootarm/efibootarm.c	28 Nov 2020 14:02:09 -0000	1.3
+++ bootarm/efibootarm.c	24 Jun 2022 22:51:08 -0000
@@ -49,6 +49,10 @@
{
	u_long kernel_size;

+#if XXX_DEBUG_EFI_BOOT
+	printf("%s:%d: %s():\n",__FILE__,__LINE__,__FUNCTION__);
+#endif
+
	kernel_size = marks[MARK_END] - marks[MARK_START];

	armv7_dcache_wbinv_range(marks[MARK_START], kernel_size);

However, that single change causes a data abort error, even in qemu.  Here is a script of making and running the boot image in qemu:

gzip -c -d < /path/to/release/evbarm-earmv7hf/binary/gzimg/armv7.img.gz > /tmp/armv7.img

env INSTALLBOOT_UBOOT_PATHS=/path/to/pkg-current/share/u-boot  /path/to/tools/bin/nbinstallboot  -m evbarm -o board=ti,am335x-bone-black  /tmp/armv7.img

qemu-system-arm  -M virt  -cpu cortex-a7  -smp 4 -m 2g  -drive if=none,file=/tmp/armv7.img,id=hd0  -device virtio-blk-device,drive=hd0  -netdev type=user,id=net0  -device virtio-net-device,netdev=net0,mac=00:11:22:33:44:55  -bios QEMU_EFI.fd  -nographic

WARNING: Image format was not specified for '/tmp/armv7.img' and probing guessed raw.
        Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
        Specify the 'raw' format explicitly to remove the restrictions.
BdsDxe: failed to load Boot0001 "UEFI Misc Device" from VenHw(93E34C7E-B50E-11DF-9223-2443DFD72085,00): Not Found
BdsDxe: loading Boot0002 "UEFI Misc Device 2" from VenHw(837DCA9E-E874-4D82-B29A-23FE0E23D1E2,003E000A00000000)
BdsDxe: starting Boot0002 "UEFI Misc Device 2" from VenHw(837DCA9E-E874-4D82-B29A-23FE0E23D1E2,003E000A00000000)

 \\-__,------,___.
  \\        __,---`  NetBSD/evbarm efiboot (arm)
   \\       `---,_.  Revision 2.13 (Fri Jun 24 17:05:10 UTC 2022)
    \\-,_____,.---`
     \\
      \\
       \\

Press return to boot now, any other key for boot prompt
booting netbsd - starting in 5 seconds. 4 seconds. 3 seconds. 2 seconds. 1 seconds. 0 seconds.
9159700+2455136+1395104 [467458+757776+576954]=0xe24710

Data Abort Exception PC at 0xBC14F54C  CPSR 0x200001D3

Note that the same steps run the system fine when the single printf() above is absent.

This is my first attempts to use QEMU, so please offer any help there as well.

At this point, I am not sure how I can debug the system, as I cannot figure out where the error is.

Any help is greatly appreciated.

Thanks a lot.

Cheers,
Brook







Home | Main Index | Thread Index | Old Index