summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2010-06-02 12:04:37 -0500
committerPatrick Williams <iawillia@us.ibm.com>2010-06-02 12:04:37 -0500
commit5235cd52014205f358f1a295c5228091e1847efb (patch)
tree235038e3a19a87ceeafd99c4de11158a4619e3a1
parent2fcc3f503c42ab7c5f05276b075698d32bf98057 (diff)
downloadtalos-hostboot-5235cd52014205f358f1a295c5228091e1847efb.tar.gz
talos-hostboot-5235cd52014205f358f1a295c5228091e1847efb.zip
QEMU control script.
-rwxr-xr-xqemu_control27
1 files changed, 27 insertions, 0 deletions
diff --git a/qemu_control b/qemu_control
new file mode 100755
index 000000000..bae9dff26
--- /dev/null
+++ b/qemu_control
@@ -0,0 +1,27 @@
+#!/usr/bin/env perl
+
+use strict;
+
+my $command = shift;
+
+if ("start" eq $command)
+{
+ system "make all > /dev/null";
+ system "qemu-system-ppc64 -bios ./img/kernel.bin -cpu 620 -M prep -m 8mb ".
+ "-nographic -monitor telnet:localhost:4444,server,nowait -daemonize";
+}
+elsif (("stop" eq $command) || ("quit" eq $command))
+{
+ system "echo 'quit' | nc6 localhost 4444 2> /dev/null > /dev/null";
+}
+elsif (("command" eq $command) || ("control" eq $command))
+{
+ system "telnet localhost 4444";
+}
+elsif ("trace" eq $command)
+{
+ system "rm -f /tmp/qemu.trace";
+ system "echo memsave `grep kernel_printk_buffer ./img/kernel.bin.map | sed 's/kernel_printk_buffer//' | sed 's/ *//g'` 4096 \\\"/tmp/qemu.trace\\\" | nc6 -x localhost 4444 2> /dev/null > /dev/null";
+ while (not -e "/tmp/qemu.trace") {};
+ system "cat /tmp/qemu.trace";
+}
OpenPOWER on IntegriCloud