当前位置: 首页 > news >正文

(Repost) Getting Genode with TrustZone on the i.MX

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

转自:https://tthtlc.wordpress.com/2015/02/21/getting-genode-with-trustzone-on-the-i-mx53-quick-start-board/


Getting Genode with TrustZone on the i.MX53 Quick Start Board

Posted February 21, 2015 by Peter Teoh in genode, i.MX53SQB. 5 Comments

DSC_0124

First download the toolchain for ARM compilation, and then the Genode OS itself, all listed here:

http://sourceforge.net/projects/genode/files/

Details description of Genode and its installation are found here:

http://genode.org/documentation/developer-resources/getting_started

http://genode.org/documentation/release-notes/14.11

https://github.com/genodelabs/genode/blob/master/doc/getting_started.txt

Install all the necessary packages for Ubuntu 14.04 (present host):

apt-get install libSDL-dev
apt-get install libsdl1.2-dev -> shows it is already newest version
apt-get install tk8.5 tcl8.5
apt-get install expect
apt-get install byacc
apt-get install qemu
apt-get install genisoimage
sudo apt-get install expect
sudo apt-get install udisks

After untarring the genode toolchain /usr/local/genode-gcc directory, next is to untar the Genode OS download to “genode-14.11″.

With some assistance as documented here:

http://sourceforge.net/p/genode/mailman/message/33465225/

cd genode-14.11/
cd tool/

Listing all the hardware:

./create_builddir

‘linux_x86′
‘linux_arm’
‘fiasco_x86′
‘pistachio_x86′
‘okl4_x86′
‘nova_x86_32′
‘nova_x86_64′
‘codezero_vpb926′
‘hw_panda’
‘hw_vea9x4′
‘hw_vea9x4_tz’
‘hw_pbxa9′
‘hw_imx31′
‘hw_imx53′
‘hw_imx53_tz’
‘hw_arndale’
‘hw_odroid_xu’
‘hw_rpi’
‘foc_x86_32′
‘foc_x86_64′
‘foc_pbxa9′
‘foc_imx53′
‘foc_vea9x4′
‘foc_panda’
‘foc_arndale’
‘lx_hybrid_x86′

Now we set the hardware to be imx53:

./create_builddir hw_imx53_tz BUILD_DIR=build_imx53
cd build_imx53/

Setting up it for uboot as the bootloader:

echo "SPECS += trustzone" >> etc/specs.confecho "RUN_OPT = --target uboot" >> etc/build.confmake run/tz_vmm

After this “uImage” is generated in the build_imx53/var/run.

Now, to download u-boot bootloader (and its ARM gcc compiler):

git clone https://github.com/m-stein/uboot uboot_stein

cd uboot_stein/

wget http://releases.linaro.org/14.09/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.9-2014.09_linux.tar.xz

Extract out the config file:

make ARCH=arm CROSS_COMPILE=/opt/gcc-linaro-arm-none-eabi-4.9-2014.09_linux/bin/arm-none-eabi- usbarmory_config

Now start the make process:

make ARCH=arm CROSS_COMPILE=/opt/gcc-linaro-arm-none-eabi-4.9-2014.09_linux/bin/arm-none-eabi- V=1

Notice a “u-boot.imx” is created. But first we need to format the sdcard.

(from hence onwards my sdcard is detected as /dev/sdg???):

Aim: make a sdcard from uImage, which will require uboot bootloader:

sudo parted /dev/sdg –script mklabel msdos

sudo parted /dev/sdg –script mkpart primary ext4 5M 100%

Upon completion, “dd” the u-boot.imx (which is meant for imx53 as the target) to the sdcard’s 3rd 512-block:

sudo dd if=./u-boot.imx of=/dev/sdg seek=2 bs=512 conv=fsync

Take a look at the partition:

sudo fdisk -l /dev/sdg

sudo mkfs.ext4 /dev/sdg1

Now /dev/sdg1 is ext4-formatted, mount it:

udisks –mount /dev/sdg1

Copy the uImage there to the rootfs:

cp uImage /media/371a8dd7-58c1-4beb-aed3-cb18fb40f7eb/

And umount it:

sudo udisks –umount /dev/sdg1

Now insert the sdcard into i.MX53QSB and connect via serial port, bootup message as follows:

U-Boot 2014.07-g0ca0b0f (Feb 20 2015 – 09:14:08)

Board: USB armory
I2C: ready
DRAM: 256 MiB
MMC: FSL_SDHC: 0, FSL_SDHC: 1
*** Warning – bad CRC, using default environment

In: serial
Out: serial
Err: serial
Net: CPU Net Initialization Failed
No ethernet found.
Hit any key to stop autoboot: 0

=> ext2ls
ext2ls – list files in a directory (default /)

Usage:
ext2ls <interface> <dev[:part]> [directory]
– list files from ‘dev’ on ‘interface’ in a ‘directory’

=> ext2ls mmc 0:1
<DIR> 4096 .
<DIR> 4096 ..
<DIR> 16384 lost+found
7860111 uImage

=> ext2load mmc 0:1 0x70200000 uImage
7860111 bytes read in 583 ms (12.9 MiB/s)

=> bootm 0x70200000
## Booting kernel from Legacy Image at 70200000 …
Image Name:
Image Type: ARM Linux Kernel Image (gzip compressed)
Data Size: 7860047 Bytes = 7.5 MiB
Load Address: 70010000
Entry Point: 70010000
Verifying Checksum … OK
Uncompressing Kernel Image … OK

Starting kernel …

kernel initialized
Genode 14.11
int main(): — create local services —
int main(): — start init —
int main(): transferred 246 MB to init
int main(): — init created, waiting for exit condition —
[init] Could not open file “ld.lib.so”
[init] parent provides
[init] service “ROM”
[init] service “RAM”
[init] service “IRQ”
[init] service “IO_MEM”
[init] service “CAP”
[init] service “PD”
[init] service “RM”
[init] service “CPU”
[init] service “LOG”
[init] service “SIGNAL”
[init] service “VM”
[init] child “tz_vmm”
[init] RAM quota: 3932160
[init] ELF binary: tz_vmm
[init] priority: 0
[init -> tz_vmm] Start virtual machine …
undefined instruction

More debugging needed……


转载于:https://my.oschina.net/finallyjustice/blog/397623

相关文章:

  • [数分提高]2014-2015-2第5教学周第1次课
  • 【每天进步一点】毒药和老鼠的研究
  • linux下安装Python-2.7.9
  • 一条简单的sql在11g和12c中的不同
  • 关于mongodb在mac下的手动安装,非homwbrew安装(小白请进)
  • EcShop二次开发学习方法
  • 国庆后的特训
  • 梦游记-梦中游记
  • PHP-内核学习(一、变量)
  • 【cs229-Lecture18】线性二次型调节控制
  • 转:windows 下 netsh 实现 端口映射(端口转发)
  • assign, retain, weak, strong, copy,unsafe_unretain
  • java 反射
  • MSF溢出实战教程
  • 虚拟机的使用和Linux的一些基础
  • (ckeditor+ckfinder用法)Jquery,js获取ckeditor值
  • .pyc 想到的一些问题
  • [iOS]Core Data浅析一 -- 启用Core Data
  • eclipse(luna)创建web工程
  • javascript 哈希表
  • leetcode98. Validate Binary Search Tree
  • Nacos系列:Nacos的Java SDK使用
  • nfs客户端进程变D,延伸linux的lock
  • text-decoration与color属性
  • 翻译:Hystrix - How To Use
  • 给第三方使用接口的 URL 签名实现
  • 批量截取pdf文件
  • 算法系列——算法入门之递归分而治之思想的实现
  • 突破自己的技术思维
  • 限制Java线程池运行线程以及等待线程数量的策略
  • 用 Swift 编写面向协议的视图
  • 掌握面试——弹出框的实现(一道题中包含布局/js设计模式)
  • elasticsearch-head插件安装
  • ​​​​​​​Installing ROS on the Raspberry Pi
  • (python)数据结构---字典
  • (windows2012共享文件夹和防火墙设置
  • (补)B+树一些思想
  • (附源码)springboot炼糖厂地磅全自动控制系统 毕业设计 341357
  • (转)es进行聚合操作时提示Fielddata is disabled on text fields by default
  • (转)树状数组
  • ***原理与防范
  • .bat文件调用java类的main方法
  • .Net接口调试与案例
  • .Net下使用 Geb.Video.FFMPEG 操作视频文件
  • .net知识和学习方法系列(二十一)CLR-枚举
  • /var/spool/postfix/maildrop 下有大量文件
  • @31省区市高考时间表来了,祝考试成功
  • [ C++ ] STL_stack(栈)queue(队列)使用及其重要接口模拟实现
  • [ vulhub漏洞复现篇 ] Celery <4.0 Redis未授权访问+Pickle反序列化利用
  • [android] 手机卫士黑名单功能(ListView优化)
  • [Android]常见的数据传递方式
  • [C#]winform利用seetaface6实现C#人脸检测活体检测口罩检测年龄预测性别判断眼睛状态检测
  • [C++基础]-入门知识
  • [Codeforces1137D]Cooperative Game
  • [CTF]php is_numeric绕过