diff options
author | Richard Braun <rbraun@sceen.net> | 2017-10-25 01:23:52 +0200 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2017-10-25 01:23:52 +0200 |
commit | ae620e83e4a2a9ea6915e148443db783b10c64dc (patch) | |
tree | 9e0116b10e3623fbfa8b34e428aac3606392ed84 | |
parent | 1c7097201991af66baa89d4bbb465292f3b86c29 (diff) |
Improve qemu/arm script
-rw-r--r-- | arch/arm/machine/boot_asm.S | 3 | ||||
-rwxr-xr-x | tools/qemu_arm.sh | 11 |
2 files changed, 8 insertions, 6 deletions
diff --git a/arch/arm/machine/boot_asm.S b/arch/arm/machine/boot_asm.S index 7791a374..ed5e2ccc 100644 --- a/arch/arm/machine/boot_asm.S +++ b/arch/arm/machine/boot_asm.S @@ -91,7 +91,7 @@ ASM_FUNC(boot_start_ram): ldr %r13, boot_stack_addr /* Set up the boot stack */ add %r13, %r13, #BOOT_STACK_SIZE - bl boot_setup_paging + blx boot_setup_paging orr %r0, %r0, #0x01 /* Set the C bit (cacheable) */ orr %r0, %r0, #0x02 /* Set the S bit (shareable) */ @@ -107,6 +107,7 @@ ASM_FUNC(boot_start_ram): orr %r0, %r0, #0x1000 /* Set the I bit (I-cache) */ mcr p15, 0, %r0, c1, c0, 0 /* Write CP15 control register */ + mov %r11, #0 blx boot_main /* Never reached */ diff --git a/tools/qemu_arm.sh b/tools/qemu_arm.sh index 4c2a0a15..d73e7131 100755 --- a/tools/qemu_arm.sh +++ b/tools/qemu_arm.sh @@ -22,11 +22,12 @@ KVM= X15=$PWD/x15 TMPDIR=$(mktemp -d) -FLASH=$TMPDIR/flash +BIN=$TMPDIR/x15.bin +IMG=$TMPDIR/flash.img -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 +arm-none-eabi-objcopy -O binary x15 $BIN +dd if=/dev/zero of=$IMG bs=1M seek=64 count=0 +dd if=$BIN of=$IMG conv=notrunc $QEMU_EXE $KVM \ -M virt-2.8 \ @@ -35,6 +36,6 @@ $QEMU_EXE $KVM \ -m $RAM \ -smp $NR_CPUS \ -monitor stdio \ - -pflash flash.img + -drive file=$IMG,if=pflash,format=raw rm -rf $TMPDIR |