2009-08-24 Vladimir Serbinenko <phcoder@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.
This commit is contained in:
parent
16c84d744c
commit
dd103c4e04
3 changed files with 35 additions and 5 deletions
14
ChangeLog
14
ChangeLog
|
@ -1,3 +1,17 @@
|
||||||
|
2009-08-24 Vladimir Serbinenko <phcoder@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-24 Vladimir Serbinenko <phcoder@gmail.com>
|
2009-08-24 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
Let user specify NetBSD root device.
|
Let user specify NetBSD root device.
|
||||||
|
|
|
@ -29,7 +29,7 @@ enum bsd_kernel_types
|
||||||
KERNEL_TYPE_NETBSD,
|
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_ASKNAME (1 << 0) /* ask for file name to reboot from */
|
||||||
#define FREEBSD_RB_SINGLE (1 << 1) /* reboot to single user only */
|
#define FREEBSD_RB_SINGLE (1 << 1) /* reboot to single user only */
|
||||||
|
@ -157,6 +157,8 @@ struct grub_openbsd_bios_mmap
|
||||||
grub_uint64_t len;
|
grub_uint64_t len;
|
||||||
#define OPENBSD_MMAP_AVAILABLE 1
|
#define OPENBSD_MMAP_AVAILABLE 1
|
||||||
#define OPENBSD_MMAP_RESERVED 2
|
#define OPENBSD_MMAP_RESERVED 2
|
||||||
|
#define OPENBSD_MMAP_ACPI 3
|
||||||
|
#define OPENBSD_MMAP_NVS 4
|
||||||
grub_uint32_t type;
|
grub_uint32_t type;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -574,6 +574,14 @@ grub_openbsd_boot (void)
|
||||||
pm->type = OPENBSD_MMAP_AVAILABLE;
|
pm->type = OPENBSD_MMAP_AVAILABLE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case GRUB_MACHINE_MEMORY_ACPI:
|
||||||
|
pm->type = OPENBSD_MMAP_ACPI;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case GRUB_MACHINE_MEMORY_NVS:
|
||||||
|
pm->type = OPENBSD_MMAP_NVS;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
pm->type = OPENBSD_MMAP_RESERVED;
|
pm->type = OPENBSD_MMAP_RESERVED;
|
||||||
break;
|
break;
|
||||||
|
@ -589,6 +597,12 @@ grub_openbsd_boot (void)
|
||||||
pm = (struct grub_openbsd_bios_mmap *) (pa + 1);
|
pm = (struct grub_openbsd_bios_mmap *) (pa + 1);
|
||||||
grub_mmap_iterate (hook);
|
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_size = (char *) pm - (char *) pa;
|
||||||
pa->ba_next = (struct grub_openbsd_bootargs *) pm;
|
pa->ba_next = (struct grub_openbsd_bootargs *) pm;
|
||||||
pa = pa->ba_next;
|
pa = pa->ba_next;
|
||||||
|
@ -600,8 +614,8 @@ grub_openbsd_boot (void)
|
||||||
(part << OPENBSD_B_PARTSHIFT));
|
(part << OPENBSD_B_PARTSHIFT));
|
||||||
|
|
||||||
grub_unix_real_boot (entry, bootflags, bootdev, OPENBSD_BOOTARG_APIVER,
|
grub_unix_real_boot (entry, bootflags, bootdev, OPENBSD_BOOTARG_APIVER,
|
||||||
0, grub_mmap_get_upper () >> 10,
|
0, (grub_uint32_t) (grub_mmap_get_upper () >> 10),
|
||||||
grub_mmap_get_lower () >> 10,
|
(grub_uint32_t) (grub_mmap_get_lower () >> 10),
|
||||||
(char *) pa - buf, buf);
|
(char *) pa - buf, buf);
|
||||||
|
|
||||||
/* Not reached. */
|
/* Not reached. */
|
||||||
|
@ -642,8 +656,8 @@ grub_netbsd_boot (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
grub_unix_real_boot (entry, bootflags, 0, bootinfo,
|
grub_unix_real_boot (entry, bootflags, 0, bootinfo,
|
||||||
0, grub_mmap_get_upper () >> 10,
|
0, (grub_uint32_t) (grub_mmap_get_upper () >> 10),
|
||||||
grub_mmap_get_lower () >> 10);
|
(grub_uint32_t) (grub_mmap_get_lower () >> 10));
|
||||||
|
|
||||||
/* Not reached. */
|
/* Not reached. */
|
||||||
return GRUB_ERR_NONE;
|
return GRUB_ERR_NONE;
|
||||||
|
|
Loading…
Add table
Reference in a new issue