Skip to content

Commit

Permalink
README: riscv: Add documentation for new platform
Browse files Browse the repository at this point in the history
Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
  • Loading branch information
rbradford committed Mar 20, 2023
1 parent 282282f commit 8f045c1
Showing 1 changed file with 52 additions and 13 deletions.
65 changes: 52 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,6 @@ This project was originally developed using
currently support resetting the virtio block device it is not possible to boot
all the way into the OS.

## Building

To compile:

cargo build --release --target x86_64-unknown-none.json -Zbuild-std=core,alloc -Zbuild-std-features=compiler-builtins-mem

The result will be in:

target/x86_64-unknown-none/release/hypervisor-fw

## Features

* virtio (PCI) block support
Expand All @@ -44,15 +34,31 @@ target/x86_64-unknown-none/release/hypervisor-fw
* PE32+ loader
* Minimal EFI environment (sufficient to boot shim + GRUB2 as used by Ubuntu)

## Running
## x86-64 Support

### Building

To compile:

```
cargo build --release --target x86_64-unknown-none.json -Zbuild-std=core,alloc -Zbuild-std-features=compiler-builtins-mem
```

The result will be in:

```
target/x86_64-unknown-none/release/hypervisor-fw
```

### Running

Works with Cloud Hypervisor and QEMU via their PVH loaders as an alternative to
the Linux kernel.

Cloud Hypervisor and QEMU are currently the primary development targets for the
firmware although support for other VMMs will be considered.

### Cloud Hypervisor
#### Cloud Hypervisor

As per [getting
started](https://github.com/cloud-hypervisor/cloud-hypervisor/blob/master/README.md#2-getting-started)
Expand All @@ -73,7 +79,7 @@ $ ./cloud-hypervisor/target/release/cloud-hypervisor \
$ popd
```

### QEMU
#### QEMU

Use the QEMU `-kernel` parameter to specify the path to the firmware.

Expand All @@ -88,6 +94,39 @@ $ qemu-system-x86_64 -machine q35,accel=kvm -cpu host,-vmx -m 1G\
-device virtio-blk-pci,drive=os,disable-legacy=on
```

## RISC-V Support

Experimental RISC-V support is avaiable. This is currently designed to run as a
payload from OpenSBI under QEMU virt. It is expected wider platform support
will become available in the future.

### Building

To compile:

```
cargo build --release --target riscv64gcv-unknown-none-elf.json -Zbuild-std=core,alloc -Zbuild-std-features=compiler-builtins-mem
```

The result will be in:

```
target/riscv64gcv-unknown-none-elf/release/hypervisor-fw
```

### Running

Currently only QEMU has been tested.

#### QEMU

```
$ qemu-system-riscv64 -M virt -cpu rv64 -smp 1 -m 1024 \
-nographic -kernel target/riscv64gcv-unknown-none-elf/release/hypervisor-fw \
-drive id=mydrive,file=root.img,format=raw \
-device virtio-blk-pci,drive=mydrive,disable-legacy=on
```

## Testing

"cargo test" needs disk images from make-test-disks.sh
Expand Down

0 comments on commit 8f045c1

Please sign in to comment.