summaryrefslogtreecommitdiffstats
path: root/qemu_control
diff options
context:
space:
mode:
Diffstat (limited to 'qemu_control')
-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