From 82e9ac4163b46b59e121194f84ac370818482923 Mon Sep 17 00:00:00 2001 From: johannst Date: Thu, 15 Jul 2021 21:20:14 +0200 Subject: use proper date fmt in content file names that zola can automatically can derive the date --- content/2019-10-27-kernel-debugging-qemu/run.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 content/2019-10-27-kernel-debugging-qemu/run.sh (limited to 'content/2019-10-27-kernel-debugging-qemu/run.sh') diff --git a/content/2019-10-27-kernel-debugging-qemu/run.sh b/content/2019-10-27-kernel-debugging-qemu/run.sh new file mode 100755 index 0000000..b0a84ae --- /dev/null +++ b/content/2019-10-27-kernel-debugging-qemu/run.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +VER=5.13.2 + +# Launch the emulator with our kernel. +qemu-system-x86_64 \ + -kernel ./linux-$VER/arch/x86/boot/bzImage \ + -nographic \ + -append "earlyprintk=ttyS0 console=ttyS0 nokaslr init=/init debug" \ + -initrd ./initramfs.cpio.gz \ + -serial telnet:localhost:12345,server,nowait \ + -monitor none \ + -gdb tcp::1234 \ + -S & + +# Kill qemu when we exit. +QEMU_PID=$! +trap "kill $QEMU_PID" EXIT + +# Give qemu some time to come up. +sleep 0.5 + +# Attach debugger to qemu and load the kernel symbols. +gdb -ex 'target remote :1234' ./linux-$VER/vmlinux -- cgit v1.2.3