Files

16 lines
852 B
Bash
Executable File

#!/bin/bash
# run.sh — первый запуск: bare-metal hello на cortex-a7 + наш emmc.img на SDHCI.
# Ожидаем UART-привет. Это проверка трубы, не загрузка Lumia.
set -e
cd "$(dirname "$0")/.."
IMG=${IMG:-/tmp/emmc-test.img}
arm-none-eabi-gcc -nostartfiles -nostdlib -mcpu=cortex-a7 -marm \
-Wl,-Ttext=0x40008000 -o /tmp/hello.elf qemu/start.S qemu/hello.c 2>/dev/null
arm-none-eabi-objcopy -O binary /tmp/hello.elf /tmp/hello.bin
echo "[run] guest built, starting qemu (10s timeout)..."
timeout 10 qemu-system-arm -M virt -cpu cortex-a7 -m 1024 -nographic \
-kernel /tmp/hello.elf \
-drive file="$IMG",if=none,format=raw,id=emmc \
-device sdhci-pci -device sd-card,drive=emmc 2>&1 | head -10
echo "[run] exit=$? (124 = timeout после вывода = OK для вечного цикла)"