| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- --- boot/source/bootloader.c
- +++ boot/source/bootloader.c
- @@ -231,10 +231,14 @@
- &LoadedImageProtocol,
- (VOID **)&loaded_image
- );
- - if (EFI_ERROR(status)) return status;
- + if (EFI_ERROR(status)) {
- + Print(L"HandleProtocol LoadedImage error: %r\n", status);
- + uefi_call_wrapper(SystemTable->BootServices->Stall, 1, 5000000);
- + return status;
- + }
-
- EFI_DEVICE_PATH *kernel_path = FileDevicePath(loaded_image->DeviceHandle, L"\\EFI\\BOOT\\bzImage");
- - if (kernel_path == NULL) return EFI_OUT_OF_RESOURCES;
- + if (kernel_path == NULL) { Print(L"Kernel path null\n"); return EFI_OUT_OF_RESOURCES; }
-
- EFI_HANDLE kernel_img = NULL;
- status = uefi_call_wrapper(
- @@ -247,7 +251,11 @@
- 0,
- &kernel_img
- );
- - if (EFI_ERROR(status)) return status;
- + if (EFI_ERROR(status)) {
- + Print(L"LoadImage kernel error: %r\n", status);
- + uefi_call_wrapper(SystemTable->BootServices->Stall, 1, 5000000);
- + return status;
- + }
-
- // 5. Play the boot animation (expanding nucleus) from ESP
- if (gop) {
- @@ -254,6 +262,9 @@
- VOID *anim_buffer = NULL;
- UINTN anim_size = 0;
- status = read_file_from_esp(ImageHandle, SystemTable, L"\\EFI\\BOOT\\animation.bin", &anim_buffer, &anim_size);
- + if (EFI_ERROR(status)) {
- + Print(L"read_file_from_esp error: %r\n", status);
- + }
- if (!EFI_ERROR(status)) {
- UINTN num_frames = 60;
- UINTN expected_size = num_frames * anim_width * anim_height * sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
- @@ -293,6 +304,8 @@
- }
- uefi_call_wrapper(SystemTable->BootServices->FreePages, 2, (EFI_PHYSICAL_ADDRESS)(UINTN)anim_buffer, (anim_size + 4095) / 4096);
- }
- + } else {
- + Print(L"GOP is NULL!\n");
- }
-
- // 6. Set command line options for the kernel
|