Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Getting Started

Álvaro Jurado edited this page Oct 3, 2018 · 99 revisions

Harvey is a distributed operating system. It can be built with clang, gcc or icc (Intel Compiler). It can run on amd64 (x86_64), main line of the project, and RISC-V.

This file is a quick list of instructions to get you started quickly.

Before you start

How to get Prerequisites

To build Harvey and play with it, you need to have git, golang, qemu, a working compiler gcc, clang or icc, binutils and bison installed.

This programs could have different versions across the platforms in what Harvey can be built. As a reference, we're now working with this toolchain versions:

GCC: gcc 6.x, 7.x and 8.x for cross compiling. gcc 4.7 as first attempt of native toolchain.

Clang: 3.9, 4.0 and 6.0

Binutils: 2.29 and higher. Lower versions won't be compatible with some ld flags.

Errors derived from other versions, please report to our List or Slack channels.

Official support

we test with Linux on every commit

Linux

On a Debian, Ubuntu or other .deb system, you should be able to get going with:

sudo apt install git golang build-essential bison qemu-system curl

Experimental

these aren't tested development platforms

Docker

If you are familiarized with Docker, Harvey has available an updated repo in Docker Hub for you:

docker run harveyos/harvey

to build harvey in your own machine

docker run -v `pwd`:/harvey --entrypoint=/harvey/util/build harveyos/harvey

and run it

docker run -v `pwd`:/harvey harveyos/harvey

FreeBSD

(Regulary tested with latest release version)

If you are in a FreeBSD, you should do:

pkg install git go gcc7 clang6 bison
export PATH=/usr/local/bin:$PATH

In case you want to use gcc, this trick will be needed ensuring you use right flags for gcc 7:

ln -s /usr/local/bin/gcc7 /usr/bin/gcc-7

OSX

(tested on OS X "El Capitan" and macOS "Sierra", see homebrew-gcc_cross_compilers)

If you try to clone the git repo on Mac, you'll have problems due to files in some folders having names that differ only in case (e.g. HB and Hb). This is due to the Mac filesystem (HFS+) being case-insensitive by default.

The way to work around it is to create a case-sensitive disk image and clone the repo into that. You can then do all your work there:

  • Download the workspace.sh script from here.
  • Use it to create a new disk image (5g in this case, way more than necessary):
    • CASE_SAFE_VOLUME_SIZE=5g workspace.sh create
    • workspace.sh mount
  • Now you can clone the repo and continue with the build steps below.

After this, you should install macports and do

port install x86_64-elf-gcc
port install x86_64-elf-binutils
port install qemu
export TOOLPREFIX=x86_64-elf-

or if you use homebrew

brew tap sevki/gcc_cross_compilers
brew install sevki/gcc_cross_compilers/x86_64-elf-gcc
brew install qemu go
export TOOLPREFIX=x86_64-elf-

Windows 10

You can use the Windows Linux Subsystem to compile and run Harvey. First you need to install it, you can follow the steps in the official Windows documentation.

Once you have a bash terminal on your Windows, just follows the steps for Linux, and when you have Harvey compiled, use the script util/GO9PCPUDOCKER to run it.

Now you need drawtermto connect to your Harvey. To do this, you can download the 9front version.

BUILD

You'll need to bootstrap everything the first time:

./bootstrap.sh

This will set up the git repo for code review and build the build tool. You should now be able to build everything by running

CC=gcc ARCH=amd64 util/build

In case you want to build it with clang:

CC=clang ARCH=amd64 util/build

For FreeBSD users who want to use gcc7:

CC=gcc-7 ARCH=amd64 util/build

Getting ninep to serve your files

You can run ninep manually in another shell session just executing this:

util/ufs -root=/$HARVEY-REPO_PATH -debug=3

In case of bootstrap.sh script didn't gave you an ufs binary for whatever reason, or you found some problem running it, you can get and test ninep in the following way

git submodule init
git submodule update
export GOPATH=$(pwd)/util/third_party:$(pwd)/util
export GOBIN=$(pwd)/util
go install github.com/Harvey-OS/ninep/cmd/ufs

In case last would give you some problem, try installing libs first:

go install github.com/Harvey-OS/ninep/protocol
go install github.com/Harvey-OS/ninep/filesystem

Running Harvey

Once ninep is running, move to Harvey's repo directory and just boot Harvey as cpu server with this:

export HARVEY=$(pwd)
    util/GO9PCPU

This will start harvey and it will use DHCP to get an IP. On some systems (VMWare Fusion on OSX) the DHCP may not work well. You can extend the arguments in the scripts, with, e.g.:

bootargs='tcp -g 192.168.0.2 ether /net/ether0 192.168.0.15 255.255.255.0'

In this case, our gateway is 192.168.0.2, and our IP is 192.168.0.15.


  • You could test Harvey with Virtio capabilities of QEMU, just follow this guide for it.

Once Harvey is up, let's go to see how to have some GUI working.