SGX-Quick-Start.md 1.8 KB

SGX Quick Start

Quick Start to Run Applications in Intel SGX Enclaves

If you simply want to build and run Graphene on the same host, try the following steps:

** Note: Please use GCC version 4 or 5 **

** Please make sure the Intel SGX Linux SDK and driver are installed. **

If not, download and install from these two repositories: https://github.com/01org/linux-sgx and https://github.com/01org/linux-sgx-driver

** Note: Please use Intel SGX Linux SDK and driver version 1.9 or lower. **

1. Clone the repository and set the home directory of Graphene

git clone https://github.com/oscarlab/graphene.git
export GRAPHENE_DIR=$PWD/graphene

2. prepare a signing key

cd $GRAPHENE_DIR/Pal/src/host/Linux-SGX/signer
openssl genrsa -3 -out enclave-key.pem 3072

3. build PAL

cd $GRAPHENE_DIR/Pal/src
git submodule update --init -- $GRAPHENE_DIR/Pal/src/host/Linux-SGX/sgx-driver/
make SGX=1

4. build and install Graphene SGX driver

cd $GRAPHENE_DIR/Pal/src/host/Linux-SGX/sgx-driver
make
sudo ./load.sh

5. build the library OS

cd $GRAPHENE_DIR/LibOS
make SGX=1

6. Run a helloworld program

cd $GRAPHENE_DIR/LibOS/shim/test/native
make SGX=1
make SGX_RUN=1
./pal_loader SGX helloworld    or    SGX=1 ./pal_loader helloworld

7. Run LMBench

git submodule update --init -- $GRAPHENE_DIR/LibOS/shim/test/apps
cd $GRAPHENE_DIR/LibOS/shim/test/apps/lmbench
make SGX=1
make SGX_RUN=1
cd lmbench-2.5/bin/linux
./pal_loader SGX lat_syscall null    or   SGX=1 ./pal_loader lat_syscall null
./pal_loader SGX lat_syscall open    or   SGX=1 ./pal_loader lat_syscall open
./pal_loader SGX lat_syscall read    or   SGX=1 ./pal_loader lat_syscall read
./pal_loader SGX lat_proc fork       or   SGX=1 ./pal_loader lat_proc fork