-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathst
More file actions
executable file
·65 lines (51 loc) · 1.77 KB
/
st
File metadata and controls
executable file
·65 lines (51 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
QEMU_AUDIO_DRV="none"
GDB_PORT_BASE=1234
USR_OPTION=$1
N_QEMU_INSTANCES=`ps -A | grep qemu-system | wc -l`
launch_qemu() {
QEMU_MAC_ADDR="$(printf 'DE:AD:BE:EF:%02X:%02X\n' $((N_QEMU_INSTANCES)) $((N_QEMU_INSTANCES)))"
GDB_PORT=$((${GDB_PORT_BASE} + ${N_QEMU_INSTANCES}))
echo -e "\033[01;36mMAC addr: " ${QEMU_MAC_ADDR} "\033[0;37m"
echo -e "\033[01;36mGDB port: " ${GDB_PORT} "\033[0;37m"
while read var; do
if [ "$var" != "" ]; then
export $(echo $var | sed -e 's/ //g' -e /^$/d -e 's/://g' -e /^#/d)
fi
done < agency/build.conf
if [ "$PLATFORM" == "virt64" ]; then
sudo qemu-system-aarch64 $@ ${USR_OPTION} \
-smp 4 \
-serial mon:stdio \
-M virt,gic-version=2 -cpu cortex-a72 \
-device virtio-blk-device,drive=hd0 \
-drive if=none,file=agency/filesystem/sdcard.img.virt64,id=hd0,format=raw,file.locking=off \
-m 1024 \
-kernel u-boot/u-boot \
-nographic \
-netdev tap,id=n1,script=scripts/qemu-ifup.sh,downscript=scripts/qemu-ifdown.sh \
-device virtio-net-device,netdev=n1,mac=${QEMU_MAC_ADDR} \
-gdb tcp::${GDB_PORT}
else
sudo qemu-system-arm $@ ${USR_OPTION} \
-smp 4 \
-serial mon:stdio \
-M vexpress-a15,secure=on -cpu cortex-a15 \
-m 1024 \
-bios bl1.bin \
-semihosting-config enable,target=native \
-sd agency/filesystem/sdcard.img.vexpress \
-net tap,script=scripts/qemu-ifup.sh,downscript=scripts/qemu-ifdown.sh -net nic,macaddr=${QEMU_MAC_ADDR} \
-nographic \
-gdb tcp::${GDB_PORT}
fi
QEMU_RESULT=$?
# if [[ ${QEMU_RESULT} -ne 0 ]]
# then
# echo -e "\033[01;31mPort already used! Trying the next one...\033[0;37m"
#
# N_QEMU_INSTANCES=$((${N_QEMU_INSTANCES} + 1))
# launch_qemu
# fi
}
launch_qemu