aboutsummaryrefslogtreecommitdiffhomepage
path: root/content/2019-10-27-kernel-debugging-qemu/index.md
diff options
context:
space:
mode:
Diffstat (limited to 'content/2019-10-27-kernel-debugging-qemu/index.md')
-rw-r--r--content/2019-10-27-kernel-debugging-qemu/index.md9
1 files changed, 7 insertions, 2 deletions
diff --git a/content/2019-10-27-kernel-debugging-qemu/index.md b/content/2019-10-27-kernel-debugging-qemu/index.md
index 518b3d5..bda445b 100644
--- a/content/2019-10-27-kernel-debugging-qemu/index.md
+++ b/content/2019-10-27-kernel-debugging-qemu/index.md
@@ -8,6 +8,8 @@ tags = ["linux", "qemu"]
**EDIT**:
- 2021-07-15: Added `Appendix: Dockerfile for Kernel development` and updated
busybox + Kernel versions.
+- 2023-11-23: Fix ramdisk vs ramfs ([ref][ramfs-vs-ramdisk]), and use
+ `devtmpfs` and updated busybox + Kernel versions.
The other evening while starring at some Linux kernel code I thought, let me
setup a minimal environment so I can easily step through the code and examine
@@ -15,7 +17,7 @@ the state.
I ended up creating:
- a [Linux kernel][linux-kernel] with minimal configuration
-- a minimal [ramdisk][initrd] to boot into which is based on [busybox][busybox]
+- a minimal [initramfs][initramfs] to boot into which is based on [busybox][busybox]
In the remaing part of this article we will go through each step by first
building the kernel, then building the initrd and then running the kernel using
@@ -31,7 +33,7 @@ This allows us to merge a fragment file into the current configuration by
running the `scripts/kconfig/merge_config.sh` script.
Let's quickly go over some customizations we do.
-The following two lines enable support for gzipped initramdisks:
+The following two lines enable support for gzipped initramfs:
```config
CONFIG_BLK_DEV_INITRD=y
CONFIG_RD_GZIP=y
@@ -78,6 +80,7 @@ cat <<EOF > init
mount -t proc none /proc
mount -t sysfs none /sys
+mount -t devtmpfs none /dev
exec setsid cttyhack sh
EOF
@@ -217,6 +220,8 @@ docker run -it kernel-dev
[linux-kernel]: https://www.kernel.org
[initrd]: https://www.kernel.org/doc/html/latest/admin-guide/initrd.html
+[ramfs]: https://www.kernel.org/doc/html/latest/filesystems/ramfs-rootfs-initramfs.html
+[ramfs-vs-ramdisk]: https://www.kernel.org/doc/html/latest/filesystems/ramfs-rootfs-initramfs.html#ramfs-and-ramdisk
[busybox]: https://busybox.net
[qemu]: https://www.qemu.org
[gdb]: https://www.gnu.org/software/gdb