当前位置:网站首页>基於 QEMUv8 搭建 OP-TEE 開發環境
基於 QEMUv8 搭建 OP-TEE 開發環境
2022-07-06 22:20: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
边栏推荐
- GPS from getting started to giving up (19), precise ephemeris (SP3 format)
- Hardware development notes (10): basic process of hardware development, making a USB to RS232 module (9): create ch340g/max232 package library sop-16 and associate principle primitive devices
- GPS从入门到放弃(十一)、差分GPS
- Four data streams of grpc
- Adjustable DC power supply based on LM317
- Unity3D学习笔记6——GPU实例化(1)
- GPS从入门到放弃(十四)、电离层延时
- BarcodeX(ActiveX打印控件) v5.3.0.80 免费版使用
- 2021 geometry deep learning master Michael Bronstein long article analysis
- 搜素专题(DFS )
猜你喜欢
GPS从入门到放弃(十五)、DCB差分码偏差
CCNA-思科网络 EIGRP协议
PVL EDI project case
GPS从入门到放弃(十九)、精密星历(sp3格式)
Management background --3, modify classification
小常识:保险中的“保全”是什么?
labelimg的安装与使用
2500 common Chinese characters + 130 common Chinese and English characters
Oracle-控制文件及日志文件的管理
Unity3d minigame-unity-webgl-transform插件转换微信小游戏报错To use dlopen, you need to use Emscripten‘s...问题
随机推荐
2500个常用中文字符 + 130常用中英文字符
ResNet-RS:谷歌领衔调优ResNet,性能全面超越EfficientNet系列 | 2021 arxiv
AI 企业多云存储架构实践 | 深势科技分享
Oracle-控制文件及日志文件的管理
Management background --2 Classification list
Problems in the process of opencv300 cmake generating project
i. Mx6ull build boa server details and some of the problems encountered
Oracle Performance Analysis 3: introduction to tkprof
小常识:保险中的“保全”是什么?
微信红包封面小程序源码-后台独立版-带测评积分功能源码
Unity3d Learning Notes 6 - GPU instantiation (1)
解决项目跨域问题
Codeforces Round #274 (Div. 2) –A Expression
GPS从入门到放弃(十一)、差分GPS
MongoDB(三)——CRUD
[sciter]: encapsulate the notification bar component based on sciter
About the professional ethics of programmers, let's talk about it from the way of craftsmanship and neatness
做接口测试都测什么?有哪些通用测试点?
GPS from getting started to giving up (16), satellite clock error and satellite ephemeris error
十二、启动流程