#! /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="-machine type=pc,accel=kvm -m 256 -vga std -name etch-x86 \
	-daemonize -soundhw es1370 -display vnc=:24 -chardev \
	socket,id=monsock,host=127.0.0.1,port=2924,ipv4,server,telnet,nowait \
	-mon chardev=monsock,mode=readline -uuid \
	b62c1327-7594-479f-a879-2b88d8c499f0"

NET_PARAMS="-net nic,macaddr=52:54:00:c4:99:f0,model=e1000 \
	-net tap,ifname=etch-x86"

DISK_PARAMS="-drive file=$HERE/etch-x86.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 5924, monitor on 2924 ==='

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