当前位置:网站首页>基于 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

边栏推荐
- C#實現水晶報錶綁定數據並實現打印4-條形碼
- Unity3d Learning Notes 6 - GPU instantiation (1)
- 做接口测试都测什么?有哪些通用测试点?
- Adjustable DC power supply based on LM317
- Management background --5, sub classification
- 数据处理技巧(7):MATLAB 读取数字字符串混杂的文本文件txt中的数据
- Qt | UDP广播通信、简单使用案例
- GPS从入门到放弃(十六)、卫星时钟误差和卫星星历误差
- GPS从入门到放弃(十四)、电离层延时
- HDR image reconstruction from a single exposure using deep CNN reading notes
猜你喜欢

小满网络模型&http1-http2 &浏览器缓存

GPS from getting started to giving up (19), precise ephemeris (SP3 format)

关于程序员的职业操守,从《匠艺整洁之道》谈起

第3章:类的加载过程(类的生命周期)详解

Memorabilia of domestic database in June 2022 - ink Sky Wheel

CCNA Cisco network EIGRP protocol

GPS从入门到放弃(十四)、电离层延时

HDR image reconstruction from a single exposure using deep CNN reading notes

Barcodex (ActiveX print control) v5.3.0.80 free version

Management background --3, modify classification
随机推荐
[MySQL] online DDL details
Unity3D学习笔记6——GPU实例化(1)
Make menuconfig has a recipe for target 'menuconfig' failed error
Force buckle 575 Divide candy
嵌入式常用计算神器EXCEL,欢迎各位推荐技巧,以保持文档持续更新,为其他人提供便利
RESNET rs: Google takes the lead in tuning RESNET, and its performance comprehensively surpasses efficientnet series | 2021 arXiv
Common sense: what is "preservation" in insurance?
GPS从入门到放弃(十七) 、对流层延时
Oracle control file and log file management
Research and investment strategy report of China's VOCs catalyst industry (2022 Edition)
hdu 4912 Paths on the tree(lca+馋)
Mongodb (III) - CRUD
Write a rotation verification code annotation gadget with aardio
ResNet-RS:谷歌领衔调优ResNet,性能全面超越EfficientNet系列 | 2021 arxiv
[线性代数] 1.3 n阶行列式
GPS du début à l'abandon (XIII), surveillance autonome de l'intégrité du récepteur (raim)
i.mx6ull搭建boa服务器详解及其中遇到的一些问题
HDR image reconstruction from a single exposure using deep CNNs阅读札记
2020 Bioinformatics | GraphDTA: predicting drug target binding affinity with graph neural networks
搜素专题(DFS )