#! /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 \
	squeeze-ppc -daemonize -display vnc=:42 -chardev \
	socket,id=monsock,host=127.0.0.1,port=2942,ipv4,server,telnet,nowait \
        -mon chardev=monsock,mode=readline -uuid \
	65e48659-6fcc-4c9b-b6f2-bd8e36278196"

NET_PARAMS='-net nic,macaddr=52:54:00:27:81:96 -net tap,ifname=squeeze-ppc'

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

DISK_PARAMS="-drive file=$HERE/squeeze-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 5942, monitor on 2942 ==='

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