#! /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 ac97 -name \
	wheezy-ppc -daemonize -display vnc=:49 -chardev \
	socket,id=monsock,host=127.0.0.1,port=2942,ipv4,server,telnet,nowait \
        -mon chardev=monsock,mode=readline -uuid \
	76bc675a-9ee8-4d90-b8d5-50926b75841d"

NET_PARAMS='-net nic,macaddr=52:54:00:75:84:1d -net tap,ifname=wheezy-ppc'

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

DISK_PARAMS="-drive file=$HERE/wheezy-ppc.raw,if=ide,aio=native,index=2"

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

echo '== Display on 5949, monitor on 2949 ==='

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