forked from mit-pdos/xv6-riscv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprep_env.sh
executable file
·33 lines (26 loc) · 1.01 KB
/
prep_env.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
# works for ubuntu2204
# clone with sub module and not clone git history,only clone for build riscv-gnu-toolchain
git clone --depth 1 https://github.com/riscv/riscv-gnu-toolchain
cd riscv-gnu-toolchain
git submodule init
git submodule update --depth 1
# --depth 1 option only the latest commit in the history.
cd ./riscv-gnu-toolchain
sudo apt-get install autoconf automake autotools-dev curl python3 python3-pip libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev ninja-build git cmake libglib2.0-dev -y
sudo mkdir -p /opt/riscv/bin
sudo chmod 777 /opt/riscv/bin
echo 'export PATH=$PATH:/opt/riscv/bin' >>~/.bashrc
source ~/.bashrc
# above not good.
# do this: will let make qemu work.
sudo apt-get install git build-essential gdb-multiarch qemu-system-misc gcc-riscv64-linux-gnu binutils-riscv64-linux-gnu -y
# quit qemu:
If you are running with nographic options below option worked for me
step 1:
Cntrl + a
Step 2
press c
Step 3
write quit
#