I implemented standalone binary loader for BHyVe.
This allows to load custom program on guest memory area, and run it from
specified entry point address.
I wrote this for test code of BHyVe suspend/resume project(Yoneji Iori's
work), but it might be useful for some other purposes.

This is a patch:

Most of the code is borrowed from userboot, but userboot looks like only
for FreeBSD kernel, so I copied those code to bhyveload instead of
modifying userboot APIs.

Here's a example of usage:
 echo "main:" > test.S
 echo "inb \$0x50, %al" >> test.S
 as -o test.o test.S
 objcopy -I elf64-x86-64-freebsd -O binary test.o test.bin
 sudo bhyveload -m 256 -S test.bin:0x7c00 test
 sudo bhyve -m 256 -e test
 # bhyve says "Unhandled inb 0x0050", because there's no inb 0x50 handler.

Another example of usage:
 svn co svn://svn.freebsd.org/base/user/syuu/bhyve_standalone_guest_test1
 cd bhyve_standalone_guest_test1
 make run
 # because test1 is COM1 test program, bhyve continues to show asterisk on
the console.
freebsd-virtualization@freebsd.org mailing list
To unsubscribe, send any mail to 

Reply via email to