Modifications to the grub-emu target of grub2 to
bring in i386 Linux and *BSD loaders, and to use
bhyve for target memory allocation and boot state
setup.

Similar in function to bhyveload, and intended to
be used as a debug tool for Linux and Open/NetBSD.

To build:

1. Make sure the following libraries are installed:

     gcc-4.7.4.20130810 - gcc 4.7
     gdb-7.6		- recent gdb, needed for 4.7
     flex-2.5.37_1	- base system flex doesn't work
     bison-2.7.1,1	- needed by build
     gmake-3.82_1	- grub is GNU s/w

2. ./configure --with-platform=emu CC=gcc47 LEX=/usr/local/bin/flex

3. gmake

4. Executable is grub-core/grub-emu


To run, a configuration file, "device.map", has to be created that maps
a grub hard-drive identifier with an image file e.g.

(hd0)  /path/to/image-file

The location of this file is passed to grub-emu with the '-m' option.

The root device has to be specified on the command-line with the '-r'
parameter. Note that the "(host)" device corresponds to the host
filesystem, starting at '/'. This can be used to loader kernels/initrd's
from host directories rather than a filesystem image. 

bhyve guest memory is passed in with the '-M' option, in units of MB.

The guest VM name is the mandatory final parameter.

   grub-emu -r hd0 -m /path/to/device.map -M 1024 my-vm


