Skip to content

Instantly share code, notes, and snippets.

@abelardojarab
Created November 7, 2017 20:01
Show Gist options
  • Save abelardojarab/503def7ed78f86f73d6334c2f071c128 to your computer and use it in GitHub Desktop.
Save abelardojarab/503def7ed78f86f73d6334c2f071c128 to your computer and use it in GitHub Desktop.
Using qemu and gdb stub for debugging Linux kernel
#!/bin/bash
sudo ~/Downloads/qemu-2.9.0/x86_64-softmmu/qemu-system-x86_64 -hda backups/ubuntu15u10_amd64.img -append "root=/dev/sda1 console=hvc0 ip=dhcp rd.shell=1" -chardev stdio,id=stdio,mux=on -device virtio-serial-pci -device virtconsole,chardev=stdio -mon chardev=stdio -m 16000 -net nic,model=virtio,macaddr=52:54:00:12:34:56 -net user,hostfwd=tcp:127.0.0.1:4444-:22 -net tap,id=network0,ifname=tap0,script=no,downscript=no -display none -fsdev local,id=fs1,path=$HOME/shared,security_model=none -kernel /mnt/data/ajaraber/VMs/linux-4.8/arch/x86_64/boot/bzImage -smp 16 -runas lab -s -enable-kvm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment