-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathst64
More file actions
executable file
·44 lines (34 loc) · 1.2 KB
/
st64
File metadata and controls
executable file
·44 lines (34 loc) · 1.2 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
#!/bin/bash
QEMU_AUDIO_DRV="none"
GDB_PORT_BASE=1234
USR_OPTION=$1
N_QEMU_INSTANCES=`ps -A | grep qemu-system-aarch64 | 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"
sudo qemu/build/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 \
-m 1024 \
-kernel u-boot/u-boot \
-nographic \
-gdb tcp::${GDB_PORT}
# -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} \
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