Skip to content

a research prototype to show one of the numerous Yggdrasil implementations

License

Notifications You must be signed in to change notification settings

Yggdrasil-Model/HierarBusOS

Repository files navigation

HierarBusOS

HierarBusOS a research prototype in Rust to show one of the numerous Yggdrasil implementations.

HierarBusOS is under active development, and although it is not yet mature.

Building and Running HierarBusOS on Linux

Note: Linux, 64-bit Debian-based distributions like Ubuntu, tested on Ubuntu 20.04.

git clone https://github.com/Yggdrasil-Model/HierarBusOS.git

Setting up the Rust development environment

  1. Install Rust by following the setup instructions here. On Linux, just run:
curl https://sh.rustup.rs -sSf | sh
  1. Make environment variables work
source $HOME/.cargo/env
  1. Make sure the Rust toolchain is installed correctly

Note: Only use the nightly version of rustc.

rustc --version
  1. Install dependencies:
rustup target add riscv64gc-unknown-none-elf
cargo install cargo-binutils --vers =0.3.3
rustup component add llvm-tools-preview
rustup component add rust-src

QEMU installation

  1. Install dependencies:
sudo apt install autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev  gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev pkg-config  libglib2.0-dev libpixman-1-dev git tmux python3 python3-pip
  1. Download package
wget https://download.qemu.org/qemu-5.0.0.tar.xz
  1. Unpacking
tar xvJf qemu-5.0.0.tar.xz
  1. Compile
cd qemu-5.0.0
./configure --target-list=riscv64-softmmu,riscv64-linux-user
make -j$(nproc)

Note: The above dependencies may not be complete, for example, the following errors may occur on Ubuntu 18.04:

  • ERROR: pkg-config binary 'pkg-config' not found. You can install pkg-config.
  • ERROR: glib-2.48 gthread-2.0 is required to compile QEMU. You can install libglib2.0-dev
  • ERROR: pixman >= 0.21.8 not present. You can install libpixman-1-dev.
  1. Install
sudo make install
or 
# add lines in ~/.bashrc
export PATH=$PATH:$HOME/qemu-5.0.0
export PATH=$PATH:$HOME/qemu-5.0.0/riscv64-softmmu
export PATH=$PATH:$HOME/qemu-5.0.0/riscv64-linux-user
source ~/.bashrc

Running LMbench in C

  1. Build musl-libc
git clone https://github.com/richfelker/musl-cross-make.git
cp config.mak.dist config.mak
   
# add lines in config.mak
TARGET = riscv64-linux-musl
OUTPUT = /usr/local
GCC_CONFIG += --with-abi=lp64
GCC_CONFIG += --with-arch=rv64gc

make && sudo make install
  1. Compile
cd cbenchmark
make

Enable netdev

  1. install tools
sudo apt install bridge-utils
sudo apt install uml-utilities
  1. config
sudo chmod u+s /usr/lib/qemu/qemu-bridge-helper
sudo brctl addbr br0
sudo ip link set br0 up
  1. create the required file(*/bridge.conf),otherwise the following error occurs
failed to parse default acl file `/etc/qemu/bridge.conf'
qemu-system-riscv64: bridge helper failed

  1. echo "allow br0" > /etc/qemu/bridge.conf,otherwise the following error occurs
access denied by acl file
qemu-system-riscv64: bridge helper failed

Building and Running

cd Initial_stage
make run

About

a research prototype to show one of the numerous Yggdrasil implementations

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published