Merge branch 'master' of git://localhost/acess2
[tpg/acess2.git] / RunQemu
1 #!/bin/sh
2 #qemu-system-x86_64 -fda DiskImage.img -boot a -serial stdio -net user,hostname=prelude,dns=10.0.2.1 -net nic,model=ne2k_pci -vga std
3
4 QEMU=qemu-system-x86_64
5 USE_GDB=
6 BOOTOPT="-fda DiskImage.img -boot a"
7
8 QEMU_PARAMS=""
9 QEMU_PARAMS=$QEMU_PARAMS" -hda AcessHDD.img"
10 QEMU_PARAMS=$QEMU_PARAMS" -vga std"
11 QEMU_PARAMS=$QEMU_PARAMS" -smp 2"
12 QEMU_PARAMS=$QEMU_PARAMS" -net nic,model=e1000"
13 #QEMU_PARAMS=$QEMU_PARAMS" -net nic,model=rtl8139"
14
15 _NETTYPE="user,hostfwd=tcp::5555-:23"
16
17 _EVAL=eval
18
19 while [ $# -ne 0 ]; do
20         case $1 in
21         -gdb)
22                 QEMU_PARAMS=$QEMU_PARAMS" -s -S"
23                 ;;
24         -dbin)
25                 shift
26                 if [ "x$2" = "xdefault" ] || [ "x$2" = "x" ]; then
27                         _kfile="KernelLand/Acess2.$1.bin"
28                 else
29                         _kfile="KernelLand/Acess2.$1-$2.bin"
30                 fi
31                 BOOTOPT="-kernel $_kfile"
32                 BOOTOPT=$BOOTOPT" -initrd KernelLand/Modules/Filesystems/FS_InitRD.kmd.$1 -append \"$3\""
33                 shift
34                 shift
35                 ;;
36         -dbgbin)
37                 QEMU=/home/tpg/apps/bin/qemu-system-x86_64
38                 ;;
39         -bin)
40                 shift
41                 QEMU=$1
42                 ;;
43         -dbgscript)
44                 QEMU="echo $QEMU"
45                 ;;
46         -extramem)
47                 QEMU_PARAMS=$QEMU_PARAMS" -m 768"
48                 ;;
49         -e)
50                 shift
51                 QEMU_PARAMS=$QEMU_PARAMS" "$1
52                 ;;
53         -n)
54                 _EVAL=echo
55                 ;;
56         -fwd)
57                 _NETTYPE=$_NETTYPE",hostfwd=tcp::10023-10.0.2.10:23"
58                 ;;
59         -tuntap)
60                 _NETTYPE="tap"
61                 ;;
62         -nousb)
63                 _NOUSB="yes"
64                 ;;
65         -notee)
66                 _NOTEE="yes"
67                 ;;
68         -nographic)
69                 _NOGRAPHIC="yes"
70                 ;;
71         esac
72         shift
73 done
74 QEMU_PARAMS=$QEMU_PARAMS" -net "$_NETTYPE
75
76 if [ "x$_NOUSB" != "xyes" ] ; then
77         QEMU_PARAMS=$QEMU_PARAMS" -usb"
78         QEMU_PARAMS=$QEMU_PARAMS" -device usb-ehci"
79         QEMU_PARAMS=$QEMU_PARAMS" -drive id=test_usb_image,file=USB_Test_Image.img,if=none"
80         QEMU_PARAMS=$QEMU_PARAMS" -device usb-storage,drive=test_usb_image"
81         QEMU_PARAMS=$QEMU_PARAMS" -usbdevice mouse"
82         QEMU_PARAMS=$QEMU_PARAMS" -usbdevice keyboard"
83 fi
84
85 #       /home/tpg/apps/bin/qemu-system-x86_64 $QEMU_PARAMS -serial stdio -serial file:QemuLog.txt
86 #       qemu-system-x86_64 $QEMU_PARAMS -serial stdio | tee QemuLog.txt
87 #echo $QEMU $BOOTOPT $QEMU_PARAMS
88 if [ "x$_NOGRAPHIC" = "xyes" ] ; then
89         $_EVAL $QEMU $BOOTOPT $QEMU_PARAMS -nographic | tee QemuLog.txt
90         exit
91 fi
92
93 if [ "x$_NOTEE" = "xyes" ] ; then
94         $_EVAL $QEMU $BOOTOPT $QEMU_PARAMS -serial stdio
95         exit
96 fi
97
98 $_EVAL $QEMU $BOOTOPT $QEMU_PARAMS -serial stdio | tee QemuLog.txt

UCC git Repository :: git.ucc.asn.au