#! /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 etch-sparc -g 1024x768x24 -daemonize \
	-display vnc=:26 -chardev \
	socket,id=monsock,host=127.0.0.1,port=2926,ipv4,server,telnet,nowait \
	-mon chardev=monsock,mode=readline -uuid \
	f5281568-cbf0-44dc-9247-b271be4ba6cc"

NET_PARAMS='-net nic,macaddr=52:54:00:4b:a6:cc -net tap,ifname=etch-sparc'

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

DISK_PARAMS="-drive file=$HERE/etch-sparc.raw,if=scsi,aio=native"

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

echo '== Display on 5926, monitor on 2926 ==='

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