#!/bin/csh

set TARGET="amd64"

if ( ${TARGET} == "amd64" ) then
	set QTARGET="x86_64"
	set QCPU="Haswell"
else
	set QTARGET=${TARGET}
	set QCPU="qemu32"
endif
set FREEBSD_PREFIX="/usr/data/sys/freebsd/"
set QEMU_PREFIX="/usr/local"

set QEMU="${QEMU_PREFIX}/bin/qemu"
set QEMU_BIN="${QEMU_PREFIX}/bin/qemu-system-${QTARGET}"
set QEMU_OPTIONS="-cpu ${QCPU},enforce,-smap,+smep,-hypervisor -m 1024M"

set FREEBSD_VMIMAGE="freebsd-${TARGET}.raw"

${QEMU_BIN} ${QEMU_OPTIONS} -hda ${FREEBSD_PREFIX}/${FREEBSD_VMIMAGE}
