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

边栏推荐
- 保存和检索字符串
- Oracle性能分析3:TKPROF简介
- Wechat red envelope cover applet source code - background independent version - source code with evaluation points function
- Unity3d Learning Notes 6 - GPU instantiation (1)
- AI enterprise multi cloud storage architecture practice | Shenzhen potential technology sharing
- GPS du début à l'abandon (XIII), surveillance autonome de l'intégrité du récepteur (raim)
- Qt | UDP广播通信、简单使用案例
- China 1,4-cyclohexanedimethanol (CHDM) industry research and investment decision-making report (2022 Edition)
- 硬件開發筆記(十): 硬件開發基本流程,制作一個USB轉RS232的模塊(九):創建CH340G/MAX232封裝庫sop-16並關聯原理圖元器件
- Unity3d minigame-unity-webgl-transform插件转换微信小游戏报错To use dlopen, you need to use Emscripten‘s...问题
猜你喜欢

关于程序员的职业操守,从《匠艺整洁之道》谈起
![[MySQL] online DDL details](/img/7e/97098d7ed5802c446bbadaf7035981.png)
[MySQL] online DDL details
![[Digital IC hand tearing code] Verilog burr free clock switching circuit | topic | principle | design | simulation](/img/2b/15b3d831bba6aa772ad83f3ac91d23.png)
[Digital IC hand tearing code] Verilog burr free clock switching circuit | topic | principle | design | simulation

A Mexican airliner bound for the United States was struck by lightning after taking off and then returned safely

GPS从入门到放弃(十六)、卫星时钟误差和卫星星历误差

GPS从入门到放弃(十三)、接收机自主完好性监测(RAIM)

Common sense: what is "preservation" in insurance?

Bat script learning (I)

GPS從入門到放弃(十三)、接收機自主完好性監測(RAIM)

Wechat red envelope cover applet source code - background independent version - source code with evaluation points function
随机推荐
Qt | UDP广播通信、简单使用案例
【sciter】: 基于 sciter 封装通知栏组件
GPS from getting started to giving up (12), Doppler constant speed
RESNET rs: Google takes the lead in tuning RESNET, and its performance comprehensively surpasses efficientnet series | 2021 arXiv
A Mexican airliner bound for the United States was struck by lightning after taking off and then returned safely
ResNet-RS:谷歌领衔调优ResNet,性能全面超越EfficientNet系列 | 2021 arxiv
Barcodex (ActiveX print control) v5.3.0.80 free version
2022年6月国产数据库大事记-墨天轮
3DMAX assign face map
QT | UDP broadcast communication, simple use case
Wechat red envelope cover applet source code - background independent version - source code with evaluation points function
Data processing skills (7): MATLAB reads the data in the text file TXT with mixed digital strings
二叉(搜索)树的最近公共祖先 ●●
Seata aggregates at, TCC, Saga and XA transaction modes to create a one-stop distributed transaction solution
GPS from entry to abandonment (XVII), tropospheric delay
HDU 2008 数字统计
重磅新闻 | Softing FG-200获得中国3C防爆认证 为客户现场测试提供安全保障
嵌入式常用计算神器EXCEL,欢迎各位推荐技巧,以保持文档持续更新,为其他人提供便利
BarcodeX(ActiveX打印控件) v5.3.0.80 免费版使用
What is the difference between animators and animators- What is the difference between an Animator and an Animation?