Skip to content

Commit

Permalink
Merge pull request #33 from dayeol/dev-qemu-networking
Browse files Browse the repository at this point in the history
Enable QEMU networking using user net device
  • Loading branch information
dayeol committed Jan 24, 2019
2 parents 7389db5 + 072aa35 commit fd366e2
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 2 deletions.
51 changes: 51 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
git submodule update --init --recursive

mkdir riscv
export RISCV=$(pwd)/riscv
export PATH=$PATH:$RISCV/bin
cd riscv-gnu-toolchain
./configure --prefix=$RISCV
make && make linux
cd ..

cd busybear-linux
make
cd ..

./scripts/apply-patch.sh
cd riscv-qemu
./configure --target-list=riscv64-softmmu,riscv32-softmmu
make
cd ..

cd riscv-linux
cp ../busybear-linux/conf/linux.config .config
make ARCH=riscv olddefconfig
make ARCH=riscv vmlinux
cd ..

cd riscv-pk
mkdir build
cd build
../configure \
--enable-logo \
--host=riscv64-unknown-elf \
--with-payload=../../riscv-linux/vmlinux \
--enable-sm
make
cd ../..

cd bootrom
make
cd ..

cd linux-keystone-driver
make
make copy
cd ..

cd sdk
make
make copy-tests
cd ..

2 changes: 1 addition & 1 deletion busybear-linux
52 changes: 52 additions & 0 deletions fast-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
git clone https://github.com/keystone-enclave/firesim-riscv-tools-prebuilt.git --depth=1

export RISCV=$(pwd)/riscv
export PATH=$PATH:$RISCV/bin

cd firesim-riscv-tools-prebuilt
./installrelease.sh
mv distrib ../riscv
cd ..
rm -rf firesim-riscv-tools-prebuilt

cd busybear-linux
make
cd ..

./scripts/apply-patch.sh
cd riscv-qemu
./configure --target-list=riscv64-softmmu,riscv32-softmmu
make
cd ..

cd riscv-linux
cp ../busybear-linux/conf/linux.config .config
make ARCH=riscv olddefconfig
make ARCH=riscv vmlinux
cd ..

cd riscv-pk
mkdir build
cd build
../configure \
--enable-logo \
--host=riscv64-unknown-elf \
--with-payload=../../riscv-linux/vmlinux \
--enable-sm
make
cd ../..

cd bootrom
make
cd ..

cd linux-keystone-driver
make
make copy
cd ..

cd sdk
make
make copy-tests
cd ..

3 changes: 2 additions & 1 deletion scripts/run-qemu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
-kernel riscv-pk/build/bbl -append "root=/dev/vda ro console=ttyS0" \
-drive file=busybear-linux/busybear.bin,format=raw,id=hd0 \
-device virtio-blk-device,drive=hd0 \
#-netdev type=tap,script=./ifup,downscript=./ifdown,id=net0 \
-netdev user,id=net0,net=192.168.100.1/24,dhcpstart=192.168.100.128,hostfwd=tcp::5555-:22 \
-device virtio-net-device,netdev=net0

0 comments on commit fd366e2

Please sign in to comment.