-- 
Regards
Vladimir 'phcoder' Serbinenko

Personal git repository: http://repo.or.cz/w/grub2/phcoder.git
diff --git a/ChangeLog b/ChangeLog
index a00842c..f1a0447 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
 2009-08-23  Vladimir Serbinenko  <phco...@gmail.com>
 
+       Fix OpenBSD and NetBSD support.
+
+       * include/grub/i386/bsd.h (GRUB_BSD_TEMP_BUFFER): Change to resolve
+       memory address conflict.
+       (OPENBSD_MMAP_ACPI): New definition.
+       (OPENBSD_MMAP_NVS): Likewise.
+       * loader/i386/bsd.c (grub_openbsd_boot): Support OPENBSD_MMAP_ACPI
+       and OPENBSD_MMAP_NVS.
+       Add memory map terminator
+       Explicit cast when calling grub_unix_real_boot.
+       (grub_nebsd_boot): Explicit cast when calling grub_unix_real_boot.
+
+2009-08-23  Vladimir Serbinenko  <phco...@gmail.com>
+
        * commands/search.c (search_fs): Try searching without autoload first.
        * util/grub-mkconfig_lib.in (prepare_grub_to_access_device): Load
        filesystem module explicitly for faster booting.
diff --git a/include/grub/i386/bsd.h b/include/grub/i386/bsd.h
index 117ed5c..52cff23 100644
--- a/include/grub/i386/bsd.h
+++ b/include/grub/i386/bsd.h
@@ -29,7 +29,7 @@ enum bsd_kernel_types
     KERNEL_TYPE_NETBSD,
   };
 
-#define GRUB_BSD_TEMP_BUFFER   0x68000
+#define GRUB_BSD_TEMP_BUFFER   0x80000
 
 #define FREEBSD_RB_ASKNAME     (1 << 0)  /* ask for file name to reboot from */
 #define FREEBSD_RB_SINGLE       (1 << 1)  /* reboot to single user only */
@@ -157,6 +157,8 @@ struct grub_openbsd_bios_mmap
   grub_uint64_t len;
 #define        OPENBSD_MMAP_AVAILABLE  1
 #define        OPENBSD_MMAP_RESERVED 2
+#define        OPENBSD_MMAP_ACPI       3
+#define        OPENBSD_MMAP_NVS        4
   grub_uint32_t type;
 };
 
diff --git a/loader/i386/bsd.c b/loader/i386/bsd.c
index d5f677a..2d6fe48 100644
--- a/loader/i386/bsd.c
+++ b/loader/i386/bsd.c
@@ -568,6 +568,14 @@ grub_openbsd_boot (void)
          pm->type = OPENBSD_MMAP_AVAILABLE;
          break;
 
+        case GRUB_MACHINE_MEMORY_ACPI:
+         pm->type = OPENBSD_MMAP_ACPI;
+         break;
+
+        case GRUB_MACHINE_MEMORY_NVS:
+         pm->type = OPENBSD_MMAP_NVS;
+         break;
+
        default:
          pm->type = OPENBSD_MMAP_RESERVED;
          break;
@@ -583,6 +591,12 @@ grub_openbsd_boot (void)
   pm = (struct grub_openbsd_bios_mmap *) (pa + 1);
   grub_mmap_iterate (hook);
 
+  /* Memory map terminator.  */
+  pm->addr = 0;
+  pm->len = 0;
+  pm->type = 0;
+  pm++;
+
   pa->ba_size = (char *) pm - (char *) pa;
   pa->ba_next = (struct grub_openbsd_bootargs *) pm;
   pa = pa->ba_next;
@@ -594,8 +608,8 @@ grub_openbsd_boot (void)
             (part << OPENBSD_B_PARTSHIFT));
 
   grub_unix_real_boot (entry, bootflags, bootdev, OPENBSD_BOOTARG_APIVER,
-                      0, grub_mmap_get_upper () >> 10,
-                      grub_mmap_get_lower () >> 10,
+                      0, (grub_uint32_t) (grub_mmap_get_upper () >> 10),
+                      (grub_uint32_t) (grub_mmap_get_lower () >> 10),
                       (char *) pa - buf, buf);
 
   /* Not reached.  */
@@ -623,8 +637,8 @@ grub_netbsd_boot (void)
   bootinfo->bi_data[0] = rootdev;
 
   grub_unix_real_boot (entry, bootflags, 0, bootinfo,
-                      0, grub_mmap_get_upper () >> 10,
-                      grub_mmap_get_lower () >> 10);
+                      0, (grub_uint32_t) (grub_mmap_get_upper () >> 10),
+                      (grub_uint32_t) (grub_mmap_get_lower () >> 10));
 
   /* Not reached.  */
   return GRUB_ERR_NONE;
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to