summaryrefslogtreecommitdiff
path: root/usr.sbin/vmd/loadfile_elf.c
diff options
context:
space:
mode:
authorMike Larkin <mlarkin@cvs.openbsd.org>2016-04-07 07:02:58 +0000
committerMike Larkin <mlarkin@cvs.openbsd.org>2016-04-07 07:02:58 +0000
commit63a147dfe2ca16f581feb869e0a529ab8eff51b2 (patch)
tree0224a869470a7d392eceec55579df2ad56670008 /usr.sbin/vmd/loadfile_elf.c
parentd14ef3772f1c7b656f5461cfe78d1d52b392b66a (diff)
Place a BOOTARG_END section at the end of the boot arguments list pushed
to the VM during boot. i386 guest kernels need this marker to boot, and with this diff, it is possible to install and run an OpenBSD i386 guest VM using vmm(4). Note that i386 guests require a host CPU that supports unrestricted guest mode (eg, post-Nehalem) for the time being, hopefully this can be addressed later.
Diffstat (limited to 'usr.sbin/vmd/loadfile_elf.c')
-rw-r--r--usr.sbin/vmd/loadfile_elf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/vmd/loadfile_elf.c b/usr.sbin/vmd/loadfile_elf.c
index 8d2e68b25b0..28b6b8a88c4 100644
--- a/usr.sbin/vmd/loadfile_elf.c
+++ b/usr.sbin/vmd/loadfile_elf.c
@@ -1,5 +1,5 @@
/* $NetBSD: loadfile.c,v 1.10 2000/12/03 02:53:04 tsutsui Exp $ */
-/* $OpenBSD: loadfile_elf.c,v 1.13 2016/04/05 09:33:05 mlarkin Exp $ */
+/* $OpenBSD: loadfile_elf.c,v 1.14 2016/04/07 07:02:57 mlarkin Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -366,6 +366,9 @@ push_bootargs(bios_memmap_t *memmap, size_t n)
ba[i + 1] = consdev_sz;
ba[i + 2] = consdev_sz;
memcpy(&ba[i + 3], &consdev, sizeof(bios_consdev_t));
+ i = i + 3 + (sizeof(bios_consdev_t) / 4);
+
+ ba[i] = 0xFFFFFFFF; /* BOOTARG_END */
write_mem(BOOTARGS_PAGE, ba, PAGE_SIZE);