#! /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 or sdl or wav or none. See qemu -audio-help.
export QEMU_AUDIO_DRV=none

CORE_PARAMS="-bios $HERE/openbios-ppc -M g3beige -m 256 \
	-soundhw es1370 -name etch-ppc -daemonize -display vnc=:25 -chardev \
	socket,id=monsock,host=127.0.0.1,port=2925,ipv4,server,telnet,nowait \
	-mon chardev=monsock,mode=readline -uuid \
	74ead4f8-0dd1-43c1-b7a5-86bbae7d0b12"

NET_PARAMS='-net nic,macaddr=52:54:00:7d:0b:12 -net tap,ifname=etch-ppc'

LINUX_PARAMS="-prom-env 'boot-device=/pci/mac-io/ata-3/disk:a' -prom-env \
	'boot-args=Debian'"

DISK_PARAMS="-drive file=$HERE/etch-ppc.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 5925, monitor on 2925 ==='

eval qemu-system-ppc.old $CORE_PARAMS $NET_PARAMS $LINUX_PARAMS $DISK_PARAMS \
	$BOOT_PARAMS
