#! /bin/sh

HERE=`dirname $0`
case "$HERE" in
/*)
    ;;
*)
    HERE=$PWD/$HERE
    ;;
esac

#export SDL_VIDEODRIVER=x11

# SDL_AUDIODRIVER=oss or alsa. Only meaningful if QEMU_AUDIO_DRV=sdl.
#export SDL_AUDIODRIVER=oss

# QEMU_AUDIO_DRV=oss, sdl, wav, spice or none. See qemu -audio-help.
export QEMU_AUDIO_DRV=none

CORE_PARAMS="-M pc -m 256 -vga std -soundhw es1370 -name etch-x64 \
	-daemonize -display vnc=:23 -chardev \
	socket,id=monsock,host=127.0.0.1,port=2923,ipv4,server,telnet,nowait \
	-mon chardev=monsock,mode=readline -uuid \
	81d0d000-a9d6-418b-b908-2176a857c712"

NET_PARAMS="-net nic,macaddr=52:54:00:57:c7:12,model=e1000 \
	-net tap,ifname=etch-x64"

DISK_PARAMS="-drive file=$HERE/etch-x64.raw,if=ide,aio=native"

# One of: a (floppy), c (hard disk), d (cdrom), n (network using PXE)
BOOT_PARAMS='-boot order=c'

echo '== Display on 5923, monitor on 2923 ==='

eval qemu-system-x86_64 $CORE_PARAMS $NET_PARAMS $DISK_PARAMS $BOOT_PARAMS
