diff --git a/README.md b/README.md index 25845f7..660b699 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # 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: diff --git a/run b/run index 2402e31..64614be 100755 --- a/run +++ b/run @@ -39,7 +39,7 @@ env \ make \ BR2_JLEVEL="$(($(nproc) - 2))" \ HOST_QEMU_OPTS="--enable-debug --enable-sdl --with-sdlabi=2.0" \ - host-qemu-reconfigure \ + host-qemu-rebuild \ kernel_module-rebuild \ all \ ; diff --git a/runqemu b/runqemu index b930bd9..01534ef 100755 --- a/runqemu +++ b/runqemu @@ -5,6 +5,7 @@ set -e # CLI handling. arch=x86_64 debug=false +debug_qemu='' kgdb=false nographic=false extra_append='' @@ -31,6 +32,9 @@ while getopts a:dkn OPT; do extra_flags="$extra_flags -nographic" nographic=true ;; + q) + debug_qemu='gdb -q -ex start --args' + ;; esac done shift "$(($OPTIND - 1))" @@ -42,7 +46,7 @@ case "$arch" in if $kgdb; then extra_append="$extra_append kgdboc=ttyS0,115200" 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 \ -append 'root=/dev/vda $extra_append' \ -drive file=${images_dir}/rootfs.ext2,if=virtio,format=raw \ diff --git a/screenshot.png b/screenshot.png new file mode 100644 index 0000000..71a4cb1 Binary files /dev/null and b/screenshot.png differ