Re: QEMU-2
Добавлено: 03.11.21 19:05
Нихера. Примеры работают, наше не работает.
https://xn--b1aga5e.xn-----6kcajervcdvqarhfgengcekya4c.xn--p1ai/
https://xn--b1aga5e.xn-----6kcajervcdvqarhfgengcekya4c.xn--p1ai/viewtopic.php?f=5&t=486
Код: Выделить всё
target remote localhost:1234
file uartx01.elf
layout asm
Код: Выделить всё
arm-none-eabi-gdb -tui --command=commands.gdb
Код: Выделить всё
$ arm-none-eabi-objdump -b binary -m arm_any -D /y/dw/uartx01/uartx01.bin
00000000 <.data>:
0: e3a0d902 mov sp, #32768 ; 0x8000
Код: Выделить всё
arm-none-eabi-objcopy --input-target binary --output-target elf32-big uartx01.bin uartx01.elf3
Код: Выделить всё
#!/bin/sh
# Convert a raw binary image into an ELF file suitable for loading into a disassembler
#
# Usage: bin2elf input_binary_file output_elf_file base_address
set -xe
cat > raw$$.ld <<EOF
SECTIONS
{
EOF
echo " . = $3;" >> raw$$.ld
cat >> raw$$.ld <<EOF
.text : { *(.text) }
}
EOF
CROSS_PREFIX=arm-none-eabi-
${CROSS_PREFIX}ld -b binary -r -o raw$$.elf $1
${CROSS_PREFIX}objcopy --rename-section .data=.text \
--set-section-flags .data=alloc,code,load raw$$.elf
${CROSS_PREFIX}ld raw$$.elf -T raw$$.ld -o $2
${CROSS_PREFIX}strip -s $2
rm -rf raw$$.elf raw$$.ld
Код: Выделить всё
/y/bin2elf.sh /y/vb_share/jaos/coop-rpi-works-again/kernel7.img /y/vb_share/jaos/coop-rpi-works-again/kernel7.elf3 0x8000 && /y/qemu0/arm-softmmu/qemu-system-arm -M raspi2 -dtb /y/vb_share/2015-02-16-raspbian-wheezy/bcm2709-rpi-2-b.dtb -serial mon:stdio -kernel /y/vb_share/jaos/coop-rpi-works-again/kernel7.elf3
А раньше уже выяснилось, что QEMU считает, что если ему дали бинарный файл - то это линукс, а если elf - то нет. Мы раньше давали elf и ATAG-ов не было (не знаю уж, почему). Пробуем дать снова бинарный образ и обнаруживаем, что он грузится по адресу 0x10000, а не 0x8000. Видимо, самое простое здесь - это поправить QEMU, хотя сначала надо почитать вот это:At boot the Raspberry Pi firmware follows the old Linux boot protocol for ARM systems called ATAG. Optionally the boot-loader can use the newer device tree but that is not the default so lets ignore that for now.
Код: Выделить всё
/y/qemu0/arm-softmmu/qemu-system-arm -M raspi2 -serial mon:stdio -kernel /y/vb_share/jaos/coop-rpi-works-again/kernel7.img