aboutsummaryrefslogtreecommitdiffstats
path: root/docs/linux/setup_linux-host_qemu-vm_riscv64-kernel.md
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2020-07-01 15:38:30 +0200
committerDmitry Vyukov <dvyukov@google.com>2020-07-01 21:29:39 +0200
commit695ef2ddb23a75efd3b82c7a3b36cfe0ae671c86 (patch)
tree959d329f58ab03ad23003409b81f5def469a6a87 /docs/linux/setup_linux-host_qemu-vm_riscv64-kernel.md
parent39acb39de241670ec7f96312c37e4e84f97f5f19 (diff)
docs/linux: use OpenSBI instead of BBL to boot linux/riscv64 QEMU VM
OpenSBI seems to be the recommended boot method nowadays, see e.g. [1], [2] [1] https://riscv.org/2019/01/risc-v-community-releases-opensbi-to-foster-continued-ecosystem-growth/ [2] https://wiki.freebsd.org/riscv#OpenSBI Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'docs/linux/setup_linux-host_qemu-vm_riscv64-kernel.md')
-rw-r--r--docs/linux/setup_linux-host_qemu-vm_riscv64-kernel.md22
1 files changed, 12 insertions, 10 deletions
diff --git a/docs/linux/setup_linux-host_qemu-vm_riscv64-kernel.md b/docs/linux/setup_linux-host_qemu-vm_riscv64-kernel.md
index aa160fc03..bb8ba55d3 100644
--- a/docs/linux/setup_linux-host_qemu-vm_riscv64-kernel.md
+++ b/docs/linux/setup_linux-host_qemu-vm_riscv64-kernel.md
@@ -22,21 +22,23 @@ Also enable the [recommended Kconfig options for syzkaller](/docs/linux/kernel_c
Then build kernel with:
```
-make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- -j $(nproc) vmlinux
+make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- -j $(nproc)
```
-# BBL (Berkeley Boot Loader)
+# OpenSBI
-Clone the BBL repository and build the bootable image containg bootloader and kernel:
+Clone the OpenSBI repository and build the bootable OpenSBI image containg the kernel:
```shell
-git clone https://github.com/riscv/riscv-pk
-cd riscv-pk
-mkdir build && cd build
-../configure --enable-logo --host=riscv64-linux-gnu --with-payload=/path/to/linux/vmlinux
-make
+git clone https://github.com/riscv/opensbi
+cd opensbi
+make CROSS_COMPILE=riscv64-linux-gnu- PLATFORM_RISCV_XLEN=64 PLATFORM=generic FW_PAYLOAD_PATH=<linux_build_directory>/arch/riscv/boot/Image
```
+See the OpenSBI documentation for booting on the
+[QEMU RISC-V Virt Machine Platform](https://github.com/riscv/opensbi/blob/master/docs/platform/qemu_virt.md)
+for more information.
+
# Image
We will use buildroot to create the disk image. You can obtain buildroot
@@ -94,7 +96,7 @@ Run:
qemu-system-riscv64 \
-machine virt \
-nographic \
- -kernel /riscv-pk/build/bbl \
+ -kernel /opensbi/build/platform/generic/firmware/fw_payload.elf \
-append "root=/dev/vda ro console=ttyS0" \
-object rng-random,filename=/dev/urandom,id=rng0 \
-device virtio-rng-device,rng=rng0 \
@@ -135,7 +137,7 @@ Create the manager config `riscv64.cfg` similar to the following one (adjusting
"type": "qemu",
"vm": {
"count": 1,
- "kernel": "/riscv-pk/build/bbl",
+ "kernel": "/opensbi/build/platform/generic/firmware/fw_payload.elf",
"cpu": 2,
"mem": 2048
}