r3668 - trunk/src/host/qemu-neo1973/openmoko

andrew at sita.openmoko.org andrew at sita.openmoko.org
Tue Dec 18 02:00:22 CET 2007


Author: andrew
Date: 2007-12-18 02:00:20 +0100 (Tue, 18 Dec 2007)
New Revision: 3668

Added:
   trunk/src/host/qemu-neo1973/openmoko/qemu-auto.sh
   trunk/src/host/qemu-neo1973/openmoko/qemu-cmd.pl
   trunk/src/host/qemu-neo1973/openmoko/qemu-gadget.sh
   trunk/src/host/qemu-neo1973/openmoko/qemu-quit.sh
   trunk/src/host/qemu-neo1973/openmoko/qemu-upload.sh
Modified:
   trunk/src/host/qemu-neo1973/openmoko/env
Log:
Add commands for controlling qemu from inside scripts.


Modified: trunk/src/host/qemu-neo1973/openmoko/env
===================================================================
--- trunk/src/host/qemu-neo1973/openmoko/env	2007-12-17 18:46:55 UTC (rev 3667)
+++ trunk/src/host/qemu-neo1973/openmoko/env	2007-12-18 01:00:20 UTC (rev 3668)
@@ -14,6 +14,9 @@
 which gecho && echo=gecho
 export make echo
 
+qemu_monitor="$HOME/.qemu_monitor"
+qemu_cmd () { $script_dir/qemu-cmd.pl "$qemu_monitor" "$*"; }
+
 kernel_addr=0x30800000
 splash_addr=0x36000000
 splash_size=0x5000

Added: trunk/src/host/qemu-neo1973/openmoko/qemu-auto.sh
===================================================================
--- trunk/src/host/qemu-neo1973/openmoko/qemu-auto.sh	2007-12-17 18:46:55 UTC (rev 3667)
+++ trunk/src/host/qemu-neo1973/openmoko/qemu-auto.sh	2007-12-18 01:00:20 UTC (rev 3668)
@@ -0,0 +1,37 @@
+#! /usr/bin/env bash
+# Basically just runs qemu, in a way that qemu-upload.pl works.
+#
+# Copyright (C) 2007 OpenMoko, Inc.
+# Written by Andrzej Zaborowski <andrew at openedhand.com>
+# All Rights Reserved
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+
+. openmoko/env
+
+if [ -e $qemu_monitor ]; then
+	echo A QEMU session appears to be already active
+	exit -1
+fi
+
+trap "rm -rf $qemu_monitor; stty sane" INT EXIT
+
+$qemu -mtdblock "$script_dir/$flash_image"		\
+	-kernel "$script_dir/openmoko-kernel.bin"	\
+	-snapshot -usb -show-cursor -parallel none	\
+	-usbdevice keyboard -usbgadget -serial stdio	\
+	-monitor unix:$qemu_monitor,server,nowait	\
+	$@


Property changes on: trunk/src/host/qemu-neo1973/openmoko/qemu-auto.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/src/host/qemu-neo1973/openmoko/qemu-cmd.pl
===================================================================
--- trunk/src/host/qemu-neo1973/openmoko/qemu-cmd.pl	2007-12-17 18:46:55 UTC (rev 3667)
+++ trunk/src/host/qemu-neo1973/openmoko/qemu-cmd.pl	2007-12-18 01:00:20 UTC (rev 3668)
@@ -0,0 +1,9 @@
+#! /usr/bin/perl -w
+use strict;
+use Socket;
+if ($#ARGV > 0) {
+	socket(SOCK, PF_UNIX, SOCK_STREAM, 0)	|| die "socket: $!";
+	connect(SOCK, sockaddr_un("$ARGV[0]"))	|| die "connect: $!";
+	print SOCK "$ARGV[1]\n";
+	close SOCK;
+}


Property changes on: trunk/src/host/qemu-neo1973/openmoko/qemu-cmd.pl
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/src/host/qemu-neo1973/openmoko/qemu-gadget.sh
===================================================================
--- trunk/src/host/qemu-neo1973/openmoko/qemu-gadget.sh	2007-12-17 18:46:55 UTC (rev 3667)
+++ trunk/src/host/qemu-neo1973/openmoko/qemu-gadget.sh	2007-12-18 01:00:20 UTC (rev 3668)
@@ -0,0 +1,25 @@
+#! /usr/bin/env bash
+# Plugs the virtual USB cable to host's gadgetfs interface.
+#
+# Copyright (C) 2007 OpenMoko, Inc.
+# Written by Andrzej Zaborowski <andrew at openedhand.com>
+# All Rights Reserved
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+
+. openmoko/env
+
+qemu_cmd usb_add gadget:1


Property changes on: trunk/src/host/qemu-neo1973/openmoko/qemu-gadget.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/src/host/qemu-neo1973/openmoko/qemu-quit.sh
===================================================================
--- trunk/src/host/qemu-neo1973/openmoko/qemu-quit.sh	2007-12-17 18:46:55 UTC (rev 3667)
+++ trunk/src/host/qemu-neo1973/openmoko/qemu-quit.sh	2007-12-18 01:00:20 UTC (rev 3668)
@@ -0,0 +1,25 @@
+#! /usr/bin/env bash
+# Stops qemu.
+#
+# Copyright (C) 2007 OpenMoko, Inc.
+# Written by Andrzej Zaborowski <andrew at openedhand.com>
+# All Rights Reserved
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+
+. openmoko/env
+
+qemu_cmd quit


Property changes on: trunk/src/host/qemu-neo1973/openmoko/qemu-quit.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/src/host/qemu-neo1973/openmoko/qemu-upload.sh
===================================================================
--- trunk/src/host/qemu-neo1973/openmoko/qemu-upload.sh	2007-12-17 18:46:55 UTC (rev 3667)
+++ trunk/src/host/qemu-neo1973/openmoko/qemu-upload.sh	2007-12-18 01:00:20 UTC (rev 3668)
@@ -0,0 +1,29 @@
+#! /usr/bin/env bash
+# Passes a file to the system in the emulator.
+#
+# Copyright (C) 2007 OpenMoko, Inc.
+# Written by Andrzej Zaborowski <andrew at openedhand.com>
+# All Rights Reserved
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+
+. openmoko/env
+
+if [[ "$1" == "" ]]; then
+	qemu_cmd eject
+else
+	qemu_cmd change sd0 fat:$1
+fi


Property changes on: trunk/src/host/qemu-neo1973/openmoko/qemu-upload.sh
___________________________________________________________________
Name: svn:executable
   + *





More information about the commitlog mailing list