screenshot, vm to description, qemu debug non intrusive

This commit is contained in:
Ciro Santilli
2017-06-14 08:11:54 +01:00
parent 251a8ecf53
commit 53c1b61879
4 changed files with 9 additions and 3 deletions

View File

@@ -1,6 +1,8 @@
# Linux Kernel Module Cheat # Linux Kernel Module Cheat
Run one command, get into QEMU Buildroot BusyBox with several minimal Linux kernel 4.9 module example tutorials with GDB and KGDB debug. Tested in x86 and ARM guests, Ubuntu 14.04 - 16.10 hosts. Run one command, get into QEMU Buildroot BusyBox virtual machine with several minimal Linux kernel 4.9 module example tutorials with GDB and KGDB debug. Tested in x86 and ARM guests, Ubuntu 14.04 - 16.10 hosts.
![](screenshot.png)
Usage: Usage:

2
run
View File

@@ -39,7 +39,7 @@ env \
make \ make \
BR2_JLEVEL="$(($(nproc) - 2))" \ BR2_JLEVEL="$(($(nproc) - 2))" \
HOST_QEMU_OPTS="--enable-debug --enable-sdl --with-sdlabi=2.0" \ HOST_QEMU_OPTS="--enable-debug --enable-sdl --with-sdlabi=2.0" \
host-qemu-reconfigure \ host-qemu-rebuild \
kernel_module-rebuild \ kernel_module-rebuild \
all \ all \
; ;

View File

@@ -5,6 +5,7 @@ set -e
# CLI handling. # CLI handling.
arch=x86_64 arch=x86_64
debug=false debug=false
debug_qemu=''
kgdb=false kgdb=false
nographic=false nographic=false
extra_append='' extra_append=''
@@ -31,6 +32,9 @@ while getopts a:dkn OPT; do
extra_flags="$extra_flags -nographic" extra_flags="$extra_flags -nographic"
nographic=true nographic=true
;; ;;
q)
debug_qemu='gdb -q -ex start --args'
;;
esac esac
done done
shift "$(($OPTIND - 1))" shift "$(($OPTIND - 1))"
@@ -42,7 +46,7 @@ case "$arch" in
if $kgdb; then if $kgdb; then
extra_append="$extra_append kgdboc=ttyS0,115200" extra_append="$extra_append kgdboc=ttyS0,115200"
fi fi
cmd="gdb -q -ex start --args ./buildroot/output/host/usr/bin/qemu-system-x86_64 \ cmd="$debug_qemu ./buildroot/output/host/usr/bin/qemu-system-x86_64 \
-M pc \ -M pc \
-append 'root=/dev/vda $extra_append' \ -append 'root=/dev/vda $extra_append' \
-drive file=${images_dir}/rootfs.ext2,if=virtio,format=raw \ -drive file=${images_dir}/rootfs.ext2,if=virtio,format=raw \

BIN
screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB