Show Menu
Cheatography

OP-TEE - optee.org - github.com/OP-TEE Cheat Sheet (DRAFT) by

Most used commands when dealing with OP-TEE

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Paths

OP-TEE project : $ROOT
$HOME/­dev­el/­optee
Makefiles
$ROOT/­build
GP conf Trusted Applic­ation
$ROOT/­gp_conf
 ­ ­ ­--> ELF file
$ROOT/­out­/gp­_co­nf_­ta/­677­074­65-­656­3-6­f6e­-66­6c6­96e­617­26f­15.elf
Hello World Trusted Applic­ation
$ROOT/­hel­lo_­world
 ­ ­ ­--> ELF file
$ROOT/­hel­lo_­wor­ld/­ta/­8aa­af2­00-­245­0-1­1e4­-ab­e20­002­a5d­5c5­1b.elf
OP-TEE secure OS
$ROOT/­opt­ee_os
 ­ ­ ­--> ELF file
$ROOT/­opt­ee_­os/­out­/ar­m/c­ore­/te­e.elf
OP-TEE Client API
$ROOT/­opt­ee_­client
Linux kernel
$ROOT/­linux

make targets (from the build folder)

make all
Builds the entire OP-TEE solution
make run
Prepare update ROOT FS and launch QEMU
make run-only
Only launches OP-TEE (ROOT FS not updated)
make helloworld
Build the Hello World TA
make gp_conf_ta
Build the GP conference TA
make optee-os
Build OP-TEE OS (secure side)

Typical OP-TEE session

1. cd $ROOT/­build
Go to the build folder
2. make all
Build the solution
3. make run
Create­/update root fs and launch QEMU
4. (qemu) c
Start the emulator
5. tee-su­ppl­icant &
In "­Normal World" window, start tee-su­ppl­icant
6a. xtest
Run the test suite (Normal World)
6b. hello_­world
Run the Hello World TA (Normal World)
6c. gp_con­f_c­lient
Run the GP conference TA (Normal World)
7. (qemu) q
Quit QEMU
 

QEMU

(qemu) c
Start the emulator
(qemu) q
Stop the emulator

Normal World window - root@v­Express

tee-su­ppl­icant &
Launches tee-su­ppl­icant
xtest
Run OP-TEE's test suite
hello_­world
Run Hello World Trusted Applic­ation
gp_con­f_c­lient
Run GP conference Trusted Applic­ation

GDB commands (in the debugger)

./gdb
Launch GDB (from build folder)
optee
Connects to target and load tee.elf
helloworld
Add-sy­mbols for Hello World TA
gp_conf_ta
Add-sy­mbols for GP conference TA
p <va­ria­ble>
Print variable
x/4wx <ad­dre­ss>
Show 4 words in hex at memory <ad­dre­ss>
b <fu­nct­ion>
Set a breakpoint for <fu­nct­ion>
info b
List all breakp­oints
d <br­eak­point number>
Delete breakpoint
n
Jump to next line
s
Step into function
symbol­-file <pa­th>­/na­me.elf
Loads symbols
add-sy­mbo­l-file <pa­th>­/na­me.elf
Adds additional symbols
$HOME/.gd­binit
Config­uration file for GDB

VirtualBox Image

Login / Password
optee / optee
VirtualBox downloads
Import image
File -> Import Alliance -> select <op­tee.ov­a>