Discussion:
loader.efi does not boot on Lenovo Yoga C630
Hiroo Ono
2021-05-01 03:32:04 UTC
Permalink
Hello,

I am trying to install FreeBSD/aarch64 to Lenovo Yoga C630 (81JL0012JP).
It has Snapdragon 850 as the processor.

I tried the 13.0R image, the UEFI BIOS recognizes the EFI partition,
but loader.efi does not start at all. The screen stays blank.
I added the following code to efi_main(), but still there is no text
output.

diff --git a/stand/efi/loader/efi_main.c b/stand/efi/loader/efi_main.c
index fa3c765c3..f5174ec23 100644
--- a/stand/efi/loader/efi_main.c
+++ b/stand/efi/loader/efi_main.c
@@ -91,6 +91,10 @@ efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE
*system_table)
(void)console_control->SetMode(console_control,
EfiConsoleControlScreenText);

+ status = ST->ConOut->TestString(ST->ConOut, (CHAR16 *)L"Test\r\n");
+ if (status == EFI_SUCCESS)
+ ST->ConOut->OutputString(ST->ConOut, (CHAR16
*)L"Test\r\n");
+
heapsize = 64 * 1024 * 1024;
status = BS->AllocatePages(AllocateAnyPages, EfiLoaderData,
EFI_SIZE_TO_PAGES(heapsize), &heap);


For other UEFI applications, grub2 works and UEFI Shell of EDK II does not
work.
Is there anything I can do to let loader.efi run?
Greg V
2021-05-01 08:13:32 UTC
Permalink
Post by Hiroo Ono
Hello,
I am trying to install FreeBSD/aarch64 to Lenovo Yoga C630 (81JL0012JP).
It has Snapdragon 850 as the processor.
I tried the 13.0R image, the UEFI BIOS recognizes the EFI partition,
but loader.efi does not start at all. The screen stays blank.
I added the following code to efi_main(), but still there is no text
output.
Qualcomm firmware has an alignment requirement, see

https://lists.gnu.org/archive/html/grub-devel/2018-12/msg00055.html
https://github.com/tianocore/edk2/commit/de3c440e8a54c201c527b85da7b89d58486ece4d
Hiroo Ono via freebsd-arm
2021-05-02 22:23:15 UTC
Permalink
Thank you.
Post by Greg V
Post by Hiroo Ono
Hello,
I am trying to install FreeBSD/aarch64 to Lenovo Yoga C630 (81JL0012JP).
It has Snapdragon 850 as the processor.
I tried the 13.0R image, the UEFI BIOS recognizes the EFI partition,
but loader.efi does not start at all. The screen stays blank.
I added the following code to efi_main(), but still there is no text
output.
Qualcomm firmware has an alignment requirement, see
https://lists.gnu.org/archive/html/grub-devel/2018-12/msg00055.html
https://github.com/tianocore/edk2/commit/de3c440e8a54c201c527b85da7b89d58486ece4d
I understand what needs to be done, but I still do not know how to do it.
I changed the following:
in stand/defs.mk:
CFLAGS.clang += -mcmodel=small

in stand/efi/loader/Makefile:
LDFLAGS+=
-Wl,-T${LDSCRIPT},-Bsymbolic,-znotext,-zcommon-page-size=0x1000 -pie

But resulting loader_lua.efi and boot1.efi did not run.
What else should I do?

Loading...