Skip to contentSkip to conversation

docs: add example of building the Linux kernel

PATCH New Tim Hutt 2 participants 2 messages Oct 4, 2024 – Oct 5, 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 | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
docs/platform/qemu_virt.md +7 -1
index 0783be4..71faf42 100644
@@ -56,7 +56,13 @@ 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
#1 lore raw

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

Quoted 1 line · Tim Hutt

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

This patch also needs your signoff (Signed-off-by:).

Quoted 9 lines
---
 docs/platform/qemu_virt.md | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
docs/platform/qemu_virt.md +0 -0
index 0783be4..71faf42 100644

docs/platform/qemu_virt.md qemu-system-riscv64 -M virt -m 256M -nographic \ · line 59

Quoted 5 lines
docs/platform/qemu_virt.md +1 -1
@@ -56,7 +56,13 @@ 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`).

Please wrap to 80 columns to match the rest of the file.

docs/platform/qemu_virt.md qemu-system-riscv64 -M virt -m 256M -nographic \ · line 68

Quoted 9 lines
docs/platform/qemu_virt.md +6 -0
+
+Example of building a Linux kernel:
+```
+make ARCH=riscv CROSS_COMPILE=riscv64-linux- defconfig
+make ARCH=riscv CROSS_COMPILE=riscv64-linux- Image
+```
 
 Build:
 ```

With these fixed, you can add: