diff --git a/grub-core/kern/efi/acpi.c b/grub-core/kern/efi/acpi.c
index 828e6dbb2..dd88f388d 100644
--- a/grub-core/kern/efi/acpi.c
+++ b/grub-core/kern/efi/acpi.c
@@ -35,3 +35,19 @@ grub_machine_acpi_get_rsdpv2 (void)
 
   return (struct grub_acpi_rsdp_v20 *) grub_efi_find_configuration_table (&acpi20_guid);
 }
+
+grub_addr_t
+grub_machine_acpi_get_smbios (void)
+{
+  static grub_guid_t smbios_guid = GRUB_EFI_SMBIOS_TABLE_GUID;
+
+  return (grub_addr_t) grub_efi_find_configuration_table (&smbios_guid);
+}
+
+grub_addr_t
+grub_machine_acpi_get_system_resource (void)
+{
+  static grub_guid_t srt_guid = GRUB_EFI_SYSTEM_RESOURCE_TABLE_GUID;
+
+  return (grub_addr_t) grub_efi_find_configuration_table (&srt_guid);
+}
diff --git a/grub-core/loader/i386/bsd.c b/grub-core/loader/i386/bsd.c
index 1f9128f6f..d0f5e9dd0 100644
--- a/grub-core/loader/i386/bsd.c
+++ b/grub-core/loader/i386/bsd.c
@@ -40,6 +40,7 @@
 #ifdef GRUB_MACHINE_PCBIOS
 #include <grub/machine/int.h>
 #endif
+#include <grub/acpi.h>
 
 GRUB_MOD_LICENSE ("GPLv3+");
 
@@ -50,6 +51,7 @@ GRUB_MOD_LICENSE ("GPLv3+");
 #ifdef GRUB_MACHINE_EFI
 #include <grub/efi/efi.h>
 #define NETBSD_DEFAULT_VIDEO_MODE "800x600"
+#define OPENBSD_DEFAULT_VIDEO_MODE "800x600"
 #else
 #define NETBSD_DEFAULT_VIDEO_MODE "text"
 #include <grub/i386/pc/vbe.h>
@@ -811,6 +813,194 @@ grub_freebsd_boot (void)
   return GRUB_ERR_NONE;
 }
 
+#ifdef GRUB_MACHINE_EFI
+typedef struct grub_openbsd_bootargs_bios_mmap bios_memmap_t;
+
+bios_memmap_t            bios_memmap[128];
+grub_efi_uintn_t         mmap_key;
+
+#define NEXT_MEMORY_DESCRIPTOR(desc, size)	\
+  ((grub_efi_memory_descriptor_t *) ((char *) (desc) + (size)))
+
+static grub_err_t
+grub_openbsd_efi_memprobe_internal(struct grub_openbsd_bootarg_efiinfo
+				   *bios_efiinfo)
+{
+  grub_err_t               status;
+  grub_efi_uintn_t         mapkey, mmsiz, siz;
+  grub_efi_uint32_t        mmver;
+  grub_efi_memory_descriptor_t *mm0, *mm;
+  unsigned int             cnvmem, extmem;
+  int                      i, n;
+  bios_memmap_t           *bm, bm0;
+  int                      error = 0;
+
+  cnvmem = extmem = 0;
+  bios_memmap[0].type = OPENBSD_BIOS_MAP_END;
+
+  if (bios_efiinfo -> mmap_start != 0)
+    grub_free((void *)bios_efiinfo -> mmap_start);
+
+  siz = 0;
+  status = grub_efi_get_memory_map(&siz, NULL, &mapkey, &mmsiz, &mmver);
+  if (status != 0)
+    return -1;
+  mm0 = grub_malloc (siz);
+  status = grub_efi_get_memory_map(&siz, mm0, &mapkey, &mmsiz, &mmver);
+  if (status != 1)
+    return -1;
+  n = siz / mmsiz;
+  mmap_key = mapkey;
+
+  for (i = 0, mm = mm0; i < n; i++, mm = NEXT_MEMORY_DESCRIPTOR(mm, mmsiz))
+    {
+      bm0.type = OPENBSD_BIOS_MAP_END;
+      bm0.addr = mm->physical_start;
+      bm0.size = mm->num_pages * GRUB_EFI_PAGE_SIZE;
+      switch (mm->type) {
+      case GRUB_EFI_RESERVED_MEMORY_TYPE:
+      case GRUB_EFI_UNUSABLE_MEMORY:
+      case GRUB_EFI_RUNTIME_SERVICES_CODE:
+      case GRUB_EFI_RUNTIME_SERVICES_DATA:
+	bm0.type = OPENBSD_BIOS_MAP_RES;
+	break;
+      case GRUB_EFI_LOADER_CODE:
+      case GRUB_EFI_LOADER_DATA:
+      case GRUB_EFI_BOOT_SERVICES_CODE:
+      case GRUB_EFI_BOOT_SERVICES_DATA:
+      case GRUB_EFI_CONVENTIONAL_MEMORY:
+	bm0.type = OPENBSD_BIOS_MAP_FREE;
+	break;
+      case GRUB_EFI_ACPI_RECLAIM_MEMORY:
+	bm0.type = OPENBSD_BIOS_MAP_ACPI;
+	break;
+      case GRUB_EFI_ACPI_MEMORY_NVS:
+	bm0.type = OPENBSD_BIOS_MAP_NVS;
+	break;
+      default:
+	/*
+	 * XXX Is there anything to do for EfiMemoryMappedIO
+	 * XXX EfiMemoryMappedIOPortSpace EfiPalCode?
+	 */
+	bm0.type = OPENBSD_BIOS_MAP_RES;
+      }
+      for (bm = bios_memmap; bm->type != OPENBSD_BIOS_MAP_END; bm++)
+	{
+	  if (bm->type != bm0.type)
+	    continue;
+	  if (bm->addr <= bm0.addr &&
+	      bm0.addr <= bm->addr + bm->size) {
+	    bm->size = bm0.addr + bm0.size - bm->addr;
+	    break;
+	  } else if (bm0.addr <= bm->addr &&
+		     bm->addr <= bm0.addr + bm0.size) {
+	    bm->size = bm->addr + bm->size - bm0.addr;
+	    bm->addr = bm0.addr;
+	    break;
+	  }
+	}
+      if (bm->type == OPENBSD_BIOS_MAP_END) {
+	if (bm == &bios_memmap[sizeof(bios_memmap)/sizeof(bios_memmap[0]) - 1]) {
+	  error = GRUB_ERR_OUT_OF_MEMORY;
+	  break;
+	}
+	*bm = bm0;
+	(++bm)->type = OPENBSD_BIOS_MAP_END;
+      }
+    }
+
+  for (bm = bios_memmap; bm->type != OPENBSD_BIOS_MAP_END; bm++) {
+    if (bm->addr < OPENBSD_IOM_BEGIN)       /* Below memory hole */
+      cnvmem =
+	grub_max(cnvmem, (bm->addr + bm->size) / 1024);
+    if (bm->addr >= OPENBSD_IOM_END /* Above the memory hole */ &&
+	bm->addr / 1024 == extmem + 1024)
+      extmem += bm->size / 1024;
+  }
+
+  bios_efiinfo -> mmap_desc_ver = mmver;
+  bios_efiinfo -> mmap_desc_size = mmsiz;
+  bios_efiinfo -> mmap_size = siz;
+  bios_efiinfo -> mmap_start = (grub_addr_t)mm0;
+
+  return error;
+}
+
+static grub_err_t
+grub_openbsd_set_efiinfo (void)
+{
+  struct grub_video_mode_info mode_info;
+  void *framebuffer;
+  const char *modevar;
+  struct grub_openbsd_bootarg_efiinfo params;
+  grub_err_t err;
+  grub_video_driver_id_t driv_id;
+
+  grub_memset(&params, 0, sizeof(params));
+
+  params.config_acpi = (grub_addr_t)grub_machine_acpi_get_rsdpv2 ();
+  params.config_smbios = grub_machine_acpi_get_smbios ();
+  params.config_esrt = grub_machine_acpi_get_system_resource ();
+  params.system_table = (grub_addr_t)grub_efi_system_table;
+
+#ifdef __x86_64__
+  if (params.config_acpi)
+    params.flags |= BEI_64BIT;
+#endif
+
+  if (params.config_esrt)
+    params.flags |= BEI_ESRT;
+
+  grub_openbsd_efi_memprobe_internal(&params);
+
+  modevar = grub_env_get ("gfxpayload");
+
+  /* Now all graphical modes are acceptable.
+     May change in future if we have modes without framebuffer.  */
+  if (modevar && *modevar != 0)
+    {
+      char *tmp;
+      tmp = grub_xasprintf ("%s;" OPENBSD_DEFAULT_VIDEO_MODE, modevar);
+      if (! tmp)
+	return grub_errno;
+      err = grub_video_set_mode (tmp, 0, 0);
+      grub_free (tmp);
+    }
+  else
+    err = grub_video_set_mode (OPENBSD_DEFAULT_VIDEO_MODE, 0, 0);
+
+  if (err)
+    return err;
+
+  driv_id = grub_video_get_driver_id ();
+  if (driv_id == GRUB_VIDEO_DRIVER_NONE)
+    return GRUB_ERR_NONE;
+
+  err = grub_video_get_info_and_fini (&mode_info, &framebuffer);
+
+  if (err)
+    return err;
+
+  params.fb_width = mode_info.width;
+  params.fb_height = mode_info.height;
+  params.fb_pixpsl = mode_info.pitch / mode_info.bytes_per_pixel;
+
+  params.fb_addr = (grub_addr_t) framebuffer;
+
+  params.fb_red_mask =
+    ((1 << mode_info.red_mask_size) - 1) << mode_info.red_field_pos;
+  params.fb_green_mask =
+    ((1 << mode_info.green_mask_size) - 1) << mode_info.green_field_pos;
+  params.fb_blue_mask =
+    ((1 << mode_info.blue_mask_size) - 1) << mode_info.blue_field_pos;
+  params.fb_reserved_mask =
+    ((1 << mode_info.reserved_mask_size) - 1) << mode_info.reserved_field_pos;
+
+  err = grub_bsd_add_meta (OPENBSD_BOOTARG_EFIINFO, &params, sizeof (params));
+  return err;
+}
+#endif
+
 static grub_err_t
 grub_openbsd_boot (void)
 {
@@ -825,6 +1015,10 @@ grub_openbsd_boot (void)
   if (err)
     return err;
 
+#ifdef GRUB_MACHINE_EFI
+  grub_openbsd_set_efiinfo ();
+#endif
+
 #ifdef GRUB_MACHINE_PCBIOS
   {
     struct grub_bios_int_registers regs;
@@ -899,7 +1093,9 @@ grub_openbsd_boot (void)
     head->ba_next = 0;
   }
 
+#ifdef GRUB_MACHINE_PCBIOS
   grub_video_set_mode ("text", 0, 0);
+#endif
 
 #ifdef GRUB_MACHINE_EFI
   err = grub_efi_finish_boot_services (NULL, NULL, NULL, NULL, NULL);
diff --git a/include/grub/acpi.h b/include/grub/acpi.h
index 17aadb802..8cf1999f7 100644
--- a/include/grub/acpi.h
+++ b/include/grub/acpi.h
@@ -235,6 +235,8 @@ struct grub_acpi_rsdp_v10 *grub_acpi_get_rsdpv1 (void);
 struct grub_acpi_rsdp_v20 *grub_acpi_get_rsdpv2 (void);
 struct grub_acpi_rsdp_v10 *EXPORT_FUNC(grub_machine_acpi_get_rsdpv1) (void);
 struct grub_acpi_rsdp_v20 *EXPORT_FUNC(grub_machine_acpi_get_rsdpv2) (void);
+grub_addr_t EXPORT_FUNC(grub_machine_acpi_get_smbios) (void);
+grub_addr_t EXPORT_FUNC(grub_machine_acpi_get_system_resource) (void);
 grub_uint8_t EXPORT_FUNC(grub_byte_checksum) (void *base, grub_size_t size);
 
 grub_err_t grub_acpi_create_ebda (void);
diff --git a/include/grub/i386/openbsd_bootarg.h b/include/grub/i386/openbsd_bootarg.h
index 8c28246d5..ee1914bd1 100644
--- a/include/grub/i386/openbsd_bootarg.h
+++ b/include/grub/i386/openbsd_bootarg.h
@@ -63,6 +63,7 @@
 #define	OPENBSD_BOOTARG_MMAP	0
 #define	OPENBSD_BOOTARG_PCIBIOS 4
 #define	OPENBSD_BOOTARG_CONSOLE 5
+#define	OPENBSD_BOOTARG_EFIINFO	11
 
 struct grub_openbsd_bootargs
 {
@@ -79,6 +80,24 @@ struct grub_openbsd_bootarg_console
   grub_uint32_t frequency;
 };
 
+struct grub_openbsd_bootargs_bios_mmap {
+  grub_uint64_t addr;          /* Beginning of block */
+  grub_uint64_t size;          /* Size of block */
+  grub_uint32_t type;          /* Type of block */
+} GRUB_PACKED;
+
+/*
+ * OPENBSDBIOS memory maps
+ */
+#define OPENBSD_BIOS_MAP_END    0x00    /* End of array XXX - special */
+#define OPENBSD_BIOS_MAP_FREE   0x01    /* Usable memory */
+#define OPENBSD_BIOS_MAP_RES    0x02    /* Reserved memory */
+#define OPENBSD_BIOS_MAP_ACPI   0x03    /* ACPI Reclaim memory */
+#define OPENBSD_BIOS_MAP_NVS    0x04    /* ACPI NVS memory */
+
+#define OPENBSD_IOM_BEGIN       0x0a0000     /* Start of I/O Memory "hole" */
+#define OPENBSD_IOM_END         0x100000     /* End of I/O Memory "hole" */
+
 struct grub_openbsd_bootarg_pcibios
 {
   grub_uint32_t characteristics;
@@ -87,6 +106,30 @@ struct grub_openbsd_bootarg_pcibios
   grub_uint32_t last_bus;
 };
 
+struct grub_openbsd_bootarg_efiinfo
+{
+  grub_uint64_t        config_acpi;
+  grub_uint64_t        config_smbios;
+  grub_uint64_t        fb_addr;
+  grub_uint64_t        fb_size;
+  grub_uint32_t        fb_height;
+  grub_uint32_t        fb_width;
+  grub_uint32_t        fb_pixpsl;      /* pixels per scan line */
+  grub_uint32_t        fb_red_mask;
+  grub_uint32_t        fb_green_mask;
+  grub_uint32_t        fb_blue_mask;
+  grub_uint32_t        fb_reserved_mask;
+  grub_uint32_t        flags;
+#define BEI_64BIT       0x00000001      /* 64-bit EFI implementation */
+#define BEI_ESRT        0x00000002      /* ESRT table */
+  grub_uint32_t        mmap_desc_ver;
+  grub_uint32_t        mmap_desc_size;
+  grub_uint32_t        mmap_size;
+  grub_uint64_t        mmap_start;
+  grub_uint64_t        system_table;
+  grub_uint64_t        config_esrt;
+} GRUB_PACKED;
+
 #define GRUB_OPENBSD_COM_MAJOR 8
 #define GRUB_OPENBSD_VGA_MAJOR 12
 
