summaryrefslogtreecommitdiff
path: root/tools/qemu_arm.sh
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2017-10-24 23:35:46 +0200
committerRichard Braun <rbraun@sceen.net>2017-10-24 23:35:46 +0200
commit1c7097201991af66baa89d4bbb465292f3b86c29 (patch)
tree26c76566f560240fe83a29bd575dfa3ca7243a56 /tools/qemu_arm.sh
parentcccc345c10908c3a5985b07caac9bf282a669604 (diff)
Add a qemu/arm script, enable caching, clear bss
Diffstat (limited to 'tools/qemu_arm.sh')
-rwxr-xr-xtools/qemu_arm.sh40
1 files changed, 40 insertions, 0 deletions
diff --git a/tools/qemu_arm.sh b/tools/qemu_arm.sh
new file mode 100755
index 00000000..4c2a0a15
--- /dev/null
+++ b/tools/qemu_arm.sh
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+# Amount of physical memory
+# XXX The kernel configuration must use the same value or less.
+RAM=64
+
+# Number of processors. Keep this below the number of physical processors
+# because the kernel doesn't replace spinning with sleeping from within
+# a virtual machine, which causes performance to collapse.
+NR_CPUS=4
+
+# QEMU system emulator
+QEMU_EXE=qemu-system-arm
+
+# KVM options
+KVM="-enable-kvm -cpu host"
+KVM=
+
+
+# Don't change from here unless you know what you're doing
+
+
+X15=$PWD/x15
+TMPDIR=$(mktemp -d)
+FLASH=$TMPDIR/flash
+
+arm-none-eabi-objcopy -O binary x15 x15.bin
+dd if=/dev/zero of=flash.img bs=1M count=64
+dd if=x15.bin of=flash.img conv=notrunc
+
+$QEMU_EXE $KVM \
+ -M virt-2.8 \
+ -ctrl-grab \
+ -gdb tcp::1234 \
+ -m $RAM \
+ -smp $NR_CPUS \
+ -monitor stdio \
+ -pflash flash.img
+
+rm -rf $TMPDIR