Env: macOS Catalina
10.15.7
Step1: git clone --recursive https://github.com/riscv/riscv-gnu-toolchain
Although it doesn't need
--recursive
in README, this issue still happened on mac.
Step2: brew install python3 gawk gnu-sed gmp mpfr libmpc isl zlib expat
Step3: cd riscv-gnu-toolchain
directory and ./configure --prefix=/opt/riscv --enable-multilib
To build either cross-compiler with support for both 32-bit and 64-bit
Step4: find your .zshrc
, append this line export PATH="$PATH:/opt/riscv/bin"
and then source .zshrc
DONE !!
After installing
qemu
sucessfully, let's start to build xv6-riscvStep1:
git clone git://github.com/mit-pdos/xv6-riscv-fall19.git
The
xv6-riscv-fall19
repository differs slightly from the book'sxv6-riscv
in order to make the labs easier.Step2:
cd xv6-riscv-fall19
andmake
Step3:
make qemu
DONE !