summaryrefslogtreecommitdiff
path: root/run_qemu.sh
diff options
context:
space:
mode:
authorzy <[email protected]>2023-11-29 16:02:23 +0800
committerzy <[email protected]>2023-11-29 16:02:23 +0800
commit13ba531c1a7696b6bad72720e5d6bd055cb170b0 (patch)
treefa4c97023718915554d4f9d427d98a26f772e088 /run_qemu.sh
parent809f581cefe9c9daad8b38cf1fd322583c617b17 (diff)
debug kernel
Diffstat (limited to 'run_qemu.sh')
-rwxr-xr-xrun_qemu.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/run_qemu.sh b/run_qemu.sh
new file mode 100755
index 0000000..07c4562
--- /dev/null
+++ b/run_qemu.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+pwd="/home/zy/Git/variable_monitor"
+
+box=/home/zy/qemu_uintr/initramfs/initramfs-busybox-x86_64.cpio.gz
+busybox=$pwd/miniroot/busybox.cpio.gz
+ubuntu=$pwd/miniroot/ubuntu.cpio.gz
+
+PORT=2222
+QEMU=qemu-system-x86_64
+KERNEL=$pwd/linux-5.17.15/arch/x86_64/boot/bzImage
+
+$QEMU -smp 4 \
+-machine q35,kernel_irqchip=split \
+-m 4096M -nographic -cpu qemu64 \
+-kernel $KERNEL \
+-initrd $ubuntu \
+-append "root=/dev/ram0 rw rootfstype=ext4 console=ttyS0 init=/linuxrc" \
+-net user,hostfwd=tcp::${PORT}-:22 -net nic,model=e1000e \
+-serial mon:stdio \
+-virtfs local,path=$pwd/build,mount_tag=test,security_model=passthrough,id=test \
+-s -S
+# -D none
+# 等待gdb连接
+# -s -S