diff --git a/macos.md b/macos.md index d8aa2dc..3609272 100644 --- a/macos.md +++ b/macos.md @@ -1,9 +1,26 @@ -# Instructions for getting the build running on MacOS +# Instructions for getting the build of the security monitor running on MacOS -1. Install the Risc-V toolchain. -2. environment variables - TODO see diff +1. Install basic dependencies. +``` +brew install coreutils # to have nproc available +brew install autoconf automake curl python libmpc mpfr gmp gawk flex texinfo libtool bc expat # for OpenSBI build +``` -3. +2. Install the Risc-V toolchain. +``` +# https://github.com/riscv-software-src/homebrew-riscv +brew tap riscv-software-src/riscv +brew install riscv-gnu-toolchain +``` + +3. Source environment variables. +``` +source macos_env +``` + +4. Build the security monitor: +``` +make security_monitor +``` diff --git a/macos_env b/macos_env index 7dd2445..fc51cd6 100644 --- a/macos_env +++ b/macos_env @@ -3,5 +3,3 @@ export RISCV_GNU_TOOLCHAIN_WORK_DIR=/opt/homebrew/Cellar/riscv-gnu-toolchain/mai export PATH=$RISCV_GNU_TOOLCHAIN_WORK_DIR/bin:$PATH export CROSS_COMPILE=riscv64-unknown-elf- -alias nproc="sysctl -n hw.logicalcpu" - diff --git a/security-monitor/rust-crates/opensbi.sh b/security-monitor/rust-crates/opensbi.sh index 6547141..ec660d4 100755 --- a/security-monitor/rust-crates/opensbi.sh +++ b/security-monitor/rust-crates/opensbi.sh @@ -35,7 +35,7 @@ cd ${OPENSBI_SOURCE_DIR}/ git reset --hard find $PATCH_DIR -type f -name '*.patch' -print0 | xargs -0 git apply -make CROSS_COMPILE=${CROSS_COMPILE} O=${WORK_DIR} PLATFORM=generic -j$(sysctl -n hw.logicalcpu) +make CROSS_COMPILE=${CROSS_COMPILE} O=${WORK_DIR} PLATFORM=generic -j$(nproc) make CROSS_COMPILE=${CROSS_COMPILE} I=${WORK_DIR} PLATFORM=generic install echo "done"