Skip to content

Commit

Permalink
Merge pull request #58 from dkohlbre/dev-docs-build
Browse files Browse the repository at this point in the history
Updated docs based on new hifive builds, corrected some errors in doc…
  • Loading branch information
dkohlbre committed Mar 4, 2019
2 parents fc2021e + 695ef49 commit f621d4d
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 26 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ sudo apt update
sudo apt install autoconf automake autotools-dev bc bison build-essential curl \
expat libexpat1-dev flex gawk gcc git gperf libgmp-dev libmpc-dev libmpfr-dev \
libtool texinfo tmux patchutils zlib1g-dev wget bzip2 patch vim-common lbzip2 \
python pkg-config libglib2.0-dev libpixman-1-dev
python pkg-config libglib2.0-dev libpixman-1-dev device-tree-compiler
```

Some of the utilities also use ``expect`` so we recommend that you install that as well though it is not strictly necessary.
Expand All @@ -34,17 +34,17 @@ Setup Tools and Submodules

Build All for QEMU
```
make
make hifive
```

Run QEMU
```
./scripts/run-qemu.sh
./scripts/run-hifive-qemu.sh
```

Test

login with `root`/`busybear`.
login with `root`/`sifive`.

```
[in QEMU machine]
Expand Down
8 changes: 3 additions & 5 deletions docs/source/Getting-Started/Running-Keystone-on-Hardware.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,11 @@ You only need to reprogram the FSBL when modifying
Running on the HiFive
---------------------

Our default build process does not copy any of the binaries or driver
onto the Linux image.
The needed driver, bins, etc are included in the base image.

You will need to ``scp`` these files over to the board.
If you need to add files or change them we suggest ``scp``ing them to
the board after boot.
You can also copy these into the HiFive initramfs work directory and
rebuild the image to avoid setting up the network/etc.
Setup network
#############
Expand Down
40 changes: 23 additions & 17 deletions docs/source/Getting-Started/Running-Keystone-with-QEMU.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,7 @@ The fix will be upstreamed in the future.
Installing Dependencies
----------------------------

We tested Keystone with QEMU on CentOS and Ubuntu 16.04/18.04

Cent OS
###########
NOTE: This package list is known to be incorrect. It will be updated.

::

sudo yum install autoconf automake autotools-dev bc bison build-essential \
curl expat expat-devel flex gawk gcc gcc-c++ git gperf libgmp-dev libmpc-dev \
libmpfr-dev libtool mpfr-devel texinfo tmux patchutils zlib1g-dev zlib-devel \
wget bzip2-devel lbzip2 patch
We tested Keystone with QEMU Ubuntu 16.04/18.04 and derivatives.

Ubuntu
#######################
Expand All @@ -33,7 +22,7 @@ Ubuntu
sudo apt install autoconf automake autotools-dev bc bison build-essential curl \
expat libexpat1-dev flex gawk gcc git gperf libgmp-dev libmpc-dev libmpfr-dev \
libtool texinfo tmux patchutils zlib1g-dev wget bzip2 patch vim-common lbzip2 \
python pkg-config libglib2.0-dev libpixman-1-dev libssl-dev
python pkg-config libglib2.0-dev libpixman-1-dev libssl-dev device-tree-compiler

.. note::

Expand All @@ -47,12 +36,15 @@ Quick Setup
In this stage, you will (1) install RISC-V toolchain, and (2) checkout git submodules.

You can quickly setup everything by running ``./fast-setup.sh``

::

./fast-setup.sh

NOTE: the prebuilt toolchain in fast-setup is known to have problems
on Ubuntu 18.04 due to library versioning mismatches.

This will download pre-compiled RISC-V tools and extract it to ``riscv`` directory.

If you want to compile RISC-V tools from source code, run ``./setup.sh`` instead.

To keep environment variables, add export PATH=$PATH:<path/to/keystone>/riscv/bin to your .bashrc. You can also manually run ``source source.sh`` to set the environment variables.
Expand All @@ -64,27 +56,32 @@ Compile Sources
Build All
########################

If you want to build all, simply run ``make``.
If you want to build all, simply run ``make hifive``.

(You may run ``make`` which will build a Busybear based qemu-only
image, this is in the process of being depricated and eventually
``make hifive`` will become the default)

``PATH`` must include the RISC-V tool path.

::

make
make hifive

If you want to manually build each individual component, please follow the instructions below.
Otherwise, skip to :ref:`LaunchQEMU`.

.. attention::

Currently, ``make`` requires sudo previlege to build Busybear image.
We are going to get rid of this requirement in the future.

Build Busybear
################################

See `Busybear repo <https://github.com/michaeljclark/busybear-linux>`_ for more information.

We are in the process of deprecating all busybear based builds.

::

cd busybear-linux
Expand Down Expand Up @@ -175,6 +172,15 @@ Now, you're ready to run Keystone.
The following script will run QEMU, start executing from the emulated silicon root of trust.
The root of trust then jumps to the SM, and the SM boots Linux!

::

./scripts/run-hifive-qemu.sh

Login as ``root`` with the password ``sifive``.


Or if you want to run the busy-bear based image

::

sudo chmod og+w busybear-linux/busybear.bin
Expand Down

0 comments on commit f621d4d

Please sign in to comment.