Hi,

On Thu, 17 Sep 2015 20:47:22 -0500
Brian Conway <bcon...@rcesoftware.com> wrote:
> The NUC 2820 I was previously testing snapshots with has moved on to a
> better place (and lacked any meaningful serial console support), but
> here are some logs from an MSI AM1I motherboard, both the attempted
> UEFI boot and the successful BIOS boot. It also appears to hang during
> kernel load. Let me know if I can provide any more info.

Can you try the diff following or

  http://yasuoka.net/~yasuoka/BOOTX64.EFI

?  Then enter "machine memory" on "boot> " prompt and check the last line.
It shows whether the memory area for kernel is free or not.  Like

  Load address: Conventional(7) 0xXXXX for xxxxKB

is good sign.

> Side note: Is com0 console not yet support by EFIBOOT? I got an error
> along those lines when attempting 'set tty com0', I assume this is
> already known.

No, it's not supported yet.

> boot> machine disk
> Disk    BIOS#   Type    Cyls    Heads   Secs    Flags   Checksum
> hd0     0x80    label   956     64      32      0x2     0xe4afa028
> hd1     0x81    label   1023    255     63      0x0     0x0
> boot>

Isn't this a result of BIOS boot?

Index: sys/arch/amd64/stand/efiboot/efiboot.c
===================================================================
RCS file: /disk/cvs/openbsd/src/sys/arch/amd64/stand/efiboot/efiboot.c,v
retrieving revision 1.3
diff -u -p -u -p -r1.3 efiboot.c
--- sys/arch/amd64/stand/efiboot/efiboot.c      3 Sep 2015 09:22:40 -0000       
1.3
+++ sys/arch/amd64/stand/efiboot/efiboot.c      22 Sep 2015 10:35:40 -0000
@@ -193,6 +193,7 @@ next:
  * Memory
  ***********************************************************************/
 bios_memmap_t           bios_memmap[64];
+static int              efi_badloadaddr = 0;
 
 static void
 efi_heap_init(void)
@@ -224,6 +225,8 @@ efi_memprobe(void)
                                printf("%uK", bm->size / 1024);
                }
        }
+       if (efi_badloadaddr)
+               printf(" BAD");
        printf("]");
 }
 
@@ -233,9 +236,10 @@ efi_memprobe_internal(void)
        EFI_STATUS               status;
        UINTN                    mapkey, mmsiz, siz;
        UINT32                   mmver;
+       UINT64                   pend;
        EFI_MEMORY_DESCRIPTOR   *mm0, *mm;
        int                      i, n;
-       bios_memmap_t            *bm, bm0;
+       bios_memmap_t           *bm, bm0;
 
        cnvmem = extmem = 0;
        bios_memmap[0].type = BIOS_MAP_END;
@@ -255,6 +259,11 @@ efi_memprobe_internal(void)
                bm0.type = BIOS_MAP_END;
                bm0.addr = mm->PhysicalStart;
                bm0.size = mm->NumberOfPages * EFI_PAGE_SIZE;
+               pend = mm->PhysicalStart + mm->NumberOfPages * EFI_PAGE_SIZE;
+               if (!(pend <= 0x1000000 || 0x2000000 < mm->PhysicalStart) &&
+                   mm->Type != EfiConventionalMemory)
+                       efi_badloadaddr = 1;
+
                if (mm->Type == EfiReservedMemoryType ||
                    mm->Type == EfiUnusableMemory ||
                    mm->Type == EfiRuntimeServicesCode ||
@@ -614,5 +623,49 @@ int
 Xpoweroff_efi(void)
 {
        EFI_CALL(RS->ResetSystem, EfiResetShutdown, EFI_SUCCESS, 0, NULL);
+       return (0);
+}
+
+int
+Xmemory_efi(void)
+{
+       EFI_STATUS               status;
+       UINTN                    mapkey, mmsiz, siz;
+       UINT32                   mmver;
+       UINT64                   pend;
+       EFI_MEMORY_DESCRIPTOR   *mm0, *mm;
+       int                      i, n;
+       const char              *typestr;
+
+       siz = 0;
+       status = EFI_CALL(BS->GetMemoryMap, &siz, NULL, &mapkey, &mmsiz,
+               &mmver);
+       if (status != EFI_BUFFER_TOO_SMALL)
+               panic("cannot get the size of memory map");
+       mm0 = alloc(siz);
+       status = EFI_CALL(BS->GetMemoryMap, &siz, mm0, &mapkey, &mmsiz, &mmver);
+       if (status != EFI_SUCCESS)
+               panic("cannot get the memory map");
+       n = siz / mmsiz;
+       mmap_key = mapkey;
+
+       for (i = 0, mm = mm0; i < n; i++, mm = NextMemoryDescriptor(mm, mmsiz)){
+               pend = mm->PhysicalStart + mm->NumberOfPages * EFI_PAGE_SIZE;
+               if (pend <= 0x1000000 || 0x2000000 < mm->PhysicalStart)
+                       continue;
+               typestr = 
+                   (mm->Type == EfiLoaderCode)? "Loader Code " :
+                   (mm->Type == EfiLoaderData)? "Loader Data " :
+                   (mm->Type == EfiBootServicesCode)? "BS Code     " :
+                   (mm->Type == EfiBootServicesData)? "BS Data     " :
+                   (mm->Type == EfiConventionalMemory)? "Conventional" :
+                   "Other";
+               printf("Load address: %s(%d) 0x%llx for %uKB%s\n",
+                   typestr, mm->Type, mm->PhysicalStart,
+                   (unsigned)((mm->NumberOfPages * EFI_PAGE_SIZE) / 1024),
+                   (mm->Type != EfiConventionalMemory)? " FATAL" : "");
+       }
+       free(mm0, siz);
+
        return (0);
 }
Index: sys/arch/amd64/stand/efiboot/efiboot.h
===================================================================
RCS file: /disk/cvs/openbsd/src/sys/arch/amd64/stand/efiboot/efiboot.h,v
retrieving revision 1.1
diff -u -p -u -p -r1.1 efiboot.h
--- sys/arch/amd64/stand/efiboot/efiboot.h      2 Sep 2015 01:52:25 -0000       
1.1
+++ sys/arch/amd64/stand/efiboot/efiboot.h      22 Sep 2015 10:35:40 -0000
@@ -28,6 +28,7 @@ int    efi_cons_getshifts(dev_t dev);
 int     Xvideo_efi(void);
 int     Xexit_efi(void);
 void    efi_makebootargs(void);
+int     Xmemory_efi(void);
 
 int     Xpoweroff_efi(void);
 
Index: sys/arch/amd64/stand/libsa/cmd_i386.c
===================================================================
RCS file: /disk/cvs/openbsd/src/sys/arch/amd64/stand/libsa/cmd_i386.c,v
retrieving revision 1.8
diff -u -p -u -p -r1.8 cmd_i386.c
--- sys/arch/amd64/stand/libsa/cmd_i386.c       18 Sep 2015 13:30:56 -0000      
1.8
+++ sys/arch/amd64/stand/libsa/cmd_i386.c       22 Sep 2015 10:35:40 -0000
@@ -215,6 +215,9 @@ Xmemory(void)
        }
 
        dump_biosmem(NULL);
+#ifdef EFIBOOT
+       Xmemory_efi();
+#endif
 
        return 0;
 }

Reply via email to