#! /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="-M SS-5 -m 256 -name sarge-sparc -g 1024x768x24 -daemonize \
	-display vnc=:33 -chardev \
	socket,id=monsock,host=127.0.0.1,port=2933,ipv4,server,telnet,nowait \
	-mon chardev=monsock,mode=readline -uuid \
	16353202-d990-4016-b827-36c3c5518b3f"

NET_PARAMS="-net nic,model=lance,macaddr=52:54:00:51:8b:3f \
	-net tap,ifname=sarge-sparc"

LINUX_PARAMS="-prom-env boot-device='disk:a' -prom-env \
	boot-args='Linux fbcon=vc:1-6'"

DISK_PARAMS="-drive file=$HERE/sarge-sparc.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 5933, monitor on 2933 ==='

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