mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
qemumonitor helper, extra_append from CLI, pci_rescan.sh
This commit is contained in:
@@ -95,6 +95,15 @@ or:
|
||||
Ctrl-C A
|
||||
quit
|
||||
|
||||
or:
|
||||
|
||||
./qemumonitor
|
||||
quit
|
||||
|
||||
or:
|
||||
|
||||
echo quit | ./qemumonitor
|
||||
|
||||
See also:
|
||||
|
||||
- <http://stackoverflow.com/questions/14165158/how-to-switch-to-qemu-monitor-console-when-running-with-curses>
|
||||
|
||||
5
qemumonitor
Executable file
5
qemumonitor
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# We could also use Ctrl + Alt + 2 on the SDL GUI,
|
||||
# but that opens up a tiny window which can't scroll up or be searched.
|
||||
# And this is the only way when running in -noscreen.
|
||||
telnet localhost 45454
|
||||
@@ -21,8 +21,8 @@ dd bs=4 status=none if=/dev/lkmc_pci count=1 skip=1 | od -An -t x1
|
||||
printf '\x80\x00\x00\x00' | dd bs=4 status=none of=/dev/lkmc_pci count=1 seek=8
|
||||
# factorial(0xC) = 0x1c8cfc00
|
||||
printf '\x0C\x00\x00\x00' | dd bs=4 status=none of=/dev/lkmc_pci count=1 seek=2
|
||||
# => interrupt
|
||||
# Yes, we should the interrupt to notify poll, but lazy.
|
||||
# => irq_handler .*
|
||||
# Yes, we should use the interrupt to notify poll, but lazy.
|
||||
sleep 1
|
||||
dd bs=4 status=none if=/dev/lkmc_pci count=1 skip=2 | od -An -t x1
|
||||
dd bs=4 status=none if=/dev/lkmc_pci count=1 skip=8 | od -An -t x1
|
||||
@@ -30,10 +30,10 @@ dd bs=4 status=none if=/dev/lkmc_pci count=1 skip=8 | od -An -t x1
|
||||
|
||||
# Manual IRQ raising.
|
||||
printf '\x04\x03\x02\x01' | dd bs=4 status=none of=/dev/lkmc_pci count=1 seek=24
|
||||
# => interrupt
|
||||
# => irq_handler .*
|
||||
sleep 1
|
||||
printf '\x08\x07\x06\x05' | dd bs=4 status=none of=/dev/lkmc_pci count=1 seek=24
|
||||
# => interrupt
|
||||
# => irq_handler .*
|
||||
sleep 1
|
||||
|
||||
# Teardown.
|
||||
|
||||
2
rootfs_overlay/pci_rescan.sh
Executable file
2
rootfs_overlay/pci_rescan.sh
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
echo 1 > /sys/bus/pci/rescan
|
||||
5
runqemu
5
runqemu
@@ -10,7 +10,7 @@ kgdb=false
|
||||
nographic=false
|
||||
extra_append=''
|
||||
extra_flags=''
|
||||
while getopts a:dknq OPT; do
|
||||
while getopts a:de:knq OPT; do
|
||||
case "$OPT" in
|
||||
a)
|
||||
arch=$OPTARG
|
||||
@@ -19,6 +19,9 @@ while getopts a:dknq OPT; do
|
||||
debug=true
|
||||
extra_flags="$extra_flags -S -s"
|
||||
;;
|
||||
e)
|
||||
extra_append="$extra_append $OPTARG"
|
||||
;;
|
||||
k)
|
||||
debug=true
|
||||
extra_append="$extra_append kgdbwait"
|
||||
|
||||
Reference in New Issue
Block a user