Pass PCIINFO on BIOS to OpenBSD since otherwise it fails to boot
on some qemu versions with GRUB. * include/grub/i386/openbsd_bootarg.h (OPENBSD_BOOTARG_PCIBIOS): New define. (grub_openbsd_bootarg_pcibios): New struct. * grub-core/loader/i386/bsd.c (grub_openbsd_boot) [GRUB_MACHINE_PCBIOS]: Add PCIINFO.
This commit is contained in:
parent
08a14e0b71
commit
c5c81ff978
3 changed files with 52 additions and 0 deletions
|
@ -35,6 +35,9 @@
|
|||
#include <grub/ns8250.h>
|
||||
#include <grub/bsdlabel.h>
|
||||
#include <grub/crypto.h>
|
||||
#ifdef GRUB_MACHINE_PCBIOS
|
||||
#include <grub/machine/int.h>
|
||||
#endif
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
|
@ -809,6 +812,35 @@ grub_openbsd_boot (void)
|
|||
if (err)
|
||||
return err;
|
||||
|
||||
#ifdef GRUB_MACHINE_PCBIOS
|
||||
{
|
||||
struct grub_bios_int_registers regs;
|
||||
|
||||
regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT;
|
||||
|
||||
regs.ebx = 0;
|
||||
regs.ecx = 0;
|
||||
regs.eax = 0xb101;
|
||||
regs.es = 0;
|
||||
regs.edi = 0;
|
||||
regs.edx = 0;
|
||||
|
||||
grub_bios_interrupt (0x1a, ®s);
|
||||
if (regs.edx == 0x20494350)
|
||||
{
|
||||
struct grub_openbsd_bootarg_pcibios pcibios;
|
||||
|
||||
pcibios.characteristics = regs.eax & 0xff;
|
||||
pcibios.revision = regs.ebx & 0xffff;
|
||||
pcibios.pm_entry = regs.edi;
|
||||
pcibios.last_bus = regs.ecx & 0xff;
|
||||
|
||||
grub_bsd_add_meta (OPENBSD_BOOTARG_PCIBIOS, &pcibios,
|
||||
sizeof (pcibios));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
{
|
||||
struct bsd_tag *tag;
|
||||
tag_buf_len = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue