mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-26 19:51:35 +01:00
now this works
This commit is contained in:
3
run
3
run
@@ -2,7 +2,8 @@
|
|||||||
set -e
|
set -e
|
||||||
cd buildroot
|
cd buildroot
|
||||||
#make BR2_EXTERNAL="$(pwd)/../kernel_module" qemu_x86_64_defconfig
|
#make BR2_EXTERNAL="$(pwd)/../kernel_module" qemu_x86_64_defconfig
|
||||||
make BR2_EXTERNAL="$(pwd)/../kernel_module" qemu_arm_vexpress_defconfig
|
#make BR2_EXTERNAL="$(pwd)/../kernel_module" qemu_arm_vexpress_defconfig
|
||||||
|
make BR2_EXTERNAL="$(pwd)/../kernel_module" qemu_arm_versatile_defconfig
|
||||||
# Can't get rid of this for now.
|
# Can't get rid of this for now.
|
||||||
# http://stackoverflow.com/questions/44078245/is-it-possible-to-use-config-fragments-with-buildroots-config
|
# http://stackoverflow.com/questions/44078245/is-it-possible-to-use-config-fragments-with-buildroots-config
|
||||||
cat ../buildroot_config_fragment >> .config
|
cat ../buildroot_config_fragment >> .config
|
||||||
|
|||||||
9
rungdb
9
rungdb
@@ -4,19 +4,14 @@ if [ "$#" -gt 0 ]; then
|
|||||||
else
|
else
|
||||||
brk=""
|
brk=""
|
||||||
fi
|
fi
|
||||||
gdb="$(pwd)/buildroot/output/host/usr/bin/x86_64-linux-gdb"
|
gdb="$(pwd)/buildroot/output/host/usr/bin/arm-linux-gdb"
|
||||||
cd buildroot/output/build/linux-*.*.*/
|
cd buildroot/output/build/linux-*.*.*/
|
||||||
cmd="$gdb \
|
cmd="$gdb \
|
||||||
-q \
|
-q \
|
||||||
-ex 'add-auto-load-safe-path $(pwd)' \
|
-ex 'add-auto-load-safe-path $(pwd)' \
|
||||||
-ex 'file vmlinux' \
|
-ex 'file vmlinux' \
|
||||||
-ex 'set arch i386:x86-64:intel' \
|
|
||||||
-ex 'target remote localhost:1234' \
|
|
||||||
$brk \
|
|
||||||
-ex 'continue' \
|
|
||||||
-ex 'disconnect' \
|
|
||||||
-ex 'set arch i386:x86-64' \
|
|
||||||
-ex 'target remote localhost:1234' \
|
-ex 'target remote localhost:1234' \
|
||||||
-ex 'lx-symbols ../kernel_module-1.0/'
|
-ex 'lx-symbols ../kernel_module-1.0/'
|
||||||
"
|
"
|
||||||
|
#-ex 'set arch i386:x86-64:intel' \
|
||||||
eval "$cmd"
|
eval "$cmd"
|
||||||
|
|||||||
25
runqemu
25
runqemu
@@ -23,12 +23,9 @@ done
|
|||||||
|
|
||||||
# If we turn on buildroot host QEMU some day.
|
# If we turn on buildroot host QEMU some day.
|
||||||
#cmd="./buildroot/output/host/usr/bin/qemu-system-x86_64 \
|
#cmd="./buildroot/output/host/usr/bin/qemu-system-x86_64 \
|
||||||
#cmd="qemu-system-x86_64 \
|
|
||||||
#-M pc \
|
|
||||||
#-net nic,model=virtio \
|
|
||||||
#-kernel buildroot/output/images/bzImage \
|
|
||||||
#cmd="qemu-system-arm \
|
#cmd="qemu-system-arm \
|
||||||
#-M vexpress-a9 \
|
#cmd="qemu-system-x86_64 \
|
||||||
|
#-M pc \
|
||||||
#-append 'root=/dev/vda $extra_append' \
|
#-append 'root=/dev/vda $extra_append' \
|
||||||
#-drive file=buildroot/output/images/rootfs.ext2,if=virtio,format=raw \
|
#-drive file=buildroot/output/images/rootfs.ext2,if=virtio,format=raw \
|
||||||
#-kernel buildroot/output/images/zImage \
|
#-kernel buildroot/output/images/zImage \
|
||||||
@@ -36,20 +33,16 @@ done
|
|||||||
#-net user \
|
#-net user \
|
||||||
#-smp 1 \
|
#-smp 1 \
|
||||||
#$extra_flags \
|
#$extra_flags \
|
||||||
|
#-M pc \
|
||||||
|
#-net nic,model=virtio \
|
||||||
|
#-kernel buildroot/output/images/bzImage \
|
||||||
#;
|
#;
|
||||||
#"
|
#"
|
||||||
|
|
||||||
# TODO window opens, but hangs.
|
|
||||||
qemu-system-arm \
|
cmd='qemu-system-arm -M versatilepb -kernel buildroot/output/images/zImage -dtb buildroot/output/images/versatile-pb.dtb -drive file=buildroot/output/images/rootfs.ext2,if=scsi,format=raw -append "root=/dev/sda console=ttyAMA0,115200" -serial stdio -net nic,model=rtl8139 -net user -nographic'
|
||||||
-M vexpress-a9 \
|
#cmd='/data/git/buildroot/output/host/usr/bin/qemu-system-arm -M vexpress-a9 -smp 1 -m 256 -kernel buildroot/output/images/zImage -dtb buildroot/output/images/vexpress-v2p-ca9.dtb -drive file=buildroot/output/images/rootfs.ext2,if=sd,format=raw -append "console=ttyAMA0,115200 root=/dev/mmcblk0" -serial stdio -net nic,model=lan9118 -net user'
|
||||||
-kernel buildroot/output/images/zImage \
|
#cmd='qemu-system-arm -M vexpress-a9 -smp 1 -m 256 -kernel buildroot/output/images/zImage -dtb buildroot/output/images/vexpress-v2p-ca9.dtb -drive file=buildroot/output/images/rootfs.ext2,if=sd,format=raw -append "console=ttyAMA0,115200 root=/dev/mmcblk0" -serial stdio -net nic,model=lan9118 -net user'
|
||||||
-dtb buildroot/output/images/vexpress-v2p-ca9.dtb \
|
|
||||||
-drive file=buildroot/output/images/rootfs.ext2,if=scsi,format=raw \
|
|
||||||
-append "root=/dev/sda console=ttyAMA0,115200" \
|
|
||||||
-serial stdio \
|
|
||||||
;
|
|
||||||
#-net nic,model=rtl8139 \
|
|
||||||
#-net user \
|
|
||||||
|
|
||||||
if $debug && ! $nographic; then
|
if $debug && ! $nographic; then
|
||||||
eval nohup "$cmd" &>/dev/null &
|
eval nohup "$cmd" &>/dev/null &
|
||||||
|
|||||||
Reference in New Issue
Block a user