summaryrefslogtreecommitdiff
path: root/tools/qemu_arm.sh
blob: 4c2a0a154b00722f04667f23e5b3c009af116a48 (plain)
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
#!/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