基本概念

组件 版本
Ubuntu 20.04
qemu 2.9.50

Python(虚拟环境)

我的普通用户权限默认是这个环境

2.7
Python(apt) 2.7

python的虚拟环境和虚拟机(vmware/virtual box)不是一个概念,不要搞混了。

基本概念

名词 解释/举例
CA Client Application
TA Trust Appliaction
Normal world OS

Linux

Android

Secure world OS

OP-TEE

Trusty

QSEE

SierraTEE

QEMU 一种模拟器
OP-TEE 一种操作系统
repo

和git一样管理

代码用的的竞品

你想啊,你如果想要在电脑端玩安卓手机中的游戏咋办?

你需要一个模拟器对吧?

所以上述表格中的模拟器也是类似的道理。

最终目标

实验的目标是在QEMU终端的支持下,

Normal系统(Linux)中的CA能与Secure系统(OP-TEE)中的TA进行通信。

以TA输出"Hello World"作为成功的标志

安装依赖

apt-get install git python 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:i386 libcap-dev \libfdt-dev libftdi-dev libglib2.0-dev libhidapi-dev libncurses5-dev \libpixman-1-dev libssl-dev libstdc++6:i386 libtool libz1:i386 make \mtools netcat python-crypto unzip uuid-dev \xdg-utils xterm xz-utils zlib1g-dev

下面这两个先不安装,因为python2.x中不存在这两个包,暂时没发现有啥问题

python-serial python-wand

注意,本实验一律python2.x,凡是python3.x的安装包李锐 python3-serial这种是无效的。

python3和python2是不可能混用的。

安装REPO

curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo -o repo
chmod +x repo

同步OP-TEE所需的各种Repository

./repo init -u https://github.com/OP-TEE/manifest.git -m default_stable.xml --repo-url=https://mirrors.tuna.tsinghua.edu.cn/git/git-repo -b 2.6.0

./.repo/manifests/default_stable.xml修改如下

<?xml version="1.0" encoding="utf-8"?>
<manifest><!-- <remote fetch="git://busybox.net" name="busybox"/> -->
<!--   <remote fetch="https://github.com/linaro-swg" name="linaro-swg"/><remote fetch="https://github.com/OP-TEE" name="optee"/><remote fetch="https://github.com/qemu" name="qemu"/>--><!-- 下面的name随便写,就是定义一个变量啊的意思,让后面的remote可以使用 --><remote name="yuchi" fetch="https://gitee.com/fastsource" /><remote name="optee"      fetch="https://gitee.com/fastsource" /><remote name="qemu"       fetch="https://gitee.com/fastsource" /><remote name="linaro-swg" fetch="https://gitee.com/KaminDeng" /><remote name="build"      fetch="https://gitee.com/fastsource" /><remote name="busybox"    fetch="https://gitee.com/fastsource" /><default remote="optee" revision="master" clone-depth="1"/><project name="bios_qemu_tz_arm.git" path="bios_qemu_tz_arm" remote="yuchi" revision="0271acbfa81d93e64c2fdd6ae8b0be14a8c45719" clone-depth="1"/><project name="build.git" path="build" remote="build" revision="refs/tags/2.6.0" clone-depth="1"><linkfile dest="build/Makefile" src="qemu.mk"/></project><project name="busybox.git" path="busybox" remote="busybox" revision="dbf5a6da6a4295ce26edd1ce34fde567d19afa02" clone-depth="1"/><project name="dtc.git" path="qemu/dtc" remote="qemu" revision="c1e55a5513e9bca41dc78a0f20245cc928596a3a" clone-depth="1"/><project name="gen_rootfs.git" path="gen_rootfs" remote="yuchi" revision="fe617d470e45778c909038bf3e7ca15174a4f893" clone-depth="1"/><project name="torvalds-linux.git" path="linux" remote="linaro-swg" clone-depth="1"/><project name="optee_benchmark.git" path="optee_benchmark" remote="yuchi" revision="refs/tags/2.6.0" clone-depth="1"/><project name="optee_client.git" path="optee_client" revision="refs/tags/2.6.0" clone-depth="1"/><project name="optee_examples.git" path="optee_examples" remote="yuchi" revision="refs/tags/2.6.0" clone-depth="1"/><project name="optee_os.git" path="optee_os" revision="refs/tags/2.6.0" clone-depth="1"/><project name="optee_test.git" path="optee_test" revision="refs/tags/2.6.0" clone-depth="1"/><project name="qemu.git" path="qemu" remote="qemu" revision="199e19ee538eb61fd08b1c1ee5aa838ebdcc968e" clone-depth="1"/><project name="soc_term.git" path="soc_term" remote="yuchi" revision="5493a6e7c264536f5ca63fe7511e5eed991e4f20" clone-depth="1"/>
</manifest>

上面修改的原理是:

所有的github链接全部改成gitee链接。

关于repo命令的上述xml文件的修改知识点:

一些设置 相关解释
clone-depth=“1”

这个意思是说,

github中有很多commit

我们只要最近一次的

name

随便定义即可

这个name后面的定义是给下面的remote来使用的

然后我们开始同步(其实就是下载上述.xml中的各种软件库)

time ./repo sync

顺利同步后,会在顶层文件夹下面生成build文件夹

获取toolchains

(下面两步是很多教程里面的,我们不执行,使用其他步骤)

cd build
make -f toolchain.mk toolchains

很明显是toolchain.mk中的这些链接导致上述命令的运行速度超级慢的。

参考[7][8]

用迅雷下载下面三个

https://releases.linaro.org/components/toolchain/binaries/6.2-2016.11/aarch64-linux-gnu/gcc-linaro-6.2.1-2016.11-x86_64_aarch64-linux-gnu.tar.xz
https://releases.linaro.org/components/toolchain/binaries/6.2-2016.11/arm-linux-gnueabihf/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf.tar.xz
https://releases.linaro.org/archive/14.08/components/toolchain/binaries/gcc-linaro-aarch64-linux-gnu-4.9-2014.08_linux.tar.xz(这个据说不弄也可以,但是保险起见还是弄下吧)

cd toolchains
mkdir aarch32
mkdir aarch64
mkdir aarch64-legacy
tar -xvf gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf.tar.xz -C aarch32 --strip-components=1
tar -xvf gcc-linaro-6.2.1-2016.11-x86_64_aarch64-linux-gnu.tar.xz -C aarch64 --strip-components=1
tar -xvf gcc-linaro-6.2.1-2016.11-x86_64_aarch64-linux-gnu.tar.xz -C aarch64-legacy --strip-components=1(这个据说不弄也可以,但是保险起见还是弄下吧)

编译qemu

需要修改的文件 原来的 改为
qemu/util/memfd.c #ifdef CONFIG_MEMFD
#include <sys/memfd.h>
#elif defined CONFIG_LINUX
#if defined CONFIG_LINUX && !defined CONFIG_MEMFD
qemu/configure #include <sys/memfd.h> #include <sys/mman.h>
cd build
虚拟环境切换到python2.7
time make -f qemu.mk all

real    3m43.667s
user    3m13.859s
sys    0m23.519s
大概编译了不到4分钟

这一步一定要仔细检查log中是否有error与fail

如果有的话,不要往下操作。

启动qemu

build        //切换到build目录
make -f qemu.mk run-only    

然后会出来Normal和Secure两个终端,

此时总共有qemu、Normal、Secure共3个终端

在qemu输入c

图中右侧的gtk error是因为ubuntu的gtk版本太新导致的,和qemu没有任何关系,只会影响显示效果(例如像素显示失效或者显示不太好看之类的)放心使用即可

然后Normal终端会自动出来一个命令行提示,

在这个命令行提示中输入optee_hello_world

之后会在Secure终端出现"hello world",即标志安装配置成功

Reference

[1]https://mirror.tuna.tsinghua.edu.cn/help/git-repo/

[2]0.使用Qemu运行OP-TEE

[3]OP-TEE的安装

[4]Git Repo 镜像使用帮助

[5]OPTEE技术详解演示(完)

[6]3.OP-TEE+qemu的编译--工程编译target依赖关系

[7]【OP-TEE 3.8.0学习】001_运行环境的搭建及编译

[8]OP-TEE 环境搭建

ubuntu20.04安装OPTEE相关推荐

  1. 优麒麟Ubuntu20.04安装各种问题

    优麒麟Ubuntu用了六年了,版本旧了,所以按照20.04版. 1.adobe-flashplugin的安装极其慢 慎重啊!需要好几个小时,无法忍受啊! 2.dpkg被中断的解决方法 关闭掉Ubunt ...

  2. ubuntu20.04 安装 Qt5.12步骤

    转载链接:ubuntu20.04 安装 Qt5.12_仙海寻波的博客-CSDN博客_ubuntu20.04安装qt第一步 下载 Qt5.12.9安装包使用清华镜像进行下载:https://mirror ...

  3. 了解Docker、Ubuntu20.04安装docker教程

    Docker 的前世今生 https://my.oschina.net/u/4126211/blog/4517028 Ubuntu20.04安装docker教程 https://blog.csdn.n ...

  4. ubuntu20.04安装ROS及常见问题

    ubuntu20.04安装ROS及常见问题 一.ubuntu安装参考(双系统) 1.ios镜像官网下载地址: https://releases.ubuntu.com/?_ga=2.239339907. ...

  5. Ubuntu20.04安装,并Linux微信等

    Ubuntu20.04安装,并Linux微信等 一.Ubuntu20.04双硬盘双系统安装 电脑状况:256G+260G双固态硬盘,其中256G(sda)分C.D盘安装win10,460G(sdb)硬 ...

  6. ubuntu20.04安装小鹤双拼输入法挂接音形改简体中文Rime

    ubuntu20.04安装小鹤双拼输入法挂接音形改简体中文Rime 方案1,按照这个挂接方法,原始的繁体等其他的也还在: 替换方案 方案2 修改成默认简体中文: 更改皮肤 设置-区域与语言-改成中文- ...

  7. 微星主板 Ubuntu20.04安装以及配置

    1 设置U盘启动 1)插入使用软碟通制作好的U盘,开机按del键进入BIOS: 2)Boot Option 中 选择U盘启动: 3)设置硬盘BBS(我也不知道是什么): 4)点击左边Settings, ...

  8. Ubuntu20.04安装NVIDIA显卡驱动、CUDA、CUDNN及突破NVENC并发限制

    1.查看当前系统版本 cat /proc/version 显示为: 2.查看当前显卡型号: sudo lshw -numeric  -C display 显示我的显卡型号为:GM107M[GeForc ...

  9. Ubuntu20.04安装yum

    Ubuntu20.04安装yum 1打开终端,备份你原来Ubuntu默认的源地址 sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup ...

最新文章

  1. eclipse.ini内存设置
  2. 记录一下CUDA-opencv联合编程
  3. 如何在Spring Boot应用程序中使用配置文件
  4. 导轨式网管型工业交换机优势具体在哪里呢?
  5. 从SQL SERVER 2000到SQL SERVER 2005 视图中存在 ORDER BY 语句的完全解决方案
  6. Basic serial port listening application
  7. Android之Surface/Window/View/SurfaceView区别
  8. Apache Curator入门实战
  9. mysql xtrabackup-v2_MySQL物理备份基础知识(基于xtrabackup2.4版本)
  10. iphone pop服务器没有响应,iPhone 6 Plus跳屏或者触摸失灵的解决办法
  11. access用姓名字段统计人数_用Access统计新生数据
  12. python钉钉扫码登录程序_钉钉扫码登录网站(两种方式实现)
  13. Win11 封杀第三方浏览器工具,不用 Edge 就不行
  14. 乐吾乐零部件拆解可视化解决方案
  15. 搭载敏捷飞天底座 阿里云专有云敏捷版全面升级
  16. C IN ARM64 汇编基础-变量与表达式-基于The C Programming Language - Second Edition
  17. #define宏的妙用!实现你以为的函数offsetof等
  18. 山海演武传·黄道·第一卷 雏龙惊蛰 第五章 蛮族少女与白泽
  19. 利用python爬虫可视化分析当当网的图书数据
  20. 机器学习面试1000题 1 - 255

热门文章

  1. 一位程序员工作10年总结的13个忠告
  2. 算法题12 数组中所有的逆序对
  3. PHP中的加强型接口Traits
  4. java 集合类简单的分析1
  5. Nand Flash VS Nor Flash
  6. linux nslcd服务,Ubuntu 通过ldap集成AD账号登录(nslcd方式)
  7. c语言 变色程序,【图片】(原创)用纯C变了个变色输出字符的程序。。。【c语言吧】_百度贴吧...
  8. python一次删除多个键值对_Python单击:多个键值对参数
  9. matlab中blur函数_游戏中的PostProcessing(后处理)
  10. Centos配置在线yum源