Skip to contentSkip to conversation

docs: add example of building the Linux kernel

PATCH New Tim Hutt 2 participants 2 messages Oct 8, 2024 – Nov 9, 2024

lore
Share & tools
lore

Tim Hutt

author
#0 lore raw

PATCH 1/1 docs: add example of building the Linux kernel

Slightly expand the QEMU docs to explain how to build the flat Linux kernel image.

---
 docs/platform/qemu_virt.md | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
docs/platform/qemu_virt.md +8 -1
index 0783be4..fd87ee5 100644
@@ -56,7 +56,14 @@ qemu-system-riscv64 -M virt -m 256M -nographic \
 **Linux Kernel Payload**
 
 Note: We assume that the Linux kernel is compiled using
-*arch/riscv/configs/defconfig*.
+*arch/riscv/configs/defconfig*. The kernel must be a flattened image (a file
+called `Image`) rather than an ELF (`vmlinux`).
+
+Example of building a Linux kernel:
+```
+make ARCH=riscv CROSS_COMPILE=riscv64-linux- defconfig
+make ARCH=riscv CROSS_COMPILE=riscv64-linux- Image
+```
 
 Build:
 ```
Signature · 1 line
2.39.2
Applied
#1 lore raw

PATCH 1/1 docs: add example of building the Linux kernel

Quoted 5 lines · On Tue, Oct 8, 2024 at 3:20?PM Tim Hutt <[email protected]> wrote:

Slightly expand the QEMU docs to explain how to build the flat Linux kernel image.

LGTM.

Applied this patch to the riscv/opensbi repo.

Thanks,
Anup

Quoted 32 lines
---
 docs/platform/qemu_virt.md | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
docs/platform/qemu_virt.md +8 -2
index 0783be4..fd87ee5 100644
@@ -56,7 +56,14 @@ qemu-system-riscv64 -M virt -m 256M -nographic \
 **Linux Kernel Payload**
 
 Note: We assume that the Linux kernel is compiled using
-*arch/riscv/configs/defconfig*.
+*arch/riscv/configs/defconfig*. The kernel must be a flattened image (a file
+called `Image`) rather than an ELF (`vmlinux`).
+
+Example of building a Linux kernel:
+```
+make ARCH=riscv CROSS_COMPILE=riscv64-linux- defconfig
+make ARCH=riscv CROSS_COMPILE=riscv64-linux- Image
+```
 
 Build:
 ```
--

2.39.2

--
opensbi mailing list
opensbi at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi