Usermode/libc++ - cxa_guard behavior fix
[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 MODS=""
13
14 _NETTYPE="user,hostfwd=tcp::5555-:23"
15 _NETMODEL=e1000
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         -mod)
25                 shift
26                 MODS=$MODS","$1
27                 ;;
28         -dbin)
29                 shift
30                 if [ "x$2" = "xdefault" ] || [ "x$2" = "x" ]; then
31                         _kfile="KernelLand/Acess2.$1.bin"
32                 else
33                         _kfile="KernelLand/Acess2.$1-$2.bin"
34                 fi
35                 BOOTOPT="-kernel $_kfile"
36                 BOOTOPT=$BOOTOPT" -initrd KernelLand/Modules/Filesystems/FS_InitRD.kmd.$1$MODS -append \"$3\""
37                 shift
38                 shift
39                 ;;
40         -dbgbin)
41                 QEMU=/home/tpg/apps/bin/qemu-system-x86_64
42                 ;;
43         -bin)
44                 shift
45                 QEMU=$1
46                 ;;
47         -dbgscript)
48                 QEMU="echo $QEMU"
49                 ;;
50         -extramem)
51                 QEMU_PARAMS=$QEMU_PARAMS" -m 768"
52                 ;;
53         -e)
54                 shift
55                 QEMU_PARAMS=$QEMU_PARAMS" "$1
56                 ;;
57         -n)
58                 _EVAL=echo
59                 ;;
60         -fwd)
61                 _NETTYPE=$_NETTYPE",hostfwd=tcp::10023-10.0.2.10:23"
62                 ;;
63         -tuntap)
64                 _NETTYPE="tap"
65                 ;;
66         -nousb)
67                 _NOUSB="yes"
68                 ;;
69         -notee)
70                 _NOTEE="yes"
71                 ;;
72         -nographic)
73                 _NOGRAPHIC="yes"
74                 ;;
75         -netmodel)
76                 shift
77                 _NETMODEL=$1
78                 ;;
79         -pciserial)
80                 QEMU_PARAMS=$QEMU_PARAMS" -device pci-serial,chardev=serial2"
81                 QEMU_PARAMS=$QEMU_PARAMS" -chardev socket,id=serial2,host=localhost,port=10023,server,telnet"
82                 ;;
83         esac
84         shift
85 done
86
87 QEMU_PARAMS=$QEMU_PARAMS" -net nic,model="$_NETMODEL
88 QEMU_PARAMS=$QEMU_PARAMS" -net "$_NETTYPE
89
90 if [ "x$_NOUSB" != "xyes" ] ; then
91         QEMU_PARAMS=$QEMU_PARAMS" -usb"
92         QEMU_PARAMS=$QEMU_PARAMS" -device usb-ehci"
93         QEMU_PARAMS=$QEMU_PARAMS" -drive id=test_usb_image,file=USB_Test_Image.img,if=none"
94         QEMU_PARAMS=$QEMU_PARAMS" -device usb-storage,drive=test_usb_image"
95         QEMU_PARAMS=$QEMU_PARAMS" -usbdevice mouse"
96 #       QEMU_PARAMS=$QEMU_PARAMS" -usbdevice keyboard"
97 fi
98
99 if [ "x$_NOTEE" = "xyes" ] ; then
100         _TEECMD=
101 else
102         _TEECMD=" | tee QemuLog.txt"
103 fi
104
105 #       /home/tpg/apps/bin/qemu-system-x86_64 $QEMU_PARAMS -serial stdio -serial file:QemuLog.txt
106 #       qemu-system-x86_64 $QEMU_PARAMS -serial stdio | tee QemuLog.txt
107 #echo $QEMU $BOOTOPT $QEMU_PARAMS
108 if [ "x$_NOGRAPHIC" = "xyes" ] ; then
109         $_EVAL $QEMU $BOOTOPT $QEMU_PARAMS -nographic $_TEECMD
110         exit
111 fi
112
113 $_EVAL $QEMU $BOOTOPT $QEMU_PARAMS -serial stdio $_TEECMD

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