# 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: and __** 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