1.环境
ubuntu20.04.6,python版本为Python 2.7.18
2.先到github中下载对应版本的qemu_v8.xml
https://github.com/OP-TEE/manifest/blob/master/default.xml
3.相关仓可以查看qemu_v8.xml,到国内开源社区下载比如gitee的极速下载
4.下载完毕之后根据OPTEE的指导文档搭建环境
https://optee.readthedocs.io/en/latest/general/about.html
5.安装开发环境所依赖的各种工具和库
sudo apt-get install android-tools-adb android-tools-fastboot autoconf automake bc bison build-essential cscope curl device-tree-compiler expect flex ftp-upload gdisk iasl libattr1-dev libc6 libcap-dev libfdt-dev libftdi-dev libglib2.0-dev libhidapi-dev libncurses5-dev libpixman-1-dev libssl-dev libstdc++6 libtool libz1 make mtools netcat python-crypto unzip uuid-dev xdg-utils xterm xz-utils zlib1g-dev
6.自动获取编译工具
cd build
make -f toolchain.mk toolchains
7.手动下载编译工具
参考OPTEE指导文档Search — OP-TEE documentation documentation (optee.readthedocs.io)OPTEE
8.编译qemu仿真
cd build
make -f qemu_v8.mk all
9.启动qemu并运行optee
cd build
make -f qemu_v8.mk run-only
10.qemu仿真结果如下图所示:
运行上述命令后,将会启动两个terminal,分别为secure world terminal、normal world terminal,用于显示OP-TEE和Linux内核的日志数据。