Many research papers have dealed about how SGX internally works, however, none have handled how SGX SDK works. This post explains how Intel Linux SGX SDK calls Intel SGX CPU instructions, to create an enclave. As we all know, There is an SGX instruction we use to create an enclave, EADD. This is a Intel CPU microcode instruction. However, a user program does not directly call this instruction, but calls sgx_create_enclave() SDK function.