Install from scratch - GaloisInc/camkes-vm GitHub Wiki
Installation
Tested on Ubutnu 16.04 (NOTE it might not run on newer distributions because some of the gcc settings have changed, see issue #85:
- Install Ubuntu 16.04+ dependencies (from seL4 wiki:
apt-get install git repo libncurses-dev python-pip libxml2-utils cmake ninja-build clang \
libssl-dev libsqlite3-dev libcunit1-dev gcc-multilib expect \
qemu-system-x86 qemu-system-arm gcc-arm-none-eabi binutils-arm-none-eabi
- Install Haskell stack:
curl -sSL https://get.haskellstack.org/ | sh
(optionally first dosudo apt install curl
) - Install python dependencies:
pip install --user camkes-deps
- Install repo tool
sudo apt install repo
- Install Rustup:
curl https://sh.rustup.rs -sSf | sh
- Setup rust:
rustup update nightly
rustup target add x86_64-rumprun-netbsd
rustup override set nightly
- Upgrade all your system packages:
sudo apt update
sudo apt upgrade
- Configure your github if you haven't done it before:
git config --global user.email "[email protected]"
git config --global user.name "my name"
- Make a new directory and
cd
into it - If you have write access to Galois repository:
repo init -u https://github.com/GaloisInc/camkes-manifest -m devel.xml -b devel
Otherwise:
repo init -u https://github.com/GaloisInc/camkes-manifest -m devel-no-ssh.xml -b devel
repo sync
(that will take some time)- Select a target to make, for example
make x86_64_rumprun_rust_defconfig
make silentoldconfig
make
Running
- To be able to create a bridge:
sudo apt install bridge-utils
*. run a script to setup a network bridge with a host:
sudo brctl addbr br0
sudo ip addr add 192.168.179.1/24 broadcast 192.168.179.255 dev br0
sudo ip link set br0 up
sudo ip tuntap add dev tap0 mode tap
sudo ip link set tap0 up promisc on
sudo brctl addif br0 tap0
sudo dnsmasq --interface=br0 --bind-interfaces --dhcp-range=192.168.179.10,192.168.179.254
- For 64 bit target, run with:
qemu-system-x86_64 -m 2048 -cpu Haswell,+vmx,+fsgsbase -serial /dev/stdout -vga std -netdev tap,id=t0,ifname=tap0,script=no,downscript=no -device e1000,netdev=t0,id=nic0 --enable-kvm -smp 2 -kernel images/kernel-x86_64-pc99 -initrd images/capdl-loader-experimental-image-x86_64-pc99
- For 32 bit targets, do:
qemu-system-i386 -m 1024 -cpu Nehalem,+vmx -serial /dev/stdout -vga std -netdev tap,id=t0,ifname=tap0,script=no,downscript=no -device e1000,netdev=t0,id=nic0 --enable-kvm -smp 2 -kernel images/kernel-ia32-pc99 -initrd images/capdl-loader-experimental-image-ia32-pc99
Troubleshooting
- if stack reports a problem with packages, and
stack clean
doesn't help, try to clean its cacherm ~/.stack/indices/Hackage*
- No
x86_64-rumprun-netbsd-gcc
? You have to tellcargo
where to look for those. They are compiled during the sel4 build process, butcargo
doesn't know that. The easiest way is to addexport PATH="$PATH:/path_to_your_camkes_dir/build2/x86_64/rumprun/bin
to yout.bashrc
file and then dosource ~/.bashrc