当前位置:网站首页>基于 QEMUv8 搭建 OP-TEE 开发环境
基于 QEMUv8 搭建 OP-TEE 开发环境
2022-07-06 14:25:00 【stone8761】
开发环境:Ubuntu 22.04 desktop 虚拟机
1、环境需求
$ sudo dpkg --add-architecture i386 $ sudo apt-get update
$ sudo apt-get install android-tools-adb android-tools-fastboot autoconf automake bc bison build-essential ccache codespell cpio cscope curl device-tree-compiler expect flex ftp-upload gdisk iasl libattr1-dev libcap-dev libcap-ng-dev libfdt-dev libftdi-dev libglib2.0-dev libgmp-dev libhidapi-dev libmpc-dev libncurses5-dev libpixman-1-dev libssl-dev libtool make mtools netcat ninja-build python-crypto python3-crypto python-pyelftools python3-pycryptodome python3-pyelftools rsync unzip uuid-dev xdg-utils xterm xz-utils zlib1g-dev
2、安装 repo
$ mkdir ~/bin
$ curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo -o ~/bin/repo
$ chmod a+x ~/bin/repo
$ export PATH=~/bin:$PATH
更改 repo 获取源,在 /etc/profile 文件最后添加如下内容,然后重启系统
export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo'
3、获取 OP-TEE 代码
$ mkdir OP-TEE
$ cd OP-TEE/
$ repo init -u https://github.com/OP-TEE/manifest.git -m qemu_v8.xml
$ repo sync -j4 --no-clone-bundle
备注1:提示 “Failed to connect to boringssl.googlesource.com port 443: Connection timed out” 错误是因为相关网址无法访问,可使用如下命令替换网址源:
$ git config --global url."https://github.com/google/boringssl.git".insteadOf "https://boringssl.googlesource.com/boringssl"
$ git config --global url."https://hub.fastgit.org/google/boringssl.git".insteadOf "https://boringssl.googlesource.com/boringssl"
备注2:sync 操作会因为 github 链接失败而报错,报错后重新执行即可。但 sync 每次都会更新所有库,只要有一个库链接失败都会报错,但可能这个库已经下载完成了。因此可以查看对应的 manifest 文件,检查是不是所有库都已经下载完成。如果都已经下载完成即可以进入到下一步骤。manifest.xml 文件在 .repo 目录下。
4、编译
$ cd ./build
$ make -j2 toolchains
$ make -j `nproc`
5、运行 qemu
依然在 build/ 目录下
$ make run
正确运行后会弹出两个虚拟的串口终端,其中端口号为 54320 的是非安全系统,端口号为 54321 的为安全系统:
进入 qemu 终端后输入 c 启动系统:
(qemu) c
非安全系统(Linux)可以通过 root 用户登录
安全系统:
备注1:运行过程中可能会报 python 命令找不到的错误,但是 ubuntu 下已经安装了 python。这是因为名称问题,安装的是 python2 和 python3,这里可以创建一条链接解决问题:
$ sudo ln -s /usr/bin/python3 /usr/bin/python
备注2:第一次执行 make run 会编译相关组件再运行 qemu,之后可以直接运行 make run-only 直接运行。
6、运行测试程序
使用 ps 命令检查 tee-supplicant 进程是否存在
运行 xtest 测试例程
$ xtest
边栏推荐
- [sciter]: encapsulate the notification bar component based on sciter
- HDR image reconstruction from a single exposure using deep CNNs阅读札记
- [Digital IC hand tearing code] Verilog burr free clock switching circuit | topic | principle | design | simulation
- hdu 4912 Paths on the tree(lca+馋)
- Oracle control file and log file management
- GPS from entry to abandonment (XVII), tropospheric delay
- 保存和检索字符串
- GPS从入门到放弃(十九)、精密星历(sp3格式)
- [MySQL] online DDL details
- Management background --2 Classification list
猜你喜欢
2020 Bioinformatics | GraphDTA: predicting drug target binding affinity with graph neural networks
Leetcode question brushing (XI) -- sequential questions brushing 51 to 55
A Mexican airliner bound for the United States was struck by lightning after taking off and then returned safely
搜素专题(DFS )
Wechat red envelope cover applet source code - background independent version - source code with evaluation points function
RESNET rs: Google takes the lead in tuning RESNET, and its performance comprehensively surpasses efficientnet series | 2021 arXiv
【10点公开课】:视频质量评价基础与实践
GNN,请你的网络层数再深一点~
[leetcode daily clock in] 1020 Number of enclaves
GPS from getting started to giving up (12), Doppler constant speed
随机推荐
Management background --2 Classification list
Wechat red envelope cover applet source code - background independent version - source code with evaluation points function
C # réalise la liaison des données du rapport Crystal et l'impression du Code à barres 4
Unity3D学习笔记6——GPU实例化(1)
Applet system update prompt, and force the applet to restart and use the new version
重磅新闻 | Softing FG-200获得中国3C防爆认证 为客户现场测试提供安全保障
AI 企业多云存储架构实践 | 深势科技分享
2020 Bioinformatics | GraphDTA: predicting drug target binding affinity with graph neural networks
Some problems about the use of char[] array assignment through scanf..
Shell product written examination related
NetXpert XG2帮您解决“布线安装与维护”难题
Oracle性能分析3:TKPROF简介
[sciter bug] multi line hiding
Seata aggregates at, TCC, Saga and XA transaction modes to create a one-stop distributed transaction solution
HDU 2008 digital statistics
数据处理技巧(7):MATLAB 读取数字字符串混杂的文本文件txt中的数据
中国VOCs催化剂行业研究与投资战略报告(2022版)
OpenCV300 CMake生成project在项目过程中的问题
【数字IC手撕代码】Verilog无毛刺时钟切换电路|题目|原理|设计|仿真
解决项目跨域问题