Trusty qemu + android环境搭建详细步骤

28 阅读1分钟

下载源码

mkdir trusty

cd trusty

repo init -u android.googlesource.com/trusty/mani… -b master

repo sync -j32

编译

./trusty/vendor/google/aosp/scripts/build.py generic-arm64

查看编译结果

ls build-root/build-generic-arm64/lk.bin

安装运行依赖

sudo apt install libpixman-1-dev libstdc+±8-dev pkg-config libglib2.0-dev libusb-1.0-0-dev

构建qemu镜像并做测试

trusty/vendor/google/aosp/scripts/build.py qemu-generic-arm64-test-debug

手动运行一个测试

build-root/build-qemu-generic-arm64-test-debug/run --headless --boot-test “com.android.ipc-unittest.ctrl”

启动时使用内核调试输出运行测试运行程序测试

build-root/build-qemu-generic-arm64-test-debug/run-qemu --boot-test “com.android.ipc-unittest.ctrl” --headless --verbose

注意:ATF 会先停用控制台,然后再返回测试运行程序。如需在本地停用此设置,请注释掉 external/arm-trusted-firmware/plat/common/aarch64/plat_common.c 内 bl31_plat_runtime_setup 中的所有代码。

从Android shell运行测试:

build-root/build-qemu-generic-arm64-test-debug/run-qemu --shell-command “/data/nativetest64/tipc-test/tipc-test -t ta2ta-ipc” --headless

read-normal-img

read-normal-img

添加威♥:sami01_2023,回复ARM中文,领取ARM中文手册